Question
· Aug 27, 2019

%Save() is not saving data into cache DB.

 

I have created below Add method in REST api, I got requested data in objExternalUser object but it is not saved to DB.

Using  "Write objExternalUser.%JSONExport()" I got JSON data.

Please refer below screen.

Discussion (7)0
Log in or sign up to continue

As I see in your code you already do some "error handling". So you can continue:

Change your code

Do objExternalUser.%Save()

to the following:

set stat=objExternalUser.%Save()

if $$$ISERR(stat) {

 #; error handling

 d $System.OBJ.DisplayError(stat)

}

HTH.

Out of curiosity - you have empty Try-Catch block. Why don't use it?

you could embrace your code into the following:

$$$TOE(objExternalUser.%Save())

And catch your error with status in catch then.