executeUpdate(DARequest)
This function updates existing records to the local offline database excluding attachments.
• Function Signature: executeUpdate(DARequest)
• Function Name: executeUpdate
• Parameter: DARequest
• Sample Code:
DARequest objDAReq = new DARequest();
objDAReq.UserName = "tech@acme.com";
objDAReq.APIKey =
"LVaNcHj01asdLX10bBxst2hC6AbsEaWSQSxpknfCjaJ8GKYIa9ZD66++8VYXXxqL";
objDAReq.ObjectName = "Account";
ArrayList arrFD = new ArrayList();
FieldData objFD = new FieldData();
objFD.setName = ("Name");
objFD.setValue = ("Burlingame");
objFD.setType = ("string");
arrFD.Add(objFD);
objFD = new FieldData();
objFD.setName = ("Type");
objFD.setValue = ("Other");
objFD.setType = ("picklist");
arrFD.Add(objFD);
objFD = new FieldData();
objFD.setName = ("BillingStreet");
objFD.setValue = ("Main Street");
objFD.setType = ("textarea");
arrFD.Add(objFD);
objDAReq.FieldNames = arrFD;
ArrayList arrCD = new ArrayList();
CriteriaData objCD = new CriteriaData();
objCD.setName = "Id";
objCD.setValue = "1";
objCD.setOperator = "=";
arrCD.Add(objCD);
objCD = new CriteriaData();
objCD.setName = "OwnerId";
objCD.setValue = "3";
objCD.setOperator = "=";
arrCD.Add(objCD);
objDAReq.AdvanceExpression = "1 AND 2";
objDAReq.Criteria = arrCD;
LaptopMobile.DataAccessAPI.DataAccessAPI objDAAPI = new
LaptopMobile.DataAccessAPI.DataAccessAPI();
if (objDAAPI.executeUpdate(objDAReq) == 1)
{
System.Diagnostics.Debug.WriteLine("Response: " + objDAReq.Response);
} else
{
System.Diagnostics.Debug.WriteLine("Failure Response: " + objDAReq.Response);
}
Sample Success response:
{
"Object Name":"Account",
"Response Code":1,
"Response Message":"MSG-003: Record(s) updated successfully. Number of rows updated: 1",
"Error Id":"",
"Error Message":"",
"Error Description":"",
"Stack Trace":""
}
Sample Failure response:
{
"Object Name":"Account",
"Response Code":0,
"Response Message":"ERR-010: Error updating records. Data type mismatch.",
"Error Id":"ERR-010",
"Error Message":"ERR-010: Error updating records. Data type mismatch.",
"Error Description":"",
"Stack Trace":""
}