Server Method for validating multiple on Tab

Former Member
Former Member
Hello, I am working on creating a method to validate if all check boxes on a related item tab have been checked at the time of activity voting.  The thought was to throw an error if a box is unchecked when the user try's to vote to prevent premature exiting of an activity. The checkbox has been added to the related item itemtype as a Boolean property called "is_completed".  My thought was to create a method and attach to the workflow server event using "On Vote" for the activity, however, I cannot seem to nail down a conditional field. I have tried many variations of methods unsuccessfully so hopefully what is below will adequately represent the intent enough to give people an idea of what I am trying to do, (so for the unsophisticated approach, I am a mechanical engineer): Innovator inn = this.getInnovator(); string AML = "<AML><Item type='OB Day 1' action='get' select='is_completed' where='[OB_Day_1].is_completed=0'><is_completed condition='eq'>0</is_completed></Item></AML>"; Item result = inn.applyAML(AML); if (AML = "0"); { return inn.newError("All items have not been checked off as Completed on the Day 1 Tab!"); } return result; Thank you in advance for looking at this, I looked forward to your response.  
Parents
  • Hi bryans, It sounds like you need to get the controlled item (ex: the ECO if you are voting on an ECO) for the workflow activity and then check a property on the item. Here's some sample code that might help: Innovator inn = this.getInnovator(); Item controlledItem = this.apply("Get Controlled Item"); bool is_completed = controlledItem.getProperty("is_completed","0"); if (!is_completed) return inn.newError("Must be complete!"); return this; Eli
    Eli Donahue Aras Labs Software Engineer
Reply
  • Hi bryans, It sounds like you need to get the controlled item (ex: the ECO if you are voting on an ECO) for the workflow activity and then check a property on the item. Here's some sample code that might help: Innovator inn = this.getInnovator(); Item controlledItem = this.apply("Get Controlled Item"); bool is_completed = controlledItem.getProperty("is_completed","0"); if (!is_completed) return inn.newError("Must be complete!"); return this; Eli
    Eli Donahue Aras Labs Software Engineer
Children
No Data