11/22/2024 10:55:51 AM
|
|
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!
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
|
|
|
|
How to display records in datagrid, that was fetched from webservice
Posted: 04 Apr 06 10:32 PM
|
cheap abortion clinics in memphis tn cheap abortion clinics in miami fiogf49gjkf0d Hello Everyone
I have a requirement to fetch records provided by a web service and display them in a grid on custom form. Has anyone done anything similar. If so can you please let me know how this can be accomplished. Your help is appreciated.
Thanks Raju. R |
|
|
| |
| |
|
Re: How to display records in datagrid, that was fetched from webservice
Posted: 05 Apr 06 11:29 AM
|
fiogf49gjkf0d A few ways to accomplish that. Long and short of it, and what I would do, is use an XMLHttpRequest object from your script to read the XML from the webservice. Then parse the XML and load the data into a Recordset. Then bind the recordset to a grid.
I actually do have that on my list for a subject for a future article on the site, but don't hold your breath - that is a pretty long list
Best bet is to start with googling "XMLHttpRequest VBScript" and see where that takes you. XMLHttpRequest is simple enough to use. That part will only be a few lines of code (Look here for something to get you started http://www.w3schools.com/dom/dom_http.asp). Once you get the result from the webservice you'll need to parse the XML. Here's a VBScript example that makes a call to Amazon for a specific book and displays some details about the book from the returned XML for an example http://hacks.oreilly.com/pub/h/466
-Ryan |
|
|
|
Re: How to display records in datagrid, that was fetched from webservice
Posted: 05 Apr 06 11:46 AM
|
paroxetine effet paroxetine vidal click fiogf49gjkf0d Ryan
Thanks very much for the info. I browsed the links you sent and got an idea on how I can go ahead on this. Regarding binding the recordset to the grid, should I save the data to a custom database table (since datagrid in SLX needs to be associated to a table) OR is there a way to bind it without saving to a database table.
Thanks again for the great help.
Raju.R |
|
|
|
Re: How to display records in datagrid, that was fetched from webservice
Posted: 05 Apr 06 12:21 PM
|
buy amoxicillin without prescription buy amoxicillin from canada fiogf49gjkf0d Hi Raju,
You don't need to add the data to a table first. You can just create an new empty recordset with the fields you need, fill it with the data and then bind that to the grid (which means you'd need to set up the columns http://www.slxdeveloper.com/page.aspx?action=viewarticle&articleid=26)
Something like this:
Dim objrs Dim fld Dim col
'create new recordset & add fields Set objrs = CreateObject("ADODB.Recordset") objrs.Fields.Append "My Field 1", adVarChar, 50 objrs.Fields.Append "My Field 2", adVarChar, 20 objrs.Fields.Append "My Field 3", adSingle objrs.Open
'now append data to recordset objrs.AddNew objrs.Fields("My Field 1").Value = "Some value" objrs.Fields("My Field 2").Value = "Another value" objrs.Fields("My Field 3").Value = 15 objrs.Update 'repeat as needed!
'bind it to the grid and set up columns Set DataGrid1.Recordset = objrs For Each fld In objrs.Fields Set col = DataGrid1.Columns.Add(0) col.FieldName = fld.Name col.Caption = fld.Name Next
Get the idea? |
|
|
| |
|
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!
|
|
|
|
|
|
|
|