Create IMC Script
Go to Model > IMCScript Management tab
Click on add button, to create new IMCScript.
Provide script name and comment. Please take a note that script name must be unique.
Default script status for empty script will be INVALID.
To deep dive into the script, click on script row, as shown below.
The user can either select the custom template (as shown below) or start from scratch to create new script. To persist it, click on save.
Editor will do several checks and balances, and there is possibility of Error/Warning, as shown below in case script is invalid. All error/warning must be fix before activate the script.
Saving the script will automatically validate the script and turn INVALID status to INACTIVE, if script has no compilation errors.
Clicking on Play button will turn the script status ACTIVE, which means, script syntax is valid and now ready to be executed in appropriate entry-points (Groups).
Edit IMC Script
Before making any amendments, user should click Sync and Lock button, which helps to lock the script he is working on. This can avoid concurrent edits for the same script used by different users. Once Sync and Lock is clicked and script has some changes, save button will be enabled.
In the scenarios when user tries to lock the same script, which is locked by another user, he will see the notification, shown as below.
For the user who failed to lock the script (Because it was already locked by another user) can expect to receive a notification once the script is unlocked by another user (See below image).
Delete IMC Script
Alternatively, the user can delete the script anytime, by selecting the checkbox and clicking on delete icon, as shown below.
Test IMC Script
To test the outcome of script, select icon, shown in below screenshot, which will help user to test the script on selected Quote/SalesItem.
Select a Quote from system and click on view line items of selected quote(s). (Boxes shown in green can be helpful to filter the quote user is interested in)
Select a SalesItem and click on close.
Selected Quote and SalesItem will be shown on top left.
Clicking on Execute Script user can see outcome of the script on selected context (Quote and SalesItem) on right hand side. If the outcome is as per expectation user can click on Save to proceed further.
Group IMC Script
Clicking on tab Script Groups will lead to another UI, where multiple entry-points (Groups) are available to execute bunch of scripts. These entry points are predefined by development team which will help user to execute selected script to run at specific point of time. Before proceeding further, let’s take a quick look at some of them.
On Quote Save
Scripts assigned under this group gets executed just before saving Quote.
On Google Map Save
Scripts assigned under this group gets executed just before saving changes on Google map configuration of SalesItem. i.e selection of area in map or updating title etc.
After Pricing
Scripts assigned under this group gets executed whenever any internal or external pricing (i.e. SSC pricing) gets triggered. This can be explicit trigger by user (See image below) as well as auto trigger if default internal pricing is enabled.
Interested users can look on below snapshot to enable default Internal pricing or to Pricing document for more details.
After Update Sales Items
Scripts assigned under this group gets executed whenever any manual update happens on SalesItem i.e. changing quantity or name of SalesItem.
After Update Config Item
Scripts assigned under this group gets executed just after creation of new SalesItem. This can be manual creation as well as creation via excel import. In case of excel import, in bulk, each of these scripts get executed for every SalesItem creation.
Once user understands the usage of each of these group, he can continue to execute the scripts under relevant groups. Let’s see.
Click on + under appropriate group to add the script under it.
Clicking on + will open list of scripts (As shown below), which will allow user to select one or more scripts, which will be added to that group. Click on Add to add script(s) in the group.
User can provide execution priorities. The scripts will be executed as per sequence (Lower number scripts will run first than higher once). The scripts with same priorities will be executed in parallel, which can give better efficiency in run time, however execution sequence of such scripts will be arbitrary.
Note: The groups shown here are just for illustration purpose only and they keep evolving with new releases.
Execute and Audit
After the execution in run-time, the audit logs can be found under tab Administration > Content Management > root > audit > Quote > {quoteId} >{date} > {username} > IMCScript (To see audit logs, Server should be running under DEBUG mode with log for IMCScript enabled)
All the scripts, which were executed can be seen with its relevant details.
Note: User must save the Quote/SalesItem changes before using it under Test execution. Also, the tested changes will be rollbacked immediately once the outcome is returned. Hence to see certain applied changes like setting DA value, hiding DAs etc., it should be tested in real execution.