Date: Fri, 29 Mar 2024 13:30:28 +0000 (UTC) Message-ID: <1884547361.7.1711719028205@c3a121c3f801> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_6_93316615.1711719028205" ------=_Part_6_93316615.1711719028205 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
On this page<= /strong>
Traditionally, transacting EDI data requires that you manually enter/upl= oad the data, or hand code to get the EDI data, into your target system. Ad= ditionally, handling errors and updating the document format requires signi= ficant time and effort.
SnapLogic's B2B solution helps you optimize this process wi= th minimal manual intervention. This use case demonstrates how you can leve= rage SnapLogic to automatically create a sales order in NetSuite by reading= the orders stored in the EDI gateway's SFTP site.
The following Pipeline, when executed, creates the sales order in NetSui= te and sends a status notification to the = EDI gateway.
The following Error Pipeline handles the errors that might occur while executing the above Pipeline. For exa= mple, from the Create Sales Order Snap.
You can download and import the above Pipelines from the Downloads section below into y= our SnapLogic org using your own dataset.
The first Pipeline above performs the following tasks:
Reading the sales order data (primary input) can be automated using the =
File Poller Snap. The Snap polls the target directory (in this example, the=
EDI gateway's SFTP site) for new files at regular intervals. You can modif=
y the polling intervals by opening the File Poller Snap and editing the
When the File Poller Snap detects a new file in the target directory, it= passes its path to the File Reader Snap. This Snap reads the files present= in the input file path, which are parsed and then passed to the Mapper Sna= p labelled SO Mapper. The Mapper Snap maps the fields from the input data s= tream, a JSON file containing the sales order, with the fields in NetSuite'= s sales order object. Mapping the fields ensures that the data is passed co= rrectly and is compliant with the target endpoint's preferred schema.
The SO Mapper Snap is connected to the NetSuite Create Snap through the = SO Line Mapper Snap. The NetSuite Create Snap is configured to create a sal= es order. Connecting the Snaps in the given way enables us to propagate the= sales order's desired schema back from the NetSuite Snap to the Mapper Sna= ps.
You will need to hardcode field values based on your requirements. In th= is use case, we have hardcoded the following values:
The values in the $item.internalId field are illustrative in th= is use case. In a real scenario, they must correspond to the real item numb= ers.
Thus, the fields from the sales order data in the SFTP site are mapped t= o the sales order's schema in NetSuite.
During Pipeline execution, the sales order data is passed to the NetSuit= e Create Snap, which uses this information to create the sales order in Net= Suite. Upon successful execution, the order is created in the NetSuite acco= unt and displays in the NetSuite Snap's output.
Now that the sales order is created, we must perform the following two o= perations:
We need the output from the NetSuite Create Snap for the above operation= s. We use the Copy Snap to create copies of the NetSuite Create Snap's outp= ut.
A status message for each sales order created in the ERP is maintained t= o track the sales orders. These status messages are maintained in a separat= e sub-directory in the SFTP site. In our example, this sub-directory is lab= elled Out. Each sales order's file has the Control_ID inc= luded in the title to help distinguish them.
We do not need all the fields from the NetSuite Create Snap's output in = the status message, so we are using the Mapper Snap labelled Success Mapper= . You can choose to include the fields per your requirement by editing them= in the Snap settings.
The output from the Mapper is then parsed and directed into a File Write= r Snap labelled Send Success Status. This Snap, when executed, writes the i= nput data as a file in the target location (which is the SFTP location set = in the Account tab).
Thus, the status of each successful sales order can be stored in the SFT= P.
After fulfilling the sales order, an invoice is generated in NetSuite an= d sent to the SFTP site of 1 EDI Source. To create an invoice we need the s= ales order's details, as generated by the NetSuite Create Snap. In this use= case, we are using the output from the NetSuite Create Snap to retrieve th= e sales order details. So, this output is written to a JSON file in the SLD= B using the File Writer Snap labelled Write Result. The resulting JSON file= forms the input for the second use case.
SnapLogic's Error Pipeline feature enables you to handle Pipeline-execut= ion errors by running a separate Pipeline. This Pipeline is specified in th= e Error Pipeline field in the parent Pipeline's properties= .
When there is an error in the execution of the parent Pipeline, the erro= r data is sent to the Error Pipeline<= /a> automatically. See Handling Errors with an Error Pipeline for details.
An Error Pipeline must have an un-linked document input view to receive = the error data from the parent Pipeline. In our example, we use a JSON Gene= rator Snap labelled Sample Errors to simulate an error scenario. Remove/dis= connect this Snap from the Pipeline when using it.
You may configure an Error Pipeline to handle the error data based on yo= ur requirements. The Error Pipeline in this use case is configured to send = the failure notification to the SFTP site along with the Control_I= D. Any additional data is removed using the Mapper Snaps. The failure = status is written to the Out directory in the SFTP site.
Next, create and send the invoice to the EDI gateway using Snap= Logic.