Skip to content
+1-888-319-3663

COMMUNITY FORUM

Rest API and new records

Dan asked 3 years ago
All,
We have a potential customer who takes a CSV file updates GP, Salesforce and two other Systems.  No one really knows how anything is being updated and if there are issues they have to call a developer to troubleshoot.  We want to move them to SmartConnect.  GP and Sales Force update is no problem.  The one system does have an API so I was thinking I could use the REST feature and web services inside of SmatConnect.  Based on my research I would need a JSOM format so would I pull that out of GP?  How do you only get the record(s) which were updated from the CSV file?  I can’t seem to find any direction on that part of the process.  Thanks in advance
Answers
Patrick Roth Staff answered 3 years ago
Couple ways that I can see:
1. use an ‘after document success’ and/or ‘use document failure’ script. 
In it you could write the vb.net or C# code to connect to your custom web service and then make the necessary call to do what you need.  In the after document success, you have access to the last source record (typically a doc number or customer number etc) and of course you know success/fail depending on which event it running.
2. use the REST feature and make the destination.  then use an after document success/failure to call the new map as a ‘run map task’.  You can pass in the source data from the parent.
Bigger problem with this approach is that it passes ALL the data and so you don’t know which are success/fail.  You’d have to keep track of that somehow separately – like perhaps by writing to a SQL table (manually) and then in the 2nd map read from the SQL table instead of the source data.
for #1, the advantage is that is an “after document” so we have the key fields available and we know pass/fail.  But you have to write the actual code.
for #2, we don’t have to write code.  But we do have to somehow keep track of pass fail.
 

If you would like to submit an answer or comment, please sign in to the eOne portal.