cancel
Showing results for 
Search instead for 
Did you mean: 

Help to dynamically change mandatory specifications

Former Member
0 Kudos

Hi,

I am using Work Manager for Maximo - where we have a Collection called Specifications on the WorkOrder object (there probably is something similar in the SAP version).  This functionality enables us to specify a series of questions or fields for the user to fill out when working on a work order.  What I would like to do is have some following questions not pop up if a question is answered a certain way (I know this will require hardcoding).  Lets say there are 10 specifications - and the 5th one has a Yes/No type field and if you select No then specs 6 and 7 are not displayed.

The out of box version of work manager has an action to loop though all the specifications and pop up an edit screen/transaction for each spec.  This has an execution rule to determine which specs to edit which sounds like where I would start.

Has anyone done something similar and can give me some pointers?

Accepted Solutions (1)

Accepted Solutions (1)

jason_latko
Advisor
Advisor
0 Kudos

Cameron,

You are correct in that you would need to change the execute rule on the looping sub-action.  Can you be more specific as to how complex your logic needs to be?  I can give you a better idea on how to handle this if I knew more of what you need to accomplish.

Jason Latko - Senior Product Developer at SAP

Former Member
0 Kudos

Hi Jason,

In the specifications I have a record representing the question - Is Reinstatement Needed? - it has a domain with Yes and No.  Then there are two records representing follow up fields/information the user needs to collect if the answer Yes (reinstatement type, and reinstatement area). Ie I do not want them to be displayed if the user answered the question with No.

The first part of the question is when does Agentry select the specifications? The current execute rule is the out of the box rule to filters the specs to those that are mandatory - so does Agentry select all the records at once, then loop through the action or does it get the first one, do the action then look for the next record? If it is one at a time then it should be possible.

The second part am I better to have the sub-action test the user's answer to the first question and if the answer no then look for the other two specification records and set the manditory field to No so they are not shown.  Or am I better to do it all on the Execute rule - for example test if this record is one of the two follow up questions, then look for the answer on the original question and decide based on the answer.

The execute rule seems easier.  I expect someone has done or tried to do this so since I had a little time before needing to start on the issue, I thought I would ask first.  I will probably add fields to the specification to make finding these linked questions easier - and enable the rules to be more flexible.

Thanks,

Cameron.

jason_latko
Advisor
Advisor
0 Kudos

Cameron,

The execute rule will run once for every specification in the collection as it is looping over them, so you can make decisions based on things that have happened previously with the user's answers.  I would recommend just using the execute rule to manipulate the questions.  You could use temp variables in the main object as place holders: TempYes, TempAnswered could be Boolean field that you would set in addition to your normal transaction properties.  First set the TempAnswered to False before your loop starts.  Next set TempAnswered to True when the yes/no question has been answered, and TempYes to true or false depending on how they answered.  Then you can refer to these in the execute rule to decide if subsequent questions should be displayed.

Jason Latko - Senior Product Developer at SAP

Former Member
0 Kudos

Thanks Jason - especially for the the temp variable idea - that is going to make things a lot easier.

Thanks,

Cameron.

Former Member
0 Kudos

I have just implemented this - thanks again for your advice Jason.

Answers (0)