Tutorials
Opportunity closed won in salesforce -> create account and order in priority
17 min
in this tutorial, learn how to automate the creation of accounts and orders in priority when an opportunity is closed won in salesforce prerequisites before you begin, ensure the following connections are established connection between engini and priority learn how to connect priority to engini connection between engini and salesforce learn how to connect salesforce to engini add outbound message webhook to get started, add a trigger add a new activity and choose “outbound message webhook” trigger of salesforce click on the “to json\xml sample” button to paste sample json payload example for a json payload { "?xml" { "@version" "1 0", "@encoding" "utf 8" }, "soapenv\ envelope" { "@xmlns\ soapenv" "http //schemas xmlsoap org/soap/envelope/", "@xmlns\ xsd" "http //www w3 org/2001/xmlschema", "@xmlns\ xsi" "http //www w3 org/2001/xmlschema instance", "soapenv\ body" { "notifications" { "@xmlns" "http //soap sforce com/2005/09/outbound", "organizationid" "00da0000000ap3dmae", "actionid" "04k2i000000blt9qai", "sessionid" "00da0000000ap3d!aqeaqlpsw0ss1ju4gxki74nqilndgaxwamk2xymbapeib8u4seribcbji9vcix5hdivkd 0cmmqqy7 0wdmyp8r93s8pjclc", "enterpriseurl" "https //engini dev my salesforce com/services/soap/c/58 0/00da0000000ap3d", "partnerurl" "https //engini dev my salesforce com/services/soap/u/58 0/00da0000000ap3d", "notification" { "id" "04ljw000003vylfrqw", "sobject" { "@xsi\ type" "sf\ account", "@xmlns\ sf" "urn\ sobject enterprise soap sforce com", "sf\ id" "a0ijw000000kij9mam" } } } } } } click on the copy icon on the right side of the url to copy the url set up an outbound message in salesforce with the copied url set up an flow in salesforce with the outbound message back in engini, click on the “next step” button get opportunity next, add the “get record” action of salesforce to get all details of the opportunity object type choose from the drop down the opportunity option record id click on the empty field, and the tooltip will pop up showing the options of the values you can choose choose the “sd\ id” value, by following the path response body > soapenv\ envelope > notifications > notification > sobject > sf\ id get opportunity products next, add the “get records” action of salesforce to get all products of the opportunity object type choose from the drop down the opportunity product option filter click on the “add filter” button on the left field, select from the drop down the field you want to add the filter on for this process choose the “opportunity id” field on the middle field, choose from the drop down the “=” condition click on the right field, and the tooltip will pop up showing the options of the value you can choose choose the “opportunity id” value, from the previous activity of “get opportunity” get account next, add the “get record” action of salesforce to the account object type choose from the drop down the account option record id click on the empty field, and the tooltip will pop up showing the options of the values you can choose choose the “account id” from the “get opportunity” activity initialize variable now, let’s initialize a variable that will later hold the customer number of the customer in priority name choose “initialize variable” action of engini name field click on the empty field and choose from the tooltip a name for the variable for example “customer number” type field choose from the drop down the “string” option add if condition add the “if condition” action of engini click on “add conditions” button click on left the field to show the tooltip with all the options you can choose click on the functions label choose the “stringisnullorempty” function, which checks whether a given string is empty or null choose the “account number” value from “get account” activity as an input select the equals (=) condition click on the right field and write ‘true’ if yes if the condition is met, the workflow will turn to execute the process within the if yes block click on “next step” button to add a activity that will be carried out if the condition is met add “create “לקוחות”” activity follow the steps add “form activation” activity follow the steps add “get items “לקוחות” activity follow the steps add “update record” activity follow the steps add “set variable” activity follow the steps if no if the condition isn’t met, the workflow will turn to execute the process within the if no block click on “next step” button to add a activity that will be carried out if the condition is not met add “set variable” activity follow the steps create “לקוחות” add a new activity and choose “create “לקוחות”” action of priority click on the “add fields” button to fill the fields in the “לקוחות” form on the left field, select from the drop down the field you want to populate in the table for this process choose the “שם לקוח” field click on the right field, and the tooltip will pop up showing the options of the values you can choose for the “שם לקוח” field choose the “account name” value from the get account activity form activation when creating a customer in priority, it is initially set up as a temporary customer by default to activate the customer and transition them to an active status, we utilize priority’s activation form add the “form activation” activity of priority choose the “לקוחות” form name from the drop down menu choose the “הפיכת לקוח זמני ללקוח”activation from the drop down menu click on the empty field and choose from the tool tip the number of the customer from the “create “לקוחות”” activity for more information about the form activation see the priority guide get items “לקוחות” after activating the customer, we need to retrieve their information using their customer name because a new customer number has been assigned add a new activity and choose “get items “לקוחות” activity of priority filter click on the “add filter” button to fill the fields in the “לקוחות” form on the left field, select from the drop down the field you want to add the filter on for this process choose the “שם לקוח” field on the middle field, choose from the drop down the “=” condition click on the right field, and the tooltip will pop up showing the options of the value you can choos choose the “שם לקוח” value, from the previous activity of “create “לקוחות”” top n we will specify to retrieve only one record update record add a new activity and choose “update record” action of salesforce object type choose from the drop down the account option record id click on the empty field, and the tooltip will pop up showing the options of the values you can choose choose the “account id” from the “get opportunity” activity fields click on the “add fields” button on the left field, select from the drop down the field you want to populate in the table for this process choose the “account number” field click on the right field, and the tooltip will pop up showing the options of the values you can choose for the “account number” field choose the “מס לקוח” value, from the previous activity of “get customer” set variable choose “set variable” action of engini name click on the drop down and choose the name you gave the variable you initialize value click on the empty field next to the “value” and choose from the tool tip the number of the customer from the “create “לקוחות”” activity create “הזמנות לקוח” add a new activity and choose the “create “הזמנת לקוח”” action of priority fields click on the “add fields” button to fill the fields in the “הזמנות לקוח” form on the left field, select from the drop down the field you want to populate in the form for this process choose the field “מס לקוח” click on the right field, and the tooltip will pop up showing the options of the values you can choose for the “מס לקוח” field choose the variable you initialize few activities before add fields repeat on steps 1 3 to add more fields in addition to the fields we already added, if necessary update record after creating the new customer orders in priority, we need to update the corresponding opportunity record in salesforce with the “priority order number” for future reference add a new activity and choose “update record” action of salesforce object type choose from the drop down the opportunity option record id click on the empty field, and the tooltip will pop up showing the options of the values you can choose choose the “sd\ id” value, by following the path response body > soapenv\ envelope > notifications > notification > sobject > sf\ id fields click on the “add fields” button on the left field, select from the drop down the field you want to populate in the table for this process choose the “priority order number” field click on the right field, and the tooltip will pop up showing the options of the values you can choose for the “priority order number” field choose the “הזמנה” value, from the previous activity of “create “הזמנות לקוח”