Validation on Customer Load for Marketing Documents
AnsweredHello,
I want to load a set of validations on load of a customer but the problem is, every time I do a "copy to" it reloads. I have tried "ItemChanged" but it says this is not functional for items with choose lists (item 4;54).
So consequently I either have to trigger it every single time the form loads OR never.
I want it to load ONCE on the first time the customer is loaded for the chain of documents, not every single time i do a "Copy To".
Please help, I've tried so many things,
Mike
-
Official comment
Hi Mike,
I have forwarded your question to our support team.
Thanks, Naama
-
I had the idea to make a boolean field (yes/no) on the document to indicate if the OnLoad macro has been run but when I tried to use the SQL conditions on the B1 Validation this did not work properly.
I had to do the IF statement in the universal function where I run the universal function each time BUT using the IF statement I run the actual OnLoad universal function ONLY when my custom field is set to "No".
Using the UF(); macro field to run another universal function worked properly. So now when I load a customer to a sales quote for example it sees that it's the first time I've added a customer to this chain of documents. When it sees my indicator field is set to "No" in the universal function macro it then triggers the OnLoad macro which does the updates. And at the end of the OnLoad macro it flips the indicator field to "Yes".
Then when you copy to a sales order, etc. it won't trigger the OnLoad function again because the indicator field is now set to "Yes". So it still runs the first UF but this UF simply has the IF statement and the UF trigger.
So this is how you can cleanly trigger a set of updates on a marketing document without having them retrigger every time you do a "Copy To".
It would be nice to see this work properly in the B1 Validation SQL conditions but maybe my trigger order was wrong, I just couldn't get it working without using the dual universal functions.
Thanks!
Please sign in to leave a comment.
Comments
2 comments