• pitaboy
  • NEWBIE
  • 0 Points
  • Member since 2005

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 10
    Replies
I'm trying to update a custom field for a Lead. However, the field isn't updating. I'm not quite sure if I'm trying to update the Lead correctly.

Lead updateThisLead = new Lead();

updateThisLead.Id = idOfLeadToUpdate;
updateThisLead.UpdateThisField__c = "Updated value";

SforceService sfdc = new SforceService();
string usr = "xxxxxxx";
string pwd = "xxxxxxx";

LoginResult lr = sfdc.login(usr, pwd);

sfdc.Url = lr.serverUrl;

sfdc.SessionHeaderValue = new sforce.SessionHeader();
sfdc.SessionHeaderValue.sessionId = lr.sessionId;
sforce.GetUserInfoResult userInfo = lr.userInfo;

sObject[] records = new sObject[] { updateThisLead };
SaveResult[] sr = sfdc.update(records);

Is there a way to retrieve the ID of the lead created using the API?

 

Lead l = new Lead(); l.FirstName = fname.Text; l.LastName = lname.Text; l.Phone = phone.Text; l.Email = email.Text; l.Title = title.Text; l.Company = company.Text; l.State = state.SelectedValue; l.Country = country.SelectedValue; l.LeadSource = "Web"; SforceService sfdc = new SforceService(); string usr = "xxxxxxx"; string pwd = "xxxxxxx"; LoginResult lr = sfdc.login(usr, pwd); sfdc.Url = lr.serverUrl; sfdc.SessionHeaderValue = new sforce.SessionHeader(); sfdc.SessionHeaderValue.sessionId = lr.sessionId; sforce.GetUserInfoResult userInfo = lr.userInfo; sObject[] records = new sObject[] { l }; SaveResult[] sr = sfdc.create(records); if (sr[0].success) { // Try to get the ID of the lead just created }

 

Is there a Sforce Email To Case Toolkit for .NET. Are there plans for one in the future?

I'm looking for a way to append emails to an existing Case. For example, each time the customer emails the Support team (and vice-versa), the email is somehow appended to or logged in the Case. The Email-To-Case Agent toolkit seems to be the a suitable solution. However, it is in Java. Is there a way to create this behavior using the API and C#? Are there any existing examples for C# and .NET?

Thanks in advance.
I'm trying to update a Contact object yet I'm having problems doing so. I've looked through the forum and can't find anything to help. Am I missing something in my code?

QueryResult qr = sfService.query("Select Department, Email, FirstName, Id, LastName, MobilePhone, Phone, Title from Contact where Id='" + id + "'");
Contact contactObj = (Contact)qr.records[0];

contactObj.FirstName = newFirstName;
contactObj.LastName = newLastName;
contactObj.Phone = newPhone
contactObj.MobilePhone = newMobile;
contactObj.Email = newEmail;
contactObj.Department = newDepartment;
contactObj.Title = newTitle;

SaveResult[] sr = sfService.update(new sObject[] { contactObj });
I'm looking for a way to allow a SelfServiceUser to download a file by clicking a simple link on a page. I've authenticated the SelfServiceUser and provided a link to the Document file
i.e. a href="https://na1.salesforce.com/servlet/servlet.FileDownload?file=015xxxxxxxxxxxx"

However, everytime the SelfServiceUser clicks the link. he's redirected to:
https://www.salesforce.com/login.jsp?startURL=%2Fservlet%2Fservlet.FileDownload%3Ffile%3D015300000003FvL&ec=302 which is the login page for salesforce.com.

Is there a way to provide a SelfServiceUser with a simple link that allows the user to download a document. I'm using API 6.0 and C#. Are there any other methods that can be used to allow a SelfServiceUser to download a document?

Message Edited by pitaboy on 08-16-2005 09:09 AM

I created a form to allow a SelfServiceUser to change his/her password. I have been able to change the password for the SelfService Demo Username (self_service_demo_1122993249809@CompanyName.net)that the was generated during the the SelfService Jump Start. However, when I enabled SelfService for one of the entries in my Contacts and tried to change the password for that user. The password was not changed. I was using the User id. Do I need to create a SelfServiceUser object using API 6.0 for that Contact before I'm able to change his/her password using my form?
Hi,

I have a few questions regarding the CaseComment object.

1. How do you make a new CaseComment object public/private using the API 6.0 and C#? Is it using the IsPublished() method call? I've tried using it and the CaseComment object is still created as private. Do I need to create the CaseComment object then use 'update' to make the CaseComment private/public?

2. I know you cannot set/modify the CreatedBy property. However, I need to find a way to track who created the comment (i.e. If it was a self-service user or an internal user.) and I'm not sure how to go about it. As far as I know, the CaseComment object is not customizable, so I assume adding a field/property to the CaseComment is not possible.

Thanks in advance.


CaseComment CommentObject = new CaseComment();

CommentObject.ParentId = CaseId;
CommentObject.CommentBody = Comment.Text;
CommentObject.IsPublished = true;

// Create service object for sforce
SforceService SFService = new SforceService();

// Invoke the login call and save results in LoginResult
LoginResult lResult = SFService.login(usr,pwd);
// Reset the SOAP endpoint to the returned server URL
SFService.Url = lResult.serverUrl;
// Create a new session header
// Add the session ID returned from the login
SFService.SessionHeaderValue = new SessionHeader();
SFService.SessionHeaderValue.sessionId = lResult.sessionId;

sObject[] sObjectArray = new sObject[] {CommentObject};
SaveResult[] saveResults = SFService.create(sObjectArray);
Hi,

I'm trying to retrieve case comments for a case using C# but I'm not sure how to do it. I've gone through the SF enterprise API (v6.0) but I did not see any method(s) that I can use to retrieve the case comments in either the Case or CaseComment objects. Is there a getCaseCommentForCaseId() method in the API that I missed?

Thanks.

Message Edited by pitaboy on 07-27-2005 11:45 AM

I'm trying to create a form which allows a user to create a new case using C#. I'm unable to find a solution to resolve an error I get when trying to create the Case object. The error message that I'm receiving is: "UNKNOWN_EXCEPTION: Destination URL not reset. The URL returned from login must be set in the SforceService". Can someone provide insight as to how I can resolve this error? Here's is the code segment that creates the Case object.

Case caseObject = new Case();
caseObject.Description = DescriptionField.Text;
caseObject.Subject = SubjectField.Text;
caseObject.Type = TypeList.SelectedValue;

sObject[] records = new sObject[] {caseObject};
SforceService sfdc = new SforceService();

SaveResult[] results = sfdc.create(records);

if (!saveResults[0].success)
{
for(int i=0; i {
DebugOutput.Text = results[0].errors[i].message + " ";
}
}
else{
String newID = results[0].id;
}
I'm trying to update a Contact object yet I'm having problems doing so. I've looked through the forum and can't find anything to help. Am I missing something in my code?

QueryResult qr = sfService.query("Select Department, Email, FirstName, Id, LastName, MobilePhone, Phone, Title from Contact where Id='" + id + "'");
Contact contactObj = (Contact)qr.records[0];

contactObj.FirstName = newFirstName;
contactObj.LastName = newLastName;
contactObj.Phone = newPhone
contactObj.MobilePhone = newMobile;
contactObj.Email = newEmail;
contactObj.Department = newDepartment;
contactObj.Title = newTitle;

SaveResult[] sr = sfService.update(new sObject[] { contactObj });
I'm looking for a way to allow a SelfServiceUser to download a file by clicking a simple link on a page. I've authenticated the SelfServiceUser and provided a link to the Document file
i.e. a href="https://na1.salesforce.com/servlet/servlet.FileDownload?file=015xxxxxxxxxxxx"

However, everytime the SelfServiceUser clicks the link. he's redirected to:
https://www.salesforce.com/login.jsp?startURL=%2Fservlet%2Fservlet.FileDownload%3Ffile%3D015300000003FvL&ec=302 which is the login page for salesforce.com.

Is there a way to provide a SelfServiceUser with a simple link that allows the user to download a document. I'm using API 6.0 and C#. Are there any other methods that can be used to allow a SelfServiceUser to download a document?

Message Edited by pitaboy on 08-16-2005 09:09 AM

Hi,

I have a few questions regarding the CaseComment object.

1. How do you make a new CaseComment object public/private using the API 6.0 and C#? Is it using the IsPublished() method call? I've tried using it and the CaseComment object is still created as private. Do I need to create the CaseComment object then use 'update' to make the CaseComment private/public?

2. I know you cannot set/modify the CreatedBy property. However, I need to find a way to track who created the comment (i.e. If it was a self-service user or an internal user.) and I'm not sure how to go about it. As far as I know, the CaseComment object is not customizable, so I assume adding a field/property to the CaseComment is not possible.

Thanks in advance.


CaseComment CommentObject = new CaseComment();

CommentObject.ParentId = CaseId;
CommentObject.CommentBody = Comment.Text;
CommentObject.IsPublished = true;

// Create service object for sforce
SforceService SFService = new SforceService();

// Invoke the login call and save results in LoginResult
LoginResult lResult = SFService.login(usr,pwd);
// Reset the SOAP endpoint to the returned server URL
SFService.Url = lResult.serverUrl;
// Create a new session header
// Add the session ID returned from the login
SFService.SessionHeaderValue = new SessionHeader();
SFService.SessionHeaderValue.sessionId = lResult.sessionId;

sObject[] sObjectArray = new sObject[] {CommentObject};
SaveResult[] saveResults = SFService.create(sObjectArray);
Hi,

I'm trying to retrieve case comments for a case using C# but I'm not sure how to do it. I've gone through the SF enterprise API (v6.0) but I did not see any method(s) that I can use to retrieve the case comments in either the Case or CaseComment objects. Is there a getCaseCommentForCaseId() method in the API that I missed?

Thanks.

Message Edited by pitaboy on 07-27-2005 11:45 AM

I'm trying to create a form which allows a user to create a new case using C#. I'm unable to find a solution to resolve an error I get when trying to create the Case object. The error message that I'm receiving is: "UNKNOWN_EXCEPTION: Destination URL not reset. The URL returned from login must be set in the SforceService". Can someone provide insight as to how I can resolve this error? Here's is the code segment that creates the Case object.

Case caseObject = new Case();
caseObject.Description = DescriptionField.Text;
caseObject.Subject = SubjectField.Text;
caseObject.Type = TypeList.SelectedValue;

sObject[] records = new sObject[] {caseObject};
SforceService sfdc = new SforceService();

SaveResult[] results = sfdc.create(records);

if (!saveResults[0].success)
{
for(int i=0; i {
DebugOutput.Text = results[0].errors[i].message + " ";
}
}
else{
String newID = results[0].id;
}