Versions Compared

Key

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

...

Code Block
languagejs
var request = {
    type: 'getLayout',
    object: 'Account', // Required: SObject unique name 
    data: {
       // The following two parameters are optional, and only one is needed
       //  to specify the RecordType, though if both are specified, 
       //  the Id will take precedence
       RecordTypeId: '012000000000000AAA', // Optional: Id of the RecordType
       RecordTypeName: 'Business_Account', // Optional: RecordType Developer Name
    }     
};
pulsarBridgebridge.sendRequest(request, function (result) {
   if (result.type === 'layoutResponse') { // case-sensitive
      var describeLayoutJSON = result.data;
      var describeLayout = JSON.parse(describeLayoutJSON);
      //....
   }
   else {
      console.log('error: '+ result.data)
   }
});

...

Code Block
languagejs
var request = {
    type: 'getLayoutSections',
    object: 'Account', // Required: SObject unique name 
    data: {
       // The following two parameters are both optional, and only one is needed
       //  to specify the RecordType, though if both are specified, 
       //  the Id will take precedence
       RecordTypeId: '012000000000000AAA', // Optional: default Id is shown here
       RecordTypeName: 'Business_Account', // Optional: RecordType Developer Name
       LayoutMode: 'edit', // Optional: default is 'display'
    }     
};
pulsarBridgebridge.sendRequest(request, function (result) {
   if (result.type === 'layoutSectionsResponse') { // case-sensitive
      var layoutSections = result.data;
      // Example results with explanation:
// [
//     {
//         "display": "FALSE", // string indicating visibility of a section header
//         "heading": "Top of Page", // heading text as defined in the layout
//         "section": "0" // logical section ordering as it appears on the page
//     },
//     {
//         "display": "TRUE",
//         "heading": "Work Order Detail",
//         "section": "1"
//     },
//     {
//         "display": "TRUE",
//         "heading": "Ticket Contact",
//         "section": "2"
//     },
//     {
//         "display": "TRUE",
//         "heading": "Service Report",
//         "section": "3"
//     },
//     {
//         "display": "TRUE",
//         "heading": "Entitlement",
//         "section": "4"
//     },
//     {
//         "display": "TRUE",
//         "heading": "System Info",
//         "section": "5"
//     }
// ]
//...
   }
   else {
      console.log('error: '+ result.data)
   }
});

...

Code Block
languagejs
var request = {
    type: 'getLayoutFields',
    object: 'Account', // Required: SObject unique name 
    data: {
       // The following two parameters are both optional, and only one is needed
       //  to specify the RecordType, though if both are specified, 
       //  the Id will take precedence
       RecordTypeId: '012000000000000AAA', // Optional: default Id is shown here
       RecordTypeName: 'Business_Account', // Optional: RecordType Developer Name
       LayoutMode: 'edit', // Optional: default is 'display'
    }     
};
pulsarBridgebridge.sendRequest(request, function (result) {
   if (result.type === 'layoutFieldsResponse') { // case-sensitive
      var layoutFields = result.data;
      // Example results:
// [
//     {
//         "tabOrder": "1",
//         "editableForUpdate": "FALSE",
//         "editableForNew": "FALSE",
//         "placeHolder": "FALSE",
//         "label": "Account Name",
//         "type": "Field",
//         "required": "FALSE",
//         "displayLines": "1",
//         "name": "Name"
//     },
//     {
//         "tabOrder": "12",
//         "editableForUpdate": "FALSE",
//         "editableForNew": "FALSE",
//         "placeHolder": "FALSE",
//         "label": "Sales Territory",
//         "type": "Field",
//         "required": "FALSE",
//         "displayLines": "1",
//         "name": "Sales_Territory__c"
//     },
//     {
//         "tabOrder": "2",
//         "editableForUpdate": "FALSE",
//         "editableForNew": "FALSE",
//         "placeHolder": "FALSE",
//         "label": "Customer Number",
//         "type": "Field",
//         "required": "FALSE",
//         "displayLines": "1",
//         "name": "Customer_Number__c"
//     },
//     {
//         "tabOrder": "6",
//         "editableForUpdate": "FALSE",
//         "editableForNew": "FALSE",
//         "placeHolder": "FALSE",
//         "label": "Shipping Address",
//         "type": "Field",
//         "required": "FALSE",
//         "displayLines": "1",
//         "name": "ShippingAddress"
//     },
//     {
//         "tabOrder": "7",
//         "parentFieldName": "ShippingAddress",
//         "parentFieldType": "Field",
//         "label": "Shipping Street",
//         "type": "textarea",
//         "required": "FALSE",
//         "displayLines": "1",
//         "name": "ShippingStreet"
//     },
//     {
//         "tabOrder": "8",
//         "parentFieldName": "ShippingAddress",
//         "parentFieldType": "Field",
//         "label": "Shipping City",
//         "type": "string",
//         "required": "FALSE",
//         "displayLines": "1",
//         "name": "ShippingCity"
//     },
//     {
//         "tabOrder": "9",
//         "parentFieldName": "ShippingAddress",
//         "parentFieldType": "Field",
//         "label": "Shipping State/Province",
//         "type": "string",
//         "required": "FALSE",
//         "displayLines": "1",
//         "name": "ShippingState"
//     },
//     {
//         "tabOrder": "10",
//         "parentFieldName": "ShippingAddress",
//         "parentFieldType": "Field",
//         "label": "Shipping Zip/Postal Code",
//         "type": "string",
//         "required": "FALSE",
//         "displayLines": "1",
//         "name": "ShippingPostalCode"
//     },
//     {
//         "tabOrder": "11",
//         "parentFieldName": "ShippingAddress",
//         "parentFieldType": "Field",
//         "label": "Shipping Country",
//         "type": "string",
//         "required": "FALSE",
//         "displayLines": "1",
//         "name": "ShippingCountry"
//     },
//     {
//         "tabOrder": "17",
//         "editableForUpdate": "FALSE",
//         "editableForNew": "FALSE",
//         "placeHolder": "FALSE",
//         "label": "Preferred Language",
//         "type": "Field",
//         "required": "FALSE",
//         "displayLines": "1",
//         "name": "Preferred_Language__c"
//     }
// ]
//...
   }
   else {
      console.log('error: '+ result.data)
   }
});

...