Dynamic Code Variables
|Previous Next | Direct link to this topic|
It is possible to have a Dynamic Code that before execution will ask for input before execution. This feature is called Dynamic Code Variables
You can ask for up to 20 variables using the [%0], [%1] ... [%19] syntax
What you do is to simple put the variable keyword as a placeholder for where you want your value to appear. You can use the same variable multiple times and in any order.
You then press the Variables button to define the individual variable's format
When you use the Dynamic Code it will instead of execution prompt you for the configured input
and once the OK Button is pressed the Dynamic Code will execute.
Tip: All Dynamic Codes use the same window to ask for their input. You might however want to use the B1 Validation System to validate the input before execution, but if you only did the validation on the FormType you would affect multiple configurations. For that reason a special Keyword $[$UFCODE.0.0] can be used to know what UF-Code create the input screen.
Important information about limitations and format:
•All Dynamic Code variables are collected upfront and are not a blocking operation (technical limitation from the SDK) so you can as an example use Dynamic Code Variable to ask for missing data prior to pressing an Add button (the result would be that the Dynamic Code prompt would appear but SAP Business One would have already proceeded with the Adding on the business object).
•Dynamic Code-prompt is a modal form so while on screen you can't go to any of the other screens in SAP Business One
•Values that replace the Dynamic Code Variables keywords are formatted for usage in the SAP Gui. This means dates are in format yyyy-MM-dd and decimal values are use . (dot) as comma separator and no thousands separator. This mean that if you wish to display the input value to the user you need to format them using SQL:
•A Dynamic Code vars prompt is not possible to confirm via Enter as normal (Technical limitation from SAP). You always need to use the Mouse to press the OK button.