Can a validation be performed on OnCreate or OnEdit scripts?

Can a validation be performed on OnCreate or OnEdit scripts?

mpasumarti
Advocate Advocate
712 Views
2 Replies
Message 1 of 3

Can a validation be performed on OnCreate or OnEdit scripts?

mpasumarti
Advocate
Advocate

As you know OnCreate and OnEdit scripts are action scripts meant for performing an action. Can a validation be performed in those scripts and user can be alerted (error message be thrown to user)?

For example, user needs to select a supplier field on an item on create/edit, the system should check if there exists a group with the same name as supplier and alert the user, if it doesn't exist.

 

I know that this message can be moved to a validation script on a workflow. But, I am still wondering if there is a way to alert the user from either of those action scripts.

 


Thanks,
Madhav
0 Likes
Accepted solutions (1)
713 Views
2 Replies
Replies (2)
Message 2 of 3

tony.mandatori
Autodesk
Autodesk
Accepted solution

FLC doesn't have custom validations for creating/editing items.  Validations are really useful because they give the user immediate feedback that something is wrong.  On item creation, one way to provide immediate feedback is to create a required field.  Can you make this field required?

 

Validation applies nicely to Workflows.  So in this context, I'm guessing the item will eventually be released through a change order.  Does it make sense to validate the item details for the affected items while submitting the change order (Submit is usually the first step in the process, performed by the owner). 

 

Do either of these work?

 

0 Likes
Message 3 of 3

mpasumarti
Advocate
Advocate

As the validations can't be performed in create/edit scripts as well as there is no possibility to make the field mandatory (Additional Owners system field), I'll go with second option by adding a validation on submit of respective item.

 

Thanks for your inputs.


Thanks,
Madhav
0 Likes