0

Salesforce IB Button to send an event to xMatters

Context
Salesforce UI code for making an HTTP call to send Case information to the Integration Builder. 

Note: This requires the xMattersreq class here.

Code
{!REQUIRESCRIPT ("/soap/ajax/13.0/connection.js")};
{!REQUIRESCRIPT("/soap/ajax/30.0/apex.js")};

caseid = '"Case ID":' + '"' + "{!Case.CaseNumber}" + '"';
contact = '"Contact":' + '"' + "{!Case.Contact}" + '"';
subject = '"Subject":' + '"' + "{!Case.Subject}" + '"';
priority = '"Priority":' + '"' + "{!Case.Priority}" + '"';
status = '"Status":' + '"' + "{!Case.Status}" + '"';
accountid = '"Account ID":' + '"' + "{!Case.AccountId}" + '"';
recordid = '"ID":' + '"' + "{!Case.Id}" + '"';
accountname = '"Account Name":' + '"' + "{!Case.Account}" + '"';
description = '"Description":' + '"' + "{!Case.Description}" + '"';
payload = '{' + contact + ',' + subject + ',' + recordid + ',' + caseid + ',' + description + ',' + priority + ',' + accountname + ',' + accountid + ',' + status + '}';

endpoint = 'https://acme.dc.xmatters.com/api/integration/1/functions/UUID/triggers';

sforce.apex.execute("xMattersreq","xRESTCall",{ endpoint:endpoint, payload:payload } );

0 comments

Please sign in to leave a comment.