Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Friday, June 27, 2025 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Web Forums - SalesLogix Web Platform & Application Architect
Forum to discuss the use of the SalesLogix Web Platform, Client and Customer Portals, and the Application Architect (For version 7.2 and higher only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Web Platform & Application Architect | New ThreadView:  Search:  
 Author  Thread: SDATA - Creating Lead, how to set owner?
NixDev
Posts: 98
 
SDATA - Creating Lead, how to set owner?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 02 Jul 12 9:22 AM
fiogf49gjkf0d


Hi,


 


I'm coding a Win32 program to create leads in saleslogix using sdata client library. I was able to insert a lead and the associated LeadAddress by instantiating a SDataPayload that looks like this:


 


SDataPayload leadPayload = new SDataPayload();
leadPayload.ResourceName = "Lead";
leadPayload.Namespace = "http://schemas.sage.com/dynamic/2007";

leadPayload.Values.Add("Company", entityDictionary["Company"]);
leadPayload.Values.Add("FirstName", entityDictionary["FirstName"]);
leadPayload.Values.Add("MiddleName", entityDictionary["MiddleName"]);
leadPayload.Values.Add("LastName", entityDictionary["LastName"]);
leadPayload.Values.Add("Title", entityDictionary["Title"]);
leadPayload.Values.Add("WorkPhone", entityDictionary["WorkPhone"]);
leadPayload.Values.Add("EMail", entityDictionary["EMail"]);
leadPayload.Values.Add("Notes", entityDictionary["Notes"]);


//Create Address
SDataPayload addressPayload = new SDataPayload();
addressPayload.ResourceName = "Address";
addressPayload.Values.Add("Address1", entityDictionary["Address1"]);
addressPayload.Values.Add("City", entityDictionary["City"]);
addressPayload.Values.Add("State", entityDictionary["State"]);
addressPayload.Values.Add("PostalCode", entityDictionary["PostalCode"]);
leadPayload.Values.Add("LeadAddress", addressPayload);

 So far, so good, this works ok, the entity is created without problem, by default it is assigned owner "Everyone".


 


Now, I'm not sure how to explicitly set the Owner of that Lead. I tried setting a nested payload, using a similar pattern to the address entity, like this:


 


SDataPayload ownerPayload = new SDataPayload();
ownerPayload.ResourceName = "Owner";
ownerPayload.Values.Add("OwnerId", entityDictionary["SeccodeId"]);
leadPayload.Values.Add("Owner", ownerPayload);

Unfortunately that doesn't seem to work.


 


I've been googling around for maybe an hour without much luck. Could anyone shed some light into this???


 


Thanks!!!


[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: SDATA - Creating Lead, how to set owner?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Jul 12 2:59 AM
fiogf49gjkf0d

This post of mine might help: http://customerfx.com/pages/crmdeveloper/2011/12/01/including-nested-payloads-with-sdata-for-saleslogix.aspx


Basically, you're on the right track. You create an nested payload. You could do it all inline with something like this:


 


leadPayload.Values["Owner"] =
new SDataPayload {
Values = {
{ "OwnerId", "SECCODE VALUE" }
}
};

 


or get the nested payload already contained in the template (if you're creating the lead from a template - if not just create a new payload, set the values and then set it back to the property in the main load payload), set the values and then set it back in the main lead payload like this:


 


var leadOwnerPayload = (SDataPayload)payload.Values["Owner"];
leadOwnerPayload.Values["OwnerId"] = "SECCODE VALUE";

 

[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 6/27/2025 9:04:49 PM