I have created an Instance Action on WorkAssignment to invoke a create action on an user business class. The Create Action then invokes another instance action within the user business class that updates a field and should look at a relation to the table and update the fields for each one that matches. The create action works and the invoked instance works except for the part of updating the other relations. However if I run that action manually within the user business class, it works and updates the other relation fields correctly. Any suggestions?
WorkAssignment Instance Action:
AssignAmbassador is an Instance Action
Parameters
PrmEmployee is an Employee
PrimaryAmbassadorForEmployee is Boolean
Parameter Rules
PrmEmployee
required
"AmbassadorIsRequired"
Action Rules
invoke AssignAmbassadorCreate ASPAmbassadorOnboarding
invoked.HROrganization = 10
invoked.Employee = PrmEmployee
invoked.OnboardingEmployee = Employee
invoked.AssignOnboardingWorkAssignment = WorkAssignment
invoked.AssignOnboardingPosition = Position
invoked.AssignPrimaryAmbassadorForEmployee = PrimaryAmbassadorForEmployee
User Business Class Create Action:
AssignOnboardingEmployeeCreate is a Create Action
restricted
Exit Rules
if (AssignPrimaryAmbassadorForEmployee)
invoke DesignateAsPrimaryAmbassador
invoke DesignateWorkAssignmentInfo
User Business Class Instance Action:
DesignateAsPrimaryAmbassador is an Instance Action
valid when (not AmbassadorIsPrimary)
Action Rules
confirmation required
"<Employee.Name.PreferredFirstAndLastName>WillBeDesignatedAsThePrimaryAmbassadorFor<ASPAmbassadorOnboarding.OnboardingEmployee.Name.PreferredFirstAndLastName>;Continue?"
AmbassadorIsPrimary = true
Exit Rules
for each OtherPrimaryAmbassadors
invoke RemoveAsPrimaryAmbassador each