connector call from business object returning multiple values including state
-
Klaus79
5 years ago #17992How can I call a connector which returns lastInsertedId or success state (e.g.: {
“message”: “Duplicate entry ‘1-1-DE’ for key ‘PRIMARY'”,
“success”: false
}I know how I’ll get inserted id.
Currently my connector call Looks like this:
var insertedID = Simplifier.Connector.DataLoad.saveDate_NotationFromSAP({
CustID: input.CustID,
SystemID: input.SystemID,
params: date_notation_dataset
}).generatedID;But how do I get message state from SQL db if insertion runs into error?
I thought that a try-catch-block solves the problem but it never throws an exception which I can process further in catch-block.
Chris Bouveret
Has successfully completed the online course Introduction
Has successfully completed the online course Intermediate (200)
Has successfully completed the online course Advanced (300)
Has successfully completed the online course Basics (100)
Has successfully completed the online course Advanced (320)
Has successfully completed the Intermediate Certification
Has successfully completed the Advanced Certification
Klaus79
5 years ago #18518::But what about if insert statement runs into problems and returns following error message (in connector test dialog):
“message”: “Duplicate entry ‘1-1-DE’ for key ‘PRIMARY’”,
“success”: falseI’ve tried to get it with a try-catch-block in business object but that did not work.
Also output parameters in connector isn’t working for that database errors.
How do I get access to the error message so I can react in bussiness object on it?
Chris Bouveret
Has successfully completed the online course Introduction
Has successfully completed the online course Intermediate (200)
Has successfully completed the online course Advanced (300)
Has successfully completed the online course Basics (100)
Has successfully completed the online course Advanced (320)
Has successfully completed the Intermediate Certification
Has successfully completed the Advanced Certification
Mathieu Roll
Has successfully completed the online course Introduction
Has successfully completed the online course Intermediate (200)
Has successfully completed the online course Advanced (300)
Has successfully completed the online course Basics (100)
5 years ago #18697::Hello Klaus,
you already mentioned the solution a try catch block.
No idea what you did wrong but for me it works.
Like you can see my sql insert will always throw an error because i have a duplicate.
In my Business Object im using a try catch block to catch the error and create a simplifier log entry.
You must be logged in to reply to this topic.