Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Sunday, February 23, 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: Update field in tab from another form
John Bennett
Posts: 34
 
Update field in tab from another formYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 28 Aug 07 11:20 AM
SLX v6.2.4

I have a custom Main View, lets call A, that has some custom Tabs, lets call B, C, D. A user goes to Tab B and on that Tab B there is a button that when they click on opens up a form. On that form there is a grid which they choose a record and click on a button on that form. This button adds some info to a table. After adding data to a table and before the form closes and returns the user back to tab B, I want to grab a field from the record in that grid and populate a field on the Tab B. I can't for the life of me figure how to do this???

I know how to do everything up until writing the value that I have grabbed from the grid back to the field on the Tab...i tried declaring an object called form and using Application.MainView.CurrentView.tabsViews and referencing the name of the Tab and then since I have that tab object now setting the field on that tab to the data but either i am doing something wrong because I keep getting an error. Can someone show me the syntax/example of how to do this? I hope this is clear...Again I am using v6.2.

Thanks!
[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: Update field in tab from another formYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 28 Aug 07 11:27 AM
If all you need to send back is a field, then probably using a Global variable would be a good option.

On the popup form, choose your field and set it on a global variable.

On the script that invoked that global form, after the call that opens the form (assuming it is being open as a Modal Dialog) read the value from the Global Variable and modify whichever control needs to be modified.
[Reply][Quote]
John Bennett
Posts: 34
 
Re: Update field in tab from another formYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 28 Aug 07 2:56 PM
Raul

Thanks that method did work.....but i know that there is a method whereby you can update fields in a tab from another form....

JB
[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: Update field in tab from another formYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 28 Aug 07 3:17 PM
Yes, the trick relies on getting a proper reference to the form.

Not sure if you can address them by name, but you can do something like this:

Application.MainViews.ActiveView.Tabs.ActiveTab.Form.xxx where would be your control

Or you could loop thru the Tabs Items:

i = 0
Do While i < Application.MainViews.ActiveView.Tabs.Count

Application.MainViews.ActiveView.Item(i).Caption

i = i + 1
Loop

OR,

Application.BasicFunctions.SetTabVisible "Caption goes here" 'This also makes it the Active Tab
Application.MainViews.ActiveView.Tabs.ActiveTab.Form.xxx


You probably should try this with a debugger on hand and step by the code so that you could see if there are other ways to do this easier. I don' have a lot of sample code from 6.2.x handy
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Update field in tab from another formYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 28 Aug 07 5:02 PM
Quote:
Originally posted by John Bennett

Raul

Thanks that method did work.....but i know that there is a method whereby you can update fields in a tab from another form....

JB


Here:

Dim frm

Set frm = Application.Forms("System:MyForm")
frm.TextBox1.Text = "Hello"
frm.DataGrid1.Refresh
frm.Script.SomeSub
'etc...


That what you looking for?
[Reply][Quote]
Lawrence Reid
Posts: 63
 
Re: Update field in tab from another formYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 24 Aug 11 1:30 PM
fiogf49gjkf0d

I have used these combinations from a nav bar button to open to a specific sub tab.  Although it opens to the tab, it displays the data from the last contact it was on vs. the current contact.  I have tried every example I have found to open and refresh the form.  Even F5 does not refresh the data.  I have to switch to a differnt tab and back or Ctrl+F5 to display the data.  How can I get it to refresh with the current data or close the tab before opening it again with the current contacts records?  


 


 


    Application.MainViews.AddEx "System:Contact Details", 1, True, 1, Application.BasicFunctions.CurrentContactID, Application.BasicFunctions.CurrentGroupID  'DNL


    Application.MainViews.ActiveView.Tabs.Add("Contact:HT Entry")


    Application.MainViews.ActiveView.Tabs.ActiveTab = Application.MainViews.ActiveView.Tabs.Add("Contact:HT Entry") 'DNL


    Application.DoEvents


    Dim objForm


    objForm = Application.Forms.Item ("Contact:HT Entry")


    objForm.Refresh


    Application.BasicFunctions.RefreshMainView


    Set objForm = Nothing


 

[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): 2/23/2025 7:18:13 PM