Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added clarifying notes on Id and Fields arguments

...

Note: The Id and Fields argumentsare required for this API to work and return data. Not supplying Id argument will result in an error. Not supplying Fields argument will cause no data to be returned.

Code Block
languagejs
var request = { 
    "type"   : "getRTFImages",
    "object" : "Some_Custom_Object__c", // Required: the object type
    "data"   : {
        // Required: Record Id for the object containing the Rich Text images fields
        "Id"     : "0011000000iW9YuAAK",
        // Required: list of specific fields to retrieve.
        "Fields" : [ "RichText_Field1__c", "Rich_Text_2__c" ]
    }
};
pulsarBridge.sendRequest(request, function (result) {
   if (result.type === 'getrtfimagesResponse') {
      var response = result.data; // this will be a dictionary of field->RichTextContent pairs
      alert('RichText_Field1__c content: ' + response['RichText_Field1__c']); 
      alert('Rich_Text_2__c content: ' + response['Rich_Text_2__c']); 
   }
   else {
      console.log('getrtfimages failed: '+ result.data) // data is an error string
   }
});

...