Doesnt work:
Do you have any idea why?
[2025-07-17 12:57:26] CRITICAL: (500) Formula script error. Bad function name `MOD:`. :: POST /Lead :: /var/www/html/application/Espo/Core/Record/Formula/Processor.php(94)
ifThen( entity\isNew() && !entity\attribute('assignedUserId'), ( $teamId = '6878c9e44b0e2379b'; $userIds = record\findRelatedMany('Team', $teamId, 'users', null, 'id', 'asc', 'isActive', true); ifThen( array\length($userIds) > 0, ( $currentCursor = number\parseInt(string\concatenate(env\userAttribu te('preferences', 'rrLeadCursor'), '')); $currentCursor = ifThenElse($currentCursor, $currentCursor, 0); $nextIndex = MOD: ($currentCursor, array\length($userIds)); $assignedUserId = array\at($userIds, $nextIndex); entity\setAttribute('assignedUserId', $assignedUserId); entity\addLinkMultipleId('teams', $teamId); $newCursor = ADD: ($currentCursor, 1); env\setUserAttribute('preferences', 'rrLeadCursor', string\concatenate($newCursor, '')); ) ); ) );
Do you have any idea why?
[2025-07-17 12:57:26] CRITICAL: (500) Formula script error. Bad function name `MOD:`. :: POST /Lead :: /var/www/html/application/Espo/Core/Record/Formula/Processor.php(94)
ifThen( entity\isNew() && !entity\attribute('assignedUserId'), ( $teamId = '6878c9e44b0e2379b'; $userIds = record\findRelatedMany('Team', $teamId, 'users', null, 'id', 'asc', 'isActive', true); ifThen( array\length($userIds) > 0, ( $currentCursor = number\parseInt(string\concatenate(env\userAttribu te('preferences', 'rrLeadCursor'), '')); $currentCursor = ifThenElse($currentCursor, $currentCursor, 0); $nextIndex = MOD: ($currentCursor, array\length($userIds)); $assignedUserId = array\at($userIds, $nextIndex); entity\setAttribute('assignedUserId', $assignedUserId); entity\addLinkMultipleId('teams', $teamId); $newCursor = ADD: ($currentCursor, 1); env\setUserAttribute('preferences', 'rrLeadCursor', string\concatenate($newCursor, '')); ) ); ) );
Comment