The best solution to solve the problem is to use an automation script with an attribute launch point.
This is documented in this post but i made few improvements to it.
My script resets the asset only when the location has been changed and ASSETNUM is changing from null to a new value. This is because there is already a warning dialog when the asset is changed from another value.
This is how I have defined my automation script. I have tested it for Service Requests application but it should work fine for Work Orders as well.
- Script: SR_LOCATION
- Language: python
- Launch Point: SR_LOCATION_ACTION
- Object: SR (this could be also be WORKORDER or TICKET)
- Attribute: LOCATION
- Event: Run Action (Validate should also work)
- Variables: none
Script:
from psdi.mbo import MboConstants if not mbo.isNull("LOCATION"): if mbo.getMboValue("ASSETNUM").getPreviousValue().asString()=="" and not mbo.isNull("ASSETNUM"): mbo.setValueNull("ASSETNUM", MboConstants.NOVALIDATION_AND_NOACTION)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.