Discussions
- General Development
- Schema Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules
- Security
- Mobile
- Force.com Sites & Site.com
- Chatter Development
- Java Development
- .NET Development
- Perl, PHP, Python & Ruby
- Desktop Integration
- APIs and Integrations
- Visual Workflow
- Apple, Mac and OS X
- VB and Office Development
- AppExchange Directory & Packaging
- Salesforce Labs & Open Source Projects
- Other Salesforce Applications
- Jobs Board
- Force.com Discussion Boards
- :
- Developer Boards for Force.com and Database.com
- :
- .NET Development
- :
- Update Related Record via Web Service
turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
0
Update Related Record via Web Service
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
07-12-2012 03:04 PM
I'm trying to update a SelfServiceUser record based on an update to a Contact record. I have an OM configured to call the web service when the contact record is edited. Since I don't have the SSU Id I need to query for it based on the contact Id. I can't seem to figure out how to access the Id from the query. This is my first C# experience. Thanks in advance
EditContactNotification.ContactNotification[] contacts = notifications1.Notification;
for (int i = 0; i < contacts.Length; i++)
{
EditContactNotification.ContactNotification notification = contacts[i];
EditContactNotification.Contact contact = (EditContactNotification.Contact)notification.sObj ect;
EnterpriseWebReference.QueryResult qr = null;
qr = binding.query("SELECT Id FROM SelfServiceUser WHERE ContactId = " + contact.Id);
for (int x = 0; x < qr.records.Length; x++)
{
EnterpriseWebReference.sObject ssu2Update = qr.records(x);
EnterpriseWebReference.SelfServiceUser ssu = new EnterpriseWebReference.SelfServiceUser();
ssu.Id = ssu2Update.Id;
ssu.ContactId = contact.Id;
ssu.FirstName = contact.FirstName;
ssu.LastName = contact.LastName;
ssu.Username = contact.Email;
ssu.Email = contact.Email;
EnterpriseWebReference.SaveResult[] saveResults = binding.update(new EnterpriseWebReference.sObject[] { ssu });
}
}
EditContactNotification.notificationsResponse response = new EditContactNotification.notificationsResponse();
response.Ack = true;
return response;
the below line generates the following error: Non-invocable member EnterpriseWebReference.QueryResult.records cannot be used like a method.
EnterpriseWebReference.sObject ssu2Update = qr.records(x);
Solved! Go to Solution.
Message 1 of 2
(759 Views)
0
Re: Update Related Record via Web Service
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
07-12-2012 04:25 PM

