@STORE variable conflicts Answered
One of my big challenges with Boyum B1UP UF Macros is:
Macro 1 will create Sales Orders and uses all 10 @STORE variables
Sales Orders have a validation that calls Macro 2
Macro 2 uses @STORE8 and overwrites the value and breaks Macro 1
Any solution to this problem?
Chris
Comments
8 comments
Hello Chris,
You can declare additional variables using this syntax:
DECLARE @STORE999;
@STORE999 = 1;
You will find this inormation in our guide for understanding Macro Conditional Commands =)
https://support.boyum-it.com/hc/en-us/articles/204284198-Guide-Understanding-Macro-Conditional-Commands
Thank you Yaremi!. You should add this ability to the B1UP Manual (https://support.boyum-it.com/hc/en-us/articles/219840127-B1UP-Manual)
Chris
You should also add to the manual - What is the scope of the variables? I thought the @STORE variables were local to the function, but maybe that is not true?
What are the variable naming requirements? Does it have to be "@STORE" + a number, or are other characters allowed?
Hi Ed, Thank you for your feedback and sorry for the confusing.
@STORE values have evolved a lot over the years in where they could be used and what they could be called. I've fixed the mistake in the manual now and it will go online for next version.
But here is the short version:
Hi Rasmus,
Do you need to clear / empty the stores after use in case of conflict with other processes, and if so, how is that done?
Thanks
Julie
Hi Julie,
It's not mandatory to clear any variables, but the values will stay in the variables as long as B1UP is running. If you need to clear any variables, just do:
@STORE1 = '';
@STORE2 = '';
etc.
If you want to be on the safe side, you can empty all variables used at the start of the macro.
Best regards,
Thomas
Hi Alex,
This can be done using the B1UP SQL function. B1UP interprets the function's argument as SQL code. For example:
@STORE1 = SQL(SELECT LastPurPrc FROM OITM WHERE ItemCode LIKE '[$38.14.0]');
Please sign in to leave a comment.