Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
String sResponse= docgen_esign.GlobalServices.generateDocument(templateId,recordId);

Deserialize the sResponse into type Map<String,Object>

Code Block
Object deserializedObject = JSON.deserializeUntyped(sResponse);
Map<String, Object> outputMap = (Map<String, Object>)deserializedObject;                

Check the status

Code Block
if(outputMap.containsKey('bSuccess')){
 
 if((Boolean)outputMap.get('bSuccess') ){
 //Document WorkFlow Created
 }
 else{
//Get the error                    
String error = outputMap.containsKey('Message')?(String)outputMap.get('Message'):'Something Went Wrong While Generating Document';
 }