This is an advanced integration technique targeted at NetSuite administrators, please ensure you have read our other guides before continuing.
Whilst the display of the Workiro SuiteApp is usually controlled based upon the NetSuite user role, it is also possible to dynamically load it based upon the value of fields in the NetSuite record.
Workiro is currently displayed on a NetSuite record in two places, a button in the records header and in the Workiro tab.
The example below walks through a specific setup designed to have the SuiteApp shown only when a transaction's custom field is below a certain percentage.
The SuiteApp adds the button and tab through a UserEvent script on the BeforeLoad event. In order to exclude certain records, a new script must be used to update the appropriate Workiro record mapping before the tab or button is added to the form.
Ensure that caching is off for the Workiro Configuration record.
2. Download and configure the script attached to this support article (recmap.UserEvent.Update.js)
Upload the script to NetSuite. Navigate to the File Cabinet and choose a folder within SuiteScripts. Click the Add File button and upload the script.
The script has two parameters: a saved search that contains the records you would like to exclude, and the Workiro record mapping for the NetSuite record type.
To find the record mapping, navigate to record types as shown below.
Find the Workiro Record Mapping record; it will most likely be on the last page.
Click on the List link.
You will then see a list of the Workiro Record Mappings as shown below.
We need the ID to use for the Custom Script Parameter.
In our example, we are going to exclude sales orders, so we need the ID “1”.
To decide which sales orders are excluded, we are going to create a saved search and configure the search filters to find sales orders that have an amount below 20.
Select Transaction for the Record Type.
Here is an example of how the saved search is configured.
Now that we have our configuration for the script, we can deploy the script and configure the parameters.
To deploy the script into NetSuite, navigate to the new scripts page. Enter the script name and save.
Now that we have a script within NetSuite, we need to deploy the script to a NetSuite Record Type. We are going to deploy to Sales Orders.
Set the status to Released if you are confident about the configuration.
Save the script deployment.
Now we need to create the script parameters.
The ID needs to match exactly in order for the script to be able to use the values.
Name |
ID |
Type |
List/Record |
|---|---|---|---|
Workiro Record Mapping |
|
List/Record |
Workiro Record Mapping |
Saved Search |
|
List/Record |
Saved Search |
For the script to function correctly, we need to ensure that the script executes before the Tab or Button User Event Scripts.
For example, to configure the SuiteApp to load on certain Sales Orders, you would deploy the script to the Sales Order Record.
To determine the order that scripts are run, you can either click on the script and then drag the left icon
The script setup is now complete! 👌
If we navigate to a sales order that has an amount below 20, the Workiro Button or Tab will not be shown to the user.
To find a sales order to test this, use the saved search previously created.
Comments
0 comments
Article is closed for comments.