Advertisement
RyanFarley

Untitled

Nov 14th, 2017
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.99 KB | None | 0 0
  1. // create the SData client
  2. var client = new SDataClient("http://localhost:3333/sdata/slx/dynamic/-/")
  3. {
  4.     UserName = "admin",
  5.     Password = ""
  6. };
  7.  
  8. // first create a new/empty salesprocess record
  9. var salesProcess = client.Post(new {}, "salesProcesses");
  10.  
  11. // now call the InitSalesProcess business rule to start the process and
  12. // attach it to the opportunity. We'll pass into the rule the new
  13. // salesprocess entity we created along with the plugin ID of the
  14. // process and the opportunity ID we're attaching it to.
  15.  
  16. var processPluginId = "p6UJ9A000501"; // ID of the process in the plugin table
  17. var opportunityId = "ODEMOA0000CR"; // ID of the oppportunity we're attaching it to
  18.  
  19. // create the payload for the business rule
  20. var initProcessRule = new
  21. {
  22.     Request = new
  23.     {
  24.         entity = salesProcess,
  25.         pluginId = processPluginId,
  26.         entityId = opportunityId
  27.     }
  28. };
  29.  
  30. // execute the rule
  31. client.Post(initProcessRule, "salesProcesses/$service/InitSalesProcess");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement