Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Wednesday, November 27, 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: Refresh TabView from another TabView
Sarah Peterson
Posts: 37
 
Refresh TabView from another TabViewYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 02 Nov 06 11:18 AM
fiogf49gjkf0d
I have a custom tab called Customer. When a user changes the Current Stage field on this tab from, for example, Existing to Merged a series of message box questions come up that the user can answer Yes/No to. The first question asks if the user wants to move all of the associated branches to another account. If the user selects Yes another screen comes up that requires them to enter the new customer ID to move these branch records to. The second question, then, asks if the user wants to mark all of the Contacts for this account to have a status of Inactive. If Yes, then the contact.status field is updated appropriately.

The question that I have is once this process is complete the Account Detail screen with the Customer Tab is back in focus. If I switch from the Customer tab to the Branch tab to verify that the Branch records have moved and are no longer listed in the datagrid, the branches are still listed. I need to be able to refresh after the process so the user can see that the branch move has taken place.

I have tried a number of different things that I have seen posted on various User Forum sites and nothing seems to be working.

I have used the following techniques/functions to refresh and have not had any luck:

1) Application.BasicFunctions.RefreshMainView
2) Application.BasicFunctions.DoInvoke "Function","Refresh"
3) Application.BasicFunctions.DoInvoke "Function","CurrentRefresh"
4) Dim i

For i = 0 to Application.MainViews.Count - 1
If Application.MainViews.Item(i).BaseTable = "ACCOUNT" Then
Application.MainViews.Item(i).Refresh
End If
Next
5) If Application.MainViews.Item(i).Name = "frmBranches" then
Application.MainViews.Item(i).Refresh
End If
6) I even tried refreshing the datagrid itself (however I cannot recall the exact coding that I tried!)

Are there any suggestions to programatically refresh this tab? It seems like kind of a pain to require the user to F5 after this process to ensure the change took place.

I'm stumped!
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Refresh TabView from another TabViewYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 02 Nov 06 11:31 AM
fiogf49gjkf0d
Take a look here: http://saleslogixblog.com/rfarley/archive/2004/10/21/1118.aspx

Once you get a reference to the tab's form object (using the technique described in the link above) then you can even access controls on that form, such as the grid and refresh it.

However, if you know the exact form you need to refresh you can just grab it from the form's collection and get to it that way as well.

-Ryan
[Reply][Quote]
Sarah Peterson
Posts: 37
 
Re: Refresh TabView from another TabViewYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 02 Nov 06 1:20 PM
fiogf49gjkf0d
That worked!!! I knew I could count on you, Ryan! Thanks...
[Reply][Quote]
Michael Litman
Posts: 94
 
Re: Refresh TabView from another TabViewYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Nov 06 11:22 AM
fiogf49gjkf0d
Ryan,

I am trying to run a script on a tab using the method you discribe in your blog(very handy as well by the way thanks) and I get an error when it try's to execute the script

The error is -
An error occurred executing active form scrpit (tab view name).
Object doesn't support this property or method: script name

any ideas on why I can't execute this script?

thanks for all the help ML
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Refresh TabView from another TabViewYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Nov 06 11:55 AM
fiogf49gjkf0d
Hi Michael,

What does your code look like?

-Ryan
[Reply][Quote]
Michael Litman
Posts: 94
 
Re: Refresh TabView from another TabViewYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Nov 06 3:25 PM
fiogf49gjkf0d
Hi Ryan,

Thanks for the help.
here is the code:
it is the form close event of a small form with a text box that gives you access to the core underlying field of the datagrid that I need to update. As you can see I am calling a sub called PopulateDataGrid when you click the ok button on the form. Thanks For all the help.

ML

Sub AXFormClose(Sender)
dim frmRefresh
dim strOppId

strOppId = application.BasicFunctions.CurrentOpportunityID
set frmRefresh = application.MainViews.ActiveView.TabsViews("OPPORTUNITY:Products")
frmRefresh.PopulateDataGrid

End Sub
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Refresh TabView from another TabViewYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Nov 06 3:36 PM
fiogf49gjkf0d
If you want to get right to the Opportunity Products form, then you need to access it from the forms collection. You only need to use the TabsViews if you're starting at the Opportunity MainView and working down to that tab.

Do it like this:

Dim frm

Set frm = Application.Forms("Opportunity:Products")
frm.Script.PopulateDataGrid


Also, to point out, if you're going to access script on the form, it is not directly exposed on the form object, you have to use the Script object on the form to get to that (see sample above)

-Ryan
[Reply][Quote]
Michael Litman
Posts: 94
 
Re: Refresh TabView from another TabViewYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Nov 06 3:43 PM
fiogf49gjkf0d
That worked I can't say thanks enough. ML
[Reply][Quote]
Developer Jim
Posts: 6
 
Re: Refresh TabView from another TabViewYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 31 Jan 07 3:29 PM
fiogf49gjkf0d
Hi Ryan,
I'm trying to do something similar to the above, except to just refresh the entire tab. Is there a command to achieve this?

thanks for the help,
Jim
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Refresh TabView from another TabViewYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 31 Jan 07 3:38 PM
fiogf49gjkf0d
The form itself has a Refresh method. It might or might not do what you want (it is often misunderstood and doesn't always do what you might expect - I suppose it has to do with what you are after)

Dim frm

Set frm = Application.Forms("MyFamily:MyForm")
frm.Refresh
[Reply][Quote]
Developer Jim
Posts: 6
 
Re: Refresh TabView from another TabViewYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 31 Jan 07 3:56 PM
fiogf49gjkf0d
Thanks Ryan. Got it working!
[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/27/2024 4:43:42 AM