Hello everyone,
I want to add some business validation before the users save a work order based on the below scenarios:
- Prevent users to save the Work order if the system status selected is "closed-posted" and the agreement lookup value linked to the WO has status "Cancelled agreement".
- Prevent the users from closing the work order if the incident type is "visit" and the Products grid contains one product.
I started this week to learn plugins and the above I think requires that. However, if a real-time workflow can achieve the above to throw an exception error for the user in the form based on the above conditions what is the best way to do it?
I want someone to point me to some resources or provide an example based on the below:
- How can I extract from a lookup value a specific field attribute which is in my case the status option set type of the agreement table using a plugin?
- How can I make a condition to check if the products grid is empty or the rows are equal to 0 using a plugin?
- Does the above scenarios can be achieved using one plugin onUpdate event?
I want a piece of advice on what is the easiest and the fastest solution to solve the above scenarios.
If someone can provide an example It would be highly appreciated.
Thank you!!