Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Wednesday, June 18, 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!
 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: How To pass data between forms
Dean
Posts: 12
 
How To pass data between formsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 14 May 07 4:30 PM
fiogf49gjkf0d
I need a lookup form that will allow me to lookup data based on several different fields. i.e. Name, address, phone, Invoice Number, Date, ...

I also need to launch the new lookup form as a child form and then when the user selects the correct record I need to return the record key to the parent form.

I have created the search from and I can load the form but I don't know how to pass the record key back to the parent.

Is this possible? Can anyone help?



[Reply][Quote]
Jeff Weight
Posts: 219
 
Re: How To pass data between formsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 15 May 07 9:19 AM
fiogf49gjkf0d
Well, there are really two decent ways to do this, and which one you use depends on how you launch the form. How do you get the form to popup? And which version of SalesLogix do you use?
[Reply][Quote]
Dean
Posts: 12
 
Re: How To pass data between formsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 15 May 07 10:11 AM
fiogf49gjkf0d
I'm using Versions 7.0

My custom lookup/search form is a Data Form. and here is the code to launch the form:

Dim Frm
Dim objDetail

set frm = application.MainViews.Add("Personal:C_InvoiceLookup", 2, True) 'DNL

Frm.Caption = Application.Translator.Localize("Lookup Invoice")
Set objDetail = Frm.DetailsView
objDetail.chbxBillTo.Checked = True

frm.show

[Reply][Quote]
Jeff Weight
Posts: 219
 
Re: How To pass data between formsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 15 May 07 11:17 AM
fiogf49gjkf0d
There are a bunch of examples in SalesLogix that show how to retrieve information from forms that are displayed in this fashion. To make yours work, you would just need to add a line or two right after the "frm.show":

'Use this to grab the value from an object on the form:
theValueIWant = objDetail.txtMyTextBox.Text

'Use this to grab the value from a variable in the code behind the form:
theValueIWant = objDetail.Script.MyVariable

Set Frm = Nothing 'A good practice to kill the memory used for your form
Set objDetail = Nothing

That should do it. Give it a try and let us know how it goes.

Jeff
[Reply][Quote]
Dean
Posts: 12
 
Re: How To pass data between formsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 15 May 07 11:41 AM
fiogf49gjkf0d
Thanks that worked to pass back or retrieve the value at the time of the form load.

How do I get the calling form to stop the execution of code and wait until the child form is close before continuing on?

For example the entire code below is executed before the child form "Frm" is close. I need the value after the child form closes:

Frm.show
theValueIWant = objDetail.txtMyTextBox.Text

Is there a way to load the child form in such a way that the parent form's code stops executing until the child is closed?

Currently I’m using:
set frm = application.MainViews.Add("Personal:C_InvoiceLookup", 2, True)
[Reply][Quote]
Jeff Weight
Posts: 219
 
Re: How To pass data between formsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 15 May 07 11:48 AM
fiogf49gjkf0d
Hmm - interesting - I didn't know that would happen. The way it is shown in SalesLogix, and the way I do it, is to change the following code:

Frm.show
theValueIWant = objDetail.txtMyTextBox.Text

To:

If Frm.ShowModal = mrOK Then
theValueIWant = objDetail.txtMyTextBox.Text
End If

That tells SalesLogix you are waiting for the user to either click OK or cancel. Also, this is convenient because you won't be setting any new values if the user does indeed cancel whatever they did on the popped up form.
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: How To pass data between formsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 15 May 07 11:48 AM
fiogf49gjkf0d
Quote:
Originally posted by Dean

How do I get the calling form to stop the execution of code and wait until the child form is close before continuing on?


Change frm.Show to frm.ShowModal

-Ryan
[Reply][Quote]
Dean
Posts: 12
 
Re: How To pass data between formsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 15 May 07 12:30 PM
fiogf49gjkf0d
This is exactly what I was looking for. Thanks a ton.
[Reply][Quote]
Jeremy Brayton
Posts: 491
Top 10 forum poster: 491 posts
 
Re: How To pass data between formsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 15 May 07 1:16 PM
fiogf49gjkf0d
Be aware that Manage Forms don't default to mrOK. You have to specifically link their buttons to the correct Form.ModalResult property, or at least this was the norm in 6.x. I've always believed the forms should behave identically but since it generally isn't happening yet, I have a codebase that "makes it so".
[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/18/2025 4:20:53 PM