Solved

Expressions

  • 26 July 2023
  • 2 replies
  • 82 views

Badge

Please correct me if this expression is wrong !

 

if ($new.affectedUser.manager.manager.assystUserAlias.shortCode = $NO_VALUE, $CURRENT_VALUE, $new.affectedUser.manager.assystUserAlias.shortCode)

 

This expression is to take approval from Manager of Manager (VP).

 

Thanks

icon

Best answer by Alan Macfarlane 26 July 2023, 15:15

View original

2 replies

Badge +2

Hello,

Please use the following from the wiki: https://wiki.axiossystems.com/assyst11-6Wiki/index.php/Task_Expressions_in_an_Approvals_Workflow_Worked_Example#Manager_Approval

if ($new.affectedUser.manager.assystUserAliasShortCode = $NO_VALUE, $CURRENT_VALUE, $new.affectedUser.manager.assystUserAliasShortCode)

Kind regards,

Michael

Userlevel 2
Badge +5

Either should work - the properties they reference are synonymous. The manager is of the type contactUserDto which has an assystUserAliasShortCode and an assystUserAlias (which is of the type assystUserDto and has a shortCode property). 

 

However they will have different outcomes. Your example Michael will assign to the affected user’s manager (if there is one) whereas raza-mq’s expression will assign to the affected users manager (if there is one) only if the affected user’s manager has a manager 

 

raza-mq’s expression:

if ($new.affectedUser.manager.manager.assystUserAlias.shortCode = $NO_VALUE, $CURRENT_VALUE, $new.affectedUser.manager.assystUserAlias.shortCode)

 

Michael’s expression:

if ($new.affectedUser.manager.assystUserAliasShortCode = $NO_VALUE, $CURRENT_VALUE, $new.affectedUser.manager.assystUserAliasShortCode)

 

The original request was for “approval from Manager of Manager (VP)” so either:

 

if ($new.affectedUser.manager.manager.assystUserAlias.shortCode = $NO_VALUE, $CURRENT_VALUE, $new.affectedUser.manager.manager.assystUserAlias.shortCode)

 

or 

if ($new.affectedUser.manager.manager.assystUserAliasShortCode = $NO_VALUE, $CURRENT_VALUE, $new.affectedUser.manager.manager.assystUserAliasShortCode)

 

Should work. 

Reply