Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Saturday, September 28, 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 - SalesLogix Web Client (Pre-7.2)
Forum to discuss using & developing the legacy SalesLogix Web Client (For versions 7.0 and earlier). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Web Client (Pre-7.2) | New ThreadView:  Search:  
 Author  Thread: Recordsets within the VB Script...
Richard Fisher
Posts: 3
 
Recordsets within the VB Script...Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 21 Feb 07 4:46 AM
fiogf49gjkf0d
I'm trying to get a Recordset/Class/Property bucket to work within VB script of the web client. I understand that this probably like trying to build a house out of Jelly, however it would make my life a million times easier if I can get it to work.

The problems I've found so far are that ADO isn't supported, classes don't appear to be supported and array's aren't dynamic enough. What I need is basically a dynamic array or any other form of dynamic property bucket.

Any help, ideas or advice will be greatly received.
[Reply][Quote]
Nick Hollis
Posts: 549
Top 10 forum poster: 549 posts
 
Re: Recordsets within the VB Script...Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 21 Feb 07 4:53 AM
fiogf49gjkf0d
Could you give me an idea of what the dynamic property bucket is to do? Ive not familiar with this term...

Thanks
[Reply][Quote]
Richard Fisher
Posts: 3
 
Re: Recordsets within the VB Script...Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 21 Feb 07 5:12 AM
fiogf49gjkf0d
What I mean by property bucket is basically a detached recordset that can contain variable amount of rows, hence why the array is out since that has to be a fixed at the time of creation of the array and from my experience can't be based on a variable value at that time.

The problem I'm trying to over come is one of auditing web pages. Every change to a field has to be recorded with certain information (Name of field, old value, new value, user, and time changed), now I'm doing this through VB script on the post of the web page. Currently I have this working for one page as well, however it is very long winded and a very messy way of doing it and also I have to get it working for almost the entire application.
That is why I'm trying to use a detached recordset to hold those values that have changed and thus need to be recorded to the audit table. The reason I can't use the array is because I don't know how many records have changed at the time of the creation of the array.

Hope all that makes sense and thanks for the reply.

Richard
[Reply][Quote]
Nick Hollis
Posts: 549
Top 10 forum poster: 549 posts
 
Re: Recordsets within the VB Script...Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 21 Feb 07 5:30 AM
fiogf49gjkf0d
Ok - hmmm I must admit I dont use ADO in the Web, and to do what you are trying to do here I ended up doing it the 'messy' way i.e. an IF structure setup for all controls on the page (and testing if their old values are different from the posted values). Very tedious. As for ADO not being un-useable im not sure, I know you can use CreateObject so dont see why you cant use ADO.

There is also the possibility of using PostedLineCount which will allow you to loop through all of the postedvalues from the form to check for changes against the db - you could then check the values of the posted form against the db before the Update to the main table occurs and perhaps create a pipe delimited string of all those fields that have changed. Then loop through the pipe delimited string and write to your audit table. Hows that for messy?? This approach assumes you can match a posted value to a database field (this could be done via the SLXWebAlias table I believe.

Actually im getting a head ache just thinking about doing that....
[Reply][Quote]
Doug Miller
Posts: 20
 
Re: Recordsets within the VB Script...Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 21 Feb 07 7:21 AM
fiogf49gjkf0d
Quote:
Originally posted by Richard Fisher

I'm trying to get a Recordset/Class/Property bucket to work within VB script of the web client. I understand that this probably like trying to build a house out of Jelly, however it would make my life a million times easier if I can get it to work.

The problems I've found so far are that ADO isn't supported, classes don't appear to be supported and array's aren't dynamic enough. What I need is basically a dynamic array or any other form of dynamic property bucket.

Any help, ideas or advice will be greatly received.


Although I haven't tried in the web client, you can resize an array any time you need to. Just dim the array variable:

dim arr

Then when you know how many fields changed, redim the array:

redim arr(fieldcount)

EDIT: Seems [CODE] doesn't work.... Ryan, is it possible to have "code" tags in this forum??

[Reply][Quote]
Nick Hollis
Posts: 549
Top 10 forum poster: 549 posts
 
Re: Recordsets within the VB Script...Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 21 Feb 07 7:46 AM
fiogf49gjkf0d
Redim didnt work for me in the web client! Kept getting Format Mismatches, I gave up with it in the end...
[Reply][Quote]
Jason Huber
Posts: 77
 
Re: Recordsets within the VB Script...Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 21 Feb 07 9:14 AM
fiogf49gjkf0d
you probably want to use redim preserve so that you dont loose the contents of the array.
Also in a multidimensional array in vbscript only the last dimension is redimmable.

so you could
******************
dim arr()
redim arr(0,0)
arr(0,0) = "Jason"
redim preserve arr(0,1)
msgbox(arr(0,0)) '(shows Jason)
******************

if you didnt do the PRESERVE it shows nothing

but you cannot redim preserve arr(2,1) since that would include the first dimension.
[Reply][Quote]
Richard Fisher
Posts: 3
 
Re: Recordsets within the VB Script...Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 21 Feb 07 10:52 AM
fiogf49gjkf0d
Thanks for the feed back everyone it is all much appreciated.

It's certainly given me some other avenues to try.

I'll let you know how I get on. Thanks again for the replies.
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Recordsets within the VB Script...Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 21 Feb 07 1:50 PM
fiogf49gjkf0d
Quote:
Originally posted by Doug Miller

EDIT: Seems [CODE] doesn't work.... Ryan, is it possible to have "code" tags in this forum??


Hi Doug. For now, you can wrap the code in <pre></pre> tags. The new version of this site I've been working on, slxdeveloper v2, will have support for BBCode tags as well as a nice way to have formatted code in your posts. More to come on that later
[Reply][Quote]
Doug Miller
Posts: 20
 
Re: Recordsets within the VB Script...Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 21 Feb 07 2:11 PM
fiogf49gjkf0d
Quote:
Originally posted by Ryan Farley



Hi Doug. For now, you can wrap the code in <pre></pre> tags. The new version of this site I've been working on, slxdeveloper v2, will have support for BBCode tags as well as a nice way to have formatted code in your posts. More to come on that later


Nice. Thanks Ryan!
[Reply][Quote]
Jeff Ballard
Posts: 326
 
Re: Recordsets within the VB Script...Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 21 Feb 07 3:01 PM
fiogf49gjkf0d
If we're really talking about web client actions (and not VB Script), ReDim does NOT work in web client actions...been down that road too many times.

Jeff


[Reply][Quote]
Nick Hollis
Posts: 549
Top 10 forum poster: 549 posts
 
Re: Recordsets within the VB Script...Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 21 Feb 07 3:08 PM
fiogf49gjkf0d
Excellent, I thought it was just me!
[Reply][Quote]
Peter H
Posts: 17
 
Re: Recordsets within the VB Script...Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 21 Feb 07 5:35 PM
fiogf49gjkf0d
Looks like the place for this is at the backend - on the SQL Database, not the frontend.
[Reply][Quote]
Peter H
Posts: 17
 
Re: Recordsets within the VB Script...Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 21 Feb 07 5:43 PM
fiogf49gjkf0d
but if you want to redim, then the initial dim should NOT specify any sized array
---> Dim x()
Redim x(24,32) or whatever
[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): 9/28/2024 6:27:30 PM