Validation on Vendor field in Purchase Order
AnsweredI am trying to add a validation of type Validate [Leaving a Field] on the Vendor field ($[4.0.0]) of the Purchase Order. It is working except that it fires upon the screen opening causing an undesirable user experience. It also fires on closing the form (cancel) and in moving to a new record if starting in Add mode. The latter is a more of an issue.
I have tried various combinations of the trigger settings with no luck so far. Is it possible to make this work as desired?

-
Official comment
Hello Scott,
In this case, this simple validation does nothing, a validation is just a trigger so all the user experience like closing the window, etc. is caused by something else, for example the Universal Function executed. I Suggest ou contact your partner and explain the requirement desired and send all the screnshots involved in the configuration.
-
Putting it in and IF ($[$4.0.0]) <> '' structure took care of most issues although it would be good to document any limitation on this kind of validation.
-
I'm just trying to understand why the trigger fires when there appears to be no change in the field, no leaving of the field. It seemed reasonable that only a user action of moving into and then out of the field would trigger the action. There is nothing else connected with that field. From your statement it seem like there would be an expectation that it not fire when the screen is opened (or closed) if there is not another action on the field - the same as mine.
-
Hi Scott
I suggest that you do a step-by-step trouble shooting/debugging.
I would first make this validation in active to see if it does anything when you Add the document because from the screen shot you showed, it should only work on Add.
Then I would use B1UP's menu choice to create the validation and trigger, i.e. right click on the field, then select B1 Usability Pack > Add B1 Validation > when this item is validated. This way system will automatically fill in everything correctly for you.
I would then use 'No Condition' and assign a UF that's a simple message - like 'Hello world'
if the above works, then I would swap for the UF you want to use.
If it works again, then finally I would put in the SQL condition, assign it with UF.
If you follow this sequence to create your validation, then you would know which step goes wrong.
-
Yes, so I just did a very simple test. I set up the same validation on the Business Partner field pointing to a no-condition message UF that simply says "Business Partner Validated". Nothing else. I have set the options as shown above (and tried other settings as well). Upon opening an empty PO screen, which of course opens in Add mode, I see the message box before the screen appears. Clearly, the user has not left the business partner field since the window is not even available. Closing the window or moving to an existing record with no other activity also fires the message. Of course, it does also fire after entering a value and moving out of the field.
This seems a counter-intuitive action given that it is supposed to fire only upon leaving the field.
Also unnerving is that changing it to fire only if the item changed (item changed = true) causes it to not happen at all, even after keying in a new business partner and moving to the next field.
Questions are also simple. Is this expected behavior? Is it documented? Is there a formal workaround (other than mine above)?
-
Hi Scott,
Try to set "before action" to "False".
If that does not work, please contact your partner (Vision 33) for more advanced troubleshooting.
Thanks, Naama
-
Hi Scott
This is not the normal behaviour. I just did a quick test for you and I do not have the issue that you have - i.e. opening the form causes the trigger to fire.
I am attaching my quick test on Sales Quotation here. If you still have issue, I suggest that you get some help from your Service Provider.

-
I notice that you add the IF statement which I had pointed out dealt with the issue. It is simply obscure as to why that would be needed and whether that is needed on all key or linked fields in the system. It is without that statement that the trigger fires even though there has been no activity in the field. Is this behavior documented?
Thanks,
Scott
-
Hi Scott,
A "Validate" event will fire in case there is a value and if there is none. So if you want to clarify to the system a specific case you want this validate event to work on - then an SQL query would help.
Thanks, Naama
Please sign in to leave a comment.
Comments
9 comments