In the Base url for the customer page (<https://yo...
# ask-stanley-ai
t
In the Base url for the customer page (https://yourcompany.netsuite.com/app/common/entity/custjob.nl?id=) i want to use the "entityid" as the variable for id=, give me a tutorial on how to do that. If possible, I want it to open on the "Sales transaction" information tab.
c
AI generated answer (using internal Slack threads):
****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ****** To use the "entityid" as the variable for id= in the Base URL for the customer page, you can follow these steps: 1. First, you need to retrieve the entityid. This can be done by creating a search in SuiteScript that targets the customer record. Here is a sample code snippet:
Copy code
javascript
var search = require('N/search');
var customerSearch = search.create({
   type: search.Type.CUSTOMER,
   filters: [
      ['entityid', 'is', 'yourEntityId']
   ],
   columns: ['internalid']
});
var resultSet = customerSearch.run();
var results = resultSet.getRange({start: 0, end: 1});
var entityId = results[0].getValue({name: 'internalid'});
2. Once you have the entityid, you can append it to the Base URL. Here is a sample code snippet:
Copy code
javascript
var baseUrl = '<https://yourcompany.netsuite.com/app/common/entity/custjob.nl?id=>';
var url = baseUrl + entityId;
3. To open the "Sales transaction" information tab, you would need to append '&whence=' to the URL. However, the exact value to append after '&whence=' depends on the specific structure of your NetSuite instance, which can vary. You might need to inspect the URL structure when you manually navigate to the "Sales transaction" information tab to determine the correct value. Please note that this approach requires some knowledge of SuiteScript and how to work with NetSuite's search functionality. If you're not familiar with these topics, you might want to consider getting some help from a developer or a NetSuite professional.
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.842834473
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.832275391
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.827575743
Please provide your feedback on this answer.