Advertisement
Guest User

Untitled

a guest
Mar 2nd, 2015
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. // Your code to get an instance of the Tooling Service for
  2. // an active Salesforce Session will probably differ.
  3. ToolingServiceWrapper toolingService = salesforceSession.GetToolingService();
  4.  
  5. sObject[] customFields = toolingService.retrieve("Id, Metadata", "CustomField",
  6. new string[] { "00N70000003KVWfEAO" });
  7. Assert.AreNotEqual(0, customFields.Length);
  8.  
  9. CustomField cf = (CustomField)customFields[0];
  10. if (cf.Metadata.formula == "Name")
  11. {
  12. cf.Metadata.formula = "$Organization.Name";
  13. }
  14. else
  15. {
  16. cf.Metadata.formula = "Name";
  17. }
  18. SaveResult[] saveResults = toolingService.update(new sObject[] { cf });
  19. Assert.AreNotEqual(0, saveResults.Length);
  20. SaveResult sr = saveResults[0];
  21. Assert.IsTrue(sr.success);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement