Return to main navigation Page
Use the Debugger tab to debug advanced functions. Test code in the Debugger by providing different values for the attributes/parameters as inputs. The Debugger varies quite a bit depending on where you are in the application.
Begin in the Input section, located in the upper left-hand corner for the Function Editor.
You should have already added your attributes/parameters under the Attributes tab. What you have added will appear in the first column under Action Inputs.
If there is an error in the syntax, an error message will appear ABOVE the tabs.
This Debugger requires users to select at least one variable and then use a Transaction ID number to import the Values for each attribute you selected. You could also manually enter these values. For more information about Transaction IDs, see Finding the Transaction ID.
There are a number of sub-headings that can be used under the Commerce Library Debugger tab. For more information, see Library Functions.
Test Script: Provides a way to test a BML Library function when array type attributes are input parameters. Within the Test Script, you can populate your own complex data objects and pass it to the library functions to analyze the results. Test Scripts can also be used to compute multiple iterations of the library functions and print each.
View the return statement, it is written as follows:
|Param||If you defined parameters in the header section, they appear here for Debugging.|
|System||Lists the attributes added under the System Attributes section. They appear here so the parameter values can be populated/changed when debugging. Populate values by double-clicking the Value section next to the desired attribute(s).|
|Header||Lists the attributes added under the Main Document Attributes section. You can add values by double-clicking the Value section next to the attribute(s) of your choice.|
|Line Item||Lists the attributes added under the Sub-Document Attributes section. You can populate values for debugging by double-clicking the Value section next to the desired attribute(s).|
In the Common Attribute section, click Add to access the common attributes that are available across the system.
Example: Suppose the function requires you to check the user type of the logged-in user. Choose the user type Common Attribute and reference it in your function.
Finding Transaction ID
In order to use the Debugger in Commerce, you must reference a quote.
Depending on your implementation, you may be able to find the transaction ID under a tab titled Integration. Click the Integration tab and the Transaction ID will be in a text box, located at the right of the screen.
For more information on finding transaction IDs, see Finding the Transaction ID.