Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Friday, November 22, 2024 
 
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 - ASP/ASP.NET/Web Services/Other
Forum to discuss building external web applications for SalesLogix. View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to ASP/ASP.NET/Web Services/Other | New ThreadView:  Search:  
 Author  Thread: SData field name help
Jeff L
Posts: 65
 
SData field name helpYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 29 Mar 12 9:05 AM
fiogf49gjkf0d

Hello,


I am using this code to get the groups available to a given user and putting them in a drop list box in an ASP.NET site. I get the list of groups just fine. Along with the description I need the plugin id. So I can get the list of contacts associated with the selected group


For the life of me, I cannot figure out if the return contains the plugin ID. Can someone please help ? what would the name of the field be? I have tried many different names.


***** Get the groups *******


.......



        public AtomFeed GetGroupsSData(string sUserId, string sMode)


        {


            AtomFeed feed = null;


            try


            {


                SDataService service = new SDataService("https://XXXXXXXX/sdata/slx/system/-/", LocalData.USERNAME, LocalData.PASSWORD);


                SDataResourceCollectionRequest sdataCollection = new SDataResourceCollectionRequest(service)


                {


                    ResourceKind = "groups",


                    QueryValues = 


                    {


                        {


                            "where", "family eq '" + sMode + "'" 


                        }


                    },


                };


                feed = sdataCollection.Read();


                service = null;


......


***** Load the drop list ********


...



            AtomFeed feed = slx.GetGroupsSData(LocalData.USERID, dlMode.SelectedItem.Text);


            int pos = 0;


            try


            {


                if (feed != null)


                {


                    foreach (AtomEntry tempEntry in feed.Entries)


                    {


                        SDataPayload group = (SDataPayload)tempEntry.GetSDataPayload();


                        if(group.Values["name"].ToString() != null )


                        {


                            ListItem lst = new ListItem(group.Values["name"].ToString(),  group.Values["????????????????????"].ToString() );


                            dlSelectGroupName.Items.Insert(pos++, lst);


                        }


                    }


                }


            }


            catch (SDataClientException sdE)


....


***** Get the contacts ******


....



            var uri = new SDataUri("https://XXXXXX/sdata/slx/system/-/groups/$queries/execute")


            {


                Select = "*",


                QueryArgs = { { "_groupId", "Here is where I need to add the PluginID. How do I get it ?????" } },


                StartIndex = 0,


            };


            var request = new SDataRequest(uri.ToString())


            {


                UserName =sUerName,


                Password = sPassword


            };


 


 


            string account = string.Empty;


            string contactName = string.Empty;


            string title = string.Empty;


            string WorkPhone = string.Empty;


            string MobilePhone = string.Empty;


 


            int iCount = 0;


            var response = request.GetResponse();


            var feed = (AtomFeed)response.Content;


            foreach (AtomEntry tempEntry in feed.Entries)


            {


                SDataPayload payload = (SDataPayload)tempEntry.GetSDataPayload();


 


                account = string.Empty;


                contactName = string.Empty;


                WorkPhone = string.Empty;


                MobilePhone = string.Empty;


 


                iCount++;


                // Now read some values from the payload. Note, the 


                // property names you use here need to match the property 


                // names defined for the entity (these are case-sensitive).


                account = payload.Values["ACCOUNT"].ToString();


                contactName = payload.Values["NAMELF"].ToString();


                if (payload.Values["MOBILE"] != null)


                    MobilePhone = payload.Values["MOBILE"].ToString();


                if (payload.Values["WORKPHONE"] != null)


                    WorkPhone = payload.Values["WORKPHONE"].ToString();


 


                //rtResults.Text = rtResults.Text + "Account - " + account + " Name - " + contactName + "Mobile Phone -  " + MobilePhone + "Work Phone - " + WorkPhone;


                rtResults.Text = rtResults.Text + "Count - " + iCount.ToString() + " Name - " + contactName + "\r\n";


 


 


            }


....


 

[Reply][Quote]
Jeff L
Posts: 65
 
Re: SData field name helpYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 29 Mar 12 9:11 AM
fiogf49gjkf0d

Never Mind.


As soon as I hit the Post button, I saw the answer.


 


group.Key


 


Embarassed

[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 © 2024 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): 11/22/2024 5:32:54 AM