WebAPIToolkit.Web.Create - AlexanderStruck/WebAPIToolkit GitHub Wiki
Method:
WebAPIToolkit.Web.Create(entityName, jsonObject, callback)
Description:
Creates a record
Parameters:
- entityName(string): Logicalname of the entity
- jsonObject(object): JSON-object with the data
- callback (function): Callback-method if async
Result:
ID of the created record if synchronus.
Sample:
var NewAccount = new WebAPIToolkit.BusinessEntity(entityName);
NewAccount.SetText("name", "WebAPIToolkit UnitTest (This can be deleted)");
NewAccount.SetBoolean("creditonhold", false);
NewAccount.SetText("description", "This is the description of the sample account");
NewAccount.SetDouble("address1_latitude", 47.63958);
NewAccount.SetCurrency("revenue", 5000000);
NewAccount.SetOptionSet("accountcategorycode", 1);
NewAccount.SetLookup("primarycontactid", "contact", Contacts[0].ID);
var ID = NewAccount.Update();