You need to sign in to do that
Don't have an account?
Upsert Task Item - Remove EDIT function
[WebMethod]
public string APEXUPSERT(string SessionID,
string TechID, string TechName, string SSOID, string TechDescr,
string Status, string CField0, string CField1, string CField2,
string CField3, string CField4, string CField5, string ChatLog,
string WaitingTime, string PickupTime, string ClosingTime)
{
SforceService sfdc = new SforceService();
sfdc.Url = CField5;
sfdc.SessionHeaderValue = new SessionHeader();
sfdc.SessionHeaderValue.sessionId = CField1;
sforce.Task[] task = new Task[1];
task[0] = new sforce.Task();
task[0].WhatId = CField3;
task[0].IsClosed = true;
task[0].Subject = "Rescue Session";
task[0].Description = ChatLog;
task[0].LastModifiedDate = DateTime.Now;
task[0].TechID__c = TechID;
task[0].TechName__c = TechName;
task[0].WaitingTime__c = WaitingTime;
task[0].PickupTime__c = PickupTime;
task[0].ClosingTime__c = ClosingTime;
task[0].TechDescr__c = TechDescr;
task[0].IsClosed = true;
task[0].Status = "Completed";
sforce.UpsertResult ur = sfdc.upsert("Id", task)[0];
if (ur.success)
{
return "OK";
}
else
{
return "ERROR";
}
}
The Name field is the record name defined for the object. You can add a value for the field the way you would for any other field.
Hope this helps.
Thanks Rick!
But I want to restrict them from editing only certian records in TASK. Is that possible?
I tried: task[0].Who = Cfield0; //Cfield0 is a string
but I got the error "Cannot implicitly convert type 'string' to 'sforce.Name'
Not sure of the coercion problem on the Name field. I'll see if I can find something.
Hope this helps.