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!
|
|
Refresh TabView from another TabView
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! |
|
|
| |
| |
| |
| |
|
Re: Refresh TabView from another TabView
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 |
|
|
|
Re: Refresh TabView from another TabView
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 |
|
|
| |
|
Re: Refresh TabView from another TabView
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 |
|
|
|
Re: Refresh TabView from another TabView
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 |
|
|
| |
|