Tuesday, December 12, 2017

#608 OIC - NetSuite Adapter in action

Here is a very simple integration with NetSuite - the logic is as follows -

Check if a contact already exists in NetSuite, if not, create it.

The NetSuite adapter configuration is covered in an earlier post.
You can review it here

Here is my Orchestration -

The Trigger is a REST adapter, configured as follows -

input -

Now let's go thru these, at least the ones that are not obvious -
internalID: is the id assigned by NetSuite to a contact.

You can see this in NetSuite - (Reports -> New Search -> Contact -> Submit)…

If you do not see the Internal Id when you searching, then -
go to Administration/Settings and enable showing internal Ids.

Next we have the subsidiaryInternalID - a subsidiary is the contact's company.
Here is the one I will use -

As you can see, the internal ID is 1.

Here is the configuration of the Check4Contact Invoke -

Just a basic Get on Contact

The Mapping is as follows -

The only parameter we need to set is the internalId.

The Switch condition is very simple - count(Contact) > 0

I simply return the internalID and an appropriate message, if the Contact is found.

If the Contact does not exists - I create it.

Here is the configuration of the CreateContact Invoke -

Again, very simple, mapping is as follows -

I then return the new internalID and an appropriate message -

Now to testing - as usual, I am using Postman

Here I am creating a new contact - Cathal Brugha - one of the greatest Irishmen whoever lived.

Check him out on Wikipedia  -

Anyway - let's execute the request -

The response is -

I validate in NetSuite -

I re-test in Postman, using the internalID returned - 2953

Great stuff!

.iar file available here

No comments: