A search request is performed on NetSuite to look out for PurchaseOrder records. If a record is found, it is parsed and the matching outbound route is searched. If there is a match for the PurchaseOrder record then csv data is translated to EDI 850 and sent to the trading partner.
This section explains how to configure the integration to retrieve the Purchase Order records and Transform them to EDI X12 850 format for the Trading Partner integration.
How to Configure
- Configure Schedulers: LaunchNetsuitePurchaseOrderPS residing in
com.cleo._customer_.booster.netsuite.p2p.purchaseOrder
is scheduled to run once every day. Refer to Creating and Defining Process Schedules for details.Note: The script extracts data from NetSuite entities and loads it into File Cabinet folders specific to different transactions. CIC Studio scheduler objects should be run in sync with the script schedulers. It is advisable to run the Netsuite CIC Accelerator schedule objects right after the Netsuite Script schedulers are run. This ensures that duplicate data is not uploaded into the File Cabinet folders by Script schedulers.
- Configure the Outbound Route: The VendornternalId field from saved search results is used to identify the Trading Partner to whom the PurchaseOrder records are to be sent.
- Configure the enveloper: The X12 850 envelope containing details of the trading partner endpoint to which the X12 850 is to be sent should be configured in _TP_850v4010ENV (residing in the trading partner project under the
com.cleo._customer_.netsuite._tp_.outbound.n850.v4010
package). By default the Customer name and the TP Name entered in the Wizard property file are added to the sender and receiver ID respectively. If there are any changes to the enveloping details the same object must be updated accordingly. - Initialize global variables: The internal IDs used in the Saved Search Scripts must be modified per the customer’s instance internal IDs. The customscript_cleo_sch_850_po_script search script ID is used for 850.
The global variables must be initialized with the internal IDs of the archive folder. The internal IDs of the folders vary depending on the customer's instance.
How to Run the Flow
- Before proceeding, ensure that the following Projects have been deployed. If any of these Projects are already deployed and remain unmodified, there is no need to redeploy them. Similarly, if any of these Projects were not checked out to your Workspace, they can be skipped from the deployment process.
-
com.cleo._customer_.edi
com.cleo._customer_.booster.netsuite
com.cleo._customer_.edinetsuite
com.cleo._customer_.netsuite._tp_
com.cleo.b2bcloud.core
com.cleo.b2biaas.clarify
com.cleo.cic.cockpit.core
com.cleo.cic.cockpit.core.n810
com.cleo.cic.cockpit.core.n850
com.cleo.cic.cockpit.core.n855
com.cleo.cic.cockpit.core.n856
com.cleo.cic.connector.netsuite
If any of the projects are already deployed and are not modified, they need not be deployed again.
- Manually run the flow: LaunchNetsuitePurchaseOrderBPS has to be launched. Refer to Starting Objects for details on how to launch BPS manually.
- Automatically run the flow: LaunchNetsuitePurchaseOrderPS will kick off automatically based on the interval specified and flow is triggered.
How to Monitor the Flow
- Monitor the flow using the following:
- Auditor log entries. See Using the CIC Studio Auditor for more information.
- Message Tiles
- Jobs
- Dashboard > Charts
- In case of errors:
- If the processing fails in any of the steps a ticket would be created and the same is visible in the cockpit message tile and the job with the Issue Flag.
Message tile with error
Job with error
- Outbound EDI validation use cases: For details on Outbound EDI validation rules refer to Validation Rules in the Transformation Settings object.
- If the processing fails in any of the steps a ticket would be created and the same is visible in the cockpit message tile and the job with the Issue Flag.
How to Customize
- Change the intervals of retrieving Purchase Orders from NetSuite: he LaunchNetsuitePurchaseOrderPS scheduler residing in
com.cleo._customer_.booster.netsuite.p2p.purchaseOrder
package is currently configured to retrieve Inventory once every day. Change the schedule to run more frequently or less frequently. For details on defining scheduler refer to Creating and Defining Process Schedules.Note: A script extracts data from Netsuite entities and loads it into File Cabinet folders specific to different transactions. CIC Studio scheduler objects should be run in sync with the script schedulers. It is advisable to run the Netsuite CIC Accelerator schedule objects right after the Netsuite Script schedulers are run. This ensures that Script schedulers do not upload duplicate data into the File Cabinet folders.
A SENTDATA_FETCHEDBYSCRIPT checkbox has been added to the purchase order transaction. It prevents sending duplicate records when a script runs again to write the data to the csv file.
The script runs for the first time and pulls purchase orders. It then marks the checkbox as ‘true’ for these purchase orders.
The next time the Script runs, it only sends the fresh data. - Add more details to the X12 850 from the NetSuite Purchase Order: The values that are being mapped are documented in the LMS Template present in com.cleo._customer_.edinetsuite project under docs folder. However, if you wish to add any additional fields then the ruleset _TP_850v4010RS present in
com.cleo._customer_.netsuite._tp_.outbound.n850.v4010
package needs to be updated as required.
Contact Cleo support if you need any assistance while adding additional rules.
PO Reference Data Flow
Schedule to retrieve PO reference data information from NetSuite.
The LaunchNetsuitePOReferencePS.sched scheduler is used to trigger the LaunchPOReferenceBPS.bps which will initiate the PO reference data flow every 6 hours. This time interval can be configured as required.
This PO Reference staging table flow uses a file cabinet approach to fetch source data in the form of CSV file. We have created saved searches to write data to the file cabinet folder location in Netsuite.
First, a custom saved search ‘customsearch_cleo_po_referencedata’ lists the details for particular POs provided in the search criteria.
The second custom saved search customsearch_cleo_ss_po_ref_getcsvfile lists out the file containing PO reference details in the File Cabinet Ready folder inside the Purchase Order Reference folder. Below is the screenshot for the saved search in NetSuite:
Script file runs as a one-time event currently and can enable the custom saved search customsearch_cleo_po_referencedata to run and produce a CSV file in the file cabinet Ready folder inside the PO Reference data folder. This script can be scheduled at shorter intervals like hourly, 2 hourly basis as per requirement.
File cabinet folders are placeholders in NetSuite where CSV files are generated and can be consumed for Integration flows. So for different document types, different file structures have been created. For Purchase Order Reference, one Ready and Archive folder has been created. When the script runs and produces a CSV file, this CSV file is routed to the Ready folder which is taken care of in the script itself. When the Integration flow consumes the file, then the file is moved to the Archive folder which is handled inside the Integration project component. Below is the screenshot for the file cabinet folder.
Notes:
- The script extracts data from Netsuite entities and loads it into File Cabinet folders specific to different transactions. CIC Studio scheduler objects should be run in sync with the script schedulers. It is advisable to run the Netsuite CIC Accelerator schedule objects right after the Netsuite Script schedulers are run. This ensures that Script schedulers do not upload duplicate data into the File Cabinet folders.
- We have also added a SENTREFERENCEDATA_FETCHEDBYSCRIPT checkbox to purchase order transactions, which stops sending duplicate records when a script runs again to write the data to the CSV file.
- When the script runs for the first time and pulls purchase orders for the staging table, it marks the checkbox as true for these purchase orders.
- The next time the script runs, it only sends the fresh data.
The first step in the LaunchPOReferenceBPS.bps calls the SearchDocumentPOReferencesRS.ruleset.
The ruleset calls saved search ‘customsearch_cleo_ss_po_ref_getcsvfile’ that helps to create input data for SearchNetsuiteRecordBPS.
This BP helps to identify and list out CSV files available in the File Cabinet Ready folder inside the Purchase order reference folder. The fetched file contains file information such as file internalId, filename, size, etc. The ProcessPOReferenceDetailBPS.bps calls a GET API to fetch the file content using File InternalId.
The NetSuite GET API fetches the data in NetSuite XML format and the data is in encrypted format.
The ProcessPOReferenceDetailBPS.bps has a set of actions that helps to decode content to a flat file.
This CSV file contains multiple inventory records.
The called POReferencesRS.ruleset translates PO Reference CSV data to Netsuite_PO_Reference staging table data. The ruleset can be modified as required. The fetched data from the saved search is passed to the translation step.
Transformation and Ruleset
The fetched data from the saved search is passed to the translation step.
If no file is extracted through the saved search in NetSuite, the LaunchPOReferenceBPS terminates successfully.
The Global Variable setting POReferenceArchiveFolder contains the internal ID of the Purchase order ready folder. Global Variables are initialized with the internal id of the archive folder. The internal ids of the folders vary depending on the customer's instance.
Comments
0 comments
Please sign in to leave a comment.