Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // create the SData client
- var client = new SDataClient("http://localhost:3333/sdata/slx/dynamic/-/")
- {
- UserName = "admin",
- Password = ""
- };
- // first create a new/empty salesprocess record
- var salesProcess = client.Post(new {}, "salesProcesses");
- // now call the InitSalesProcess business rule to start the process and
- // attach it to the opportunity. We'll pass into the rule the new
- // salesprocess entity we created along with the plugin ID of the
- // process and the opportunity ID we're attaching it to.
- var processPluginId = "p6UJ9A000501"; // ID of the process in the plugin table
- var opportunityId = "ODEMOA0000CR"; // ID of the oppportunity we're attaching it to
- // create the payload for the business rule
- var initProcessRule = new
- {
- Request = new
- {
- entity = salesProcess,
- pluginId = processPluginId,
- entityId = opportunityId
- }
- };
- // execute the rule
- client.Post(initProcessRule, "salesProcesses/$service/InitSalesProcess");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement