Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Tuesday, November 26, 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!
 Architect Forums - SalesLogix Scripting & Customization
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.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Scripting & Customization | New ThreadView:  Search:  
 Author  Thread: Pull value from datagrid
Amy Z
Posts: 4
 
Pull value from datagridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 15 Jun 06 10:28 AM

cialis prezzo

cialis generico online italia consegna veloce blog.fetish-kinks.com
fiogf49gjkf0d
I'd like to pull one value from a datagrid and have that value populate another field in my form and I'm having a hard time pulling that one value. Specifically the value I'm looking to pull is STARTDATE from the ACTIVITY table. Any help/advice is appreciated. Thanks.
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Pull value from datagridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 15 Jun 06 10:37 AM
fiogf49gjkf0d
To get a value from a datagrid you can use the DataGrid.GetCurrentField function and pass in the fieldname (not the column's display name).

ie:
MsgBox "Start date value is: " & DataGrid1.GetCurrentField("startdate")


However, you could always just go to the database as well to get it if needed (if the grid is not in context with where you want this code to run)
[Reply][Quote]
Amy Z
Posts: 4
 
Re: Pull value from datagridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 15 Jun 06 10:42 AM

abortion pill mifepristone buy online

buy abortion pill kit online website
fiogf49gjkf0d
Something I maybe should have mentioned in my original post: I want the date field to be populated at the time the new row is added to the grid, and updated if a new row is added as well. Would that still work? thanks.
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Pull value from datagridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 15 Jun 06 11:50 AM
fiogf49gjkf0d
Sure, but if you potentially have multiple rows in the grid, will you know which row you want the value from? The GetCurrentField function will get a value from the currently selected row in the grid.
[Reply][Quote]
Amy Z
Posts: 4
 
Re: Pull value from datagridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 15 Jun 06 12:06 PM
fiogf49gjkf0d
Yes exactly. So I want the value to populate after I add the new row, and I want to check and make sure that I am pulling the most recent STARTDATE from all of the rows.
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Pull value from datagridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 15 Jun 06 12:11 PM
fiogf49gjkf0d
The only way to know you're pulling the most recent start date from the grid is to loop through all rows (or pull the recordset and filter it).

If it were me, I would just make a trip to the database to get the max(startdate) for the record you're on and not worry about the grid at all (except to know when to rerun the query)
[Reply][Quote]
Amy Z
Posts: 4
 
Re: Pull value from datagridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 15 Jun 06 2:32 PM
fiogf49gjkf0d
The form is based off of another table though, not the activity table. Is there a place where I can look up the correct syntax for using a sql statement in my code to look up the value from another table? I have never been able to locate a good repository for that type of info. Thanks.
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Pull value from datagridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 15 Jun 06 2:56 PM
fiogf49gjkf0d
A good place to look at the existing out of the box plugins to see how this is done in other areas.
[Reply][Quote]
Jeremy Brayton
Posts: 491
Top 10 forum poster: 491 posts
 
Re: Pull value from datagridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 16 Jun 06 12:50 AM
fiogf49gjkf0d
Your requirement will also be better served at the tab/grid level than at the Data Form/table/row level. What I mean is I have a basic lead customization that creates a mirror record linking the primary key to another key field. I used to do all of this processing at the Data Form level in the AXFormValidate event. I would post the record programmatically then add the mirror by copying the control structure before I let the form close. I moved the routine up to the grid level using the OnRowAdded and Edited events which made creating the copy a breeze since looping through the recordset is a little easier than the control structure. I would say use the grid level 99.9% of the time but there are cases where it's easier to do processing on the data form, like when columns aren't in the grid's recordset and you don't want to do any special procssing to pull them out.
[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/26/2024 5:29:36 AM