Send a call somewhere else
Every call sends its data to the Continuous Control script in NetSuite. You can send a call to another script in your NetSuite account instead, or to an outside URL.
Say QuantumBit's NetSuite team already has a script that handles its orders. QuantumBit can point Order Booking at that script, with no change on the Salesforce side.
See where a call sends
Pick a call in Calls & Mappings. The bar above its objects shows the method, the URL, and the action. The action is the word that tells NetSuite what the data is, such as book for Order Booking.
The bar also flags two states. Override means the call doesn't use the default endpoint. Not published means you've changed it but haven't activated the call.
Choose where the call goes
A call can send to three kinds of endpoint.
| Kind | Where it goes |
|---|---|
| Continuous entry script | The Continuous Control script. This is the default for every call. |
| Another RESTlet in this account | Any other script in the same NetSuite account. The Continuous Control script passes the data on, so you need no new credentials and no new Remote Site Setting. |
| External URL | Any other address. It needs its own Remote Site Setting. The request is signed with your NetSuite credentials, so the host has to pass it on to your account. |
Point a call at an endpoint
- Click the pencil on the endpoint bar.
- In Endpoint, pick one from the list. If it isn't there, add it first. See Add an endpoint.
- Leave HTTP method and Action blank unless the target needs something different. Changing the action on a shipped call shows a warning, because the Continuous Control script relies on it.
- Click Save.
- Validate and activate the call. Until you do, syncs keep using the old endpoint.
A method or action you set on the call wins. Next comes the endpoint's own default, then the shipped default.
To go back, open the same pencil and click Reset to default.
Add an endpoint
An endpoint is a named target that any call can use. Fix a script id once, and every call using it follows.
- Click Manage endpoints, beside the endpoint list.
- Click + New endpoint.
- Enter a Key. Calls refer to the endpoint by this short name, and it can't change later.
- Enter a Label and pick the Kind.
- For a RESTlet, enter its Script id and Deployment id. Use the script id, such as
customscript_quantumbit_orders, not the internal id number. For an outside host, enter the URL. - Optional: set an HTTP method and a Default action for every call that uses it.
- Click Save endpoint.
Endpoint changes take effect on the next run of every call that uses them. There's nothing to activate. Only choosing an endpoint for a call waits for Activate.
- To stop using an endpoint, uncheck Active. Calls already on it keep running, but no call can be activated onto it.
- You can't delete an endpoint a call uses. Move those calls first.
- The Continuous Control endpoint comes built in and can't be deleted. A Connection default badge marks it.
Allow a new host in Salesforce
Salesforce only calls hosts you've approved. Before you use an External URL on a new host, add it under Setup, Security, Remote Site Settings. Validate blocks the call until you do. An endpoint in your own NetSuite account needs nothing new.
Check where a run went
Every run records its endpoint, URL, method and action. Open it on the Sync Runs tab. See Monitoring & troubleshooting.
If another script answers in the Continuous Control format, the run works like any other. If it answers in some other format, the run completes with a note, and the raw answer is saved on the run. If the script returns an error, the run fails with NetSuite's message.
Field lookups in the editor and Validate's NetSuite checks always use the Continuous Control script. Relaying to another RESTlet covers how passing data on works.