function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ShadowlessKickShadowlessKick 

Outbound Message Through a Button not a Workflow

The outbound message functionality is clean and does what we need it to do.  We like the session id feature and the response back. 

Can it be used through a button?  Ours fires from a workflow action.  The workflow fires when an object is saved.  Just want to invoke the outbound message without saving anything. 

Would like the functionaliy to work just like it does with a workflow but this time through a button. 

If APEX is necessary what is the syntax to call the outbound message?

Thanks.
Best Answer chosen by ShadowlessKick
Satish_SFDCSatish_SFDC
You may create a hidden field, like a checkbox and edit the workflow rule criteria to fire when the checkbox field is updated. The button can have code to update the checkbox field.

Regards,
Satish Kumar

All Answers

Satish_SFDCSatish_SFDC
You may create a hidden field, like a checkbox and edit the workflow rule criteria to fire when the checkbox field is updated. The button can have code to update the checkbox field.

Regards,
Satish Kumar
This was selected as the best answer
ShadowlessKickShadowlessKick
Thank you for responding.  Took you advice.  Added a hidden checkbox that I manipulate through a java script button.   The button executes a workflow that in turn fires a outbound message.

{!REQUIRESCRIPT("/soap/ajax/10.0/connection.js")}

//Define the object you are working on
var TheAccount = new sforce.SObject("Account");
TheAccount.Id = "{!Account.Id}";

//Extract the current values from object you are working with
//and compare its value. The only purpose of this hidden value
//is to signify a change. True or False is irrelevent. Just the
//fact that something was changed executes a workflow which in
//turn fires an outbound message.

var TheCheckBoxValue = "{!Account.Account_Sync__c}";

if (TheCheckBoxValue == true){
//If the checkbox is true change it to false

TheAccount.Account_Sync__c = false;
var resultTurnToFalse = sforce.connection.update([TheAccount]);
if (resultTurnToFalse[0].getBoolean("success"))
{

alert("Synchronization in process!");

}else{
  alert(resultTurnToFalse[0].errors.message + " Synchronization failed!");
  }//End true checking

}else{

//If the checkbox is false change it to true

TheAccount.Account_Sync__c = true;
var resultTurnToTrue = sforce.connection.update([TheAccount]);
if (resultTurnToTrue[0].getBoolean("success"))
{

alert("Synchronization in process!");

}else{

  alert(resultTurnToTrue[0].errors.message + " Synchronization failed!");

}//End false checking

}//End Check for True Or False
Steven Harris 1Steven Harris 1
If you referring to a text message as "outbound message", then yes you can invoke the same through a button using Apex by utilizing 360 SMS App. It provides all functionalities required in day to day working of the business like instant reminders, notification, easy to use app, few clicks and your work is done.
Go to the link- https://appexchange.salesforce.com/listingDetail?listingId=a0N3000000DpSyIEAV
Or send an inquiry to- support@360degreeapps.com