In some use cases, some organizations want to remove certain statuses from the ‘change status’ dialog in the Work Order Tracking application. So the question is, how can this be done? In this scenario, we are going to remove the APPR status from the dialog using global data restrictions.
We are gonna use the global data restrictions to limit the values from the ‘change status’ dialog, but there are other ways to do it. We are setting it at a global level, because we are essentially “removing” it from the WOTRACK application. You could use this restriction based on individual security groups as well.
First, Go To -> Security Groups. Then click on Select Action -> Global Data Restrictions.
Click ‘New Row’ to add a new restriction and ensure the fields are like so:
Condition: Click on the arrow and Go To Conditional Expression Manager to auto generate a new record.
Enter the field values as so:
Expression: (value not in (‘APPR’) and domainid = ‘WOSTATUS’) or (domainid <> ‘WOSTATUS’)
Always Evaluate?: CHECKED
Once done, click on Return with Value on the top right of the page.
Click OK on the Global Restrictions dialog so everything is saved.
Next, open Work Order Tracking and test it out. When you try to change a record that is currently in WAPPR, you no longer see the APPR status!
So let’s review the SQL expression we used. You can see the code is checking for values not in ‘APPR’ but it is also checking if the DOMAINID = ‘WOSTATUS’. Why? Because since we applying this global restriction to the whole WOTRACK application, any other field that is using a SYNONYMDOMAIN such as the field ‘Originating Record Class’, we still want those dialog values to work properly. So expression has to check if the domain is WOSTATUS or not.