How Can We Help?
Question
I have fields that are set to require at design time and run time and this works like a charm when the users decide on some actions that need these fields.
There are some cases however where the user wants to “Save” or “Cancel” the activityA specific step in a process. It will be the user interface for that step (web form or a screen), for example, the Leave Application (screen interface or web form) will be the first Activity in the Leave Requisition process. The Leave Application Authorization will be the second step or Activity in the Leave Requisition process. One Process can have multiple activities. and in order to make that simple I need a way to make the fields unrequired from the command option.
At the moment, they are prompted to complete all the required fields simply to save the activity.
At the moment, I am running v5.1.2 but planning on upgrading to 5.1.3
I know the question is a rather simple one, but it is causing a fair amount of inconvenience for our clients.
Answer
At activity level, create a method to handle the required not required as the sample:
public void NotRequired() { ObjectGroup NotRequiredGrp = activity.ObjectGroups["0"]; NotRequiredGrp["RE1010Object"].Required = false; }
Declare a variable outside of the OnRefresh and OnLoad methods:
ObjectGroup grp;
In the OnRefersh method of the activity, add the following:
grp = activity.ObjectGroups["-1"]; EventControl triggerControl = grp["TRIGGER TO CHECK"]; if (Convert.ToString(triggerControl[0, false]).ToUpperInvariant() == "TRUE") { NotRequired(); }
Comments are closed.