8/23/2025 5:26:33 PM
|
|
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!
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.
|
|
|
|
Updating a MainView everytime a user visits the MainView Window
Posted: 07 May 08 4:01 AM
|
I have created a new MainView which basically consists of a form with an unbound datagrid with dynamic information pulled from a few tables. I want to be able refresh the data in my unbound datagrid everytime a user see's it.
For example: A user will view my summary Main View, then go to the Account Main View, alter some fields, navigate back to my MainView and I want the Main View / Details form to refresh.
I have looked up/tried loads of different events but can't seem to find the answer.
Many Thanks in advance,
John |
|
|
|
Re: Updating a MainView everytime a user visits the MainView Window
Posted: 07 May 08 12:27 PM
|
John,
I am not aware of any form or mainview events that mimic onBlur and/or onFocus. If the user uses the window menu and selects your mainview from the drop down then nothing fires that I know of. However, if they are clicking on your left navbar icon or via the view menu you could structure your code so that you call the refresh in your navigation code. I recommend that the actual refresh code exist in your form code behind, but you can call this member from the invoking script.
HTH,
Timmus |
|
|
|
Re: Updating a MainView everytime a user visits the MainView Window
Posted: 07 May 08 12:31 PM
|
Here is some sample code that we wrote for our Executive Dashboard product. You will notice that if we find the existing mainview we dont call the InitializeForm member. Based on your requirements, you probably would.
option explicit
const DS_CAPTION = "Executive Dashboard" const DS_FORMNAME = "frmExecutiveDashboard"
Sub Main Dim mvCurrent dim i
Dim strDashboard Dim objOWC
On Error Resume Next
'check the mainviews collection to see if the dashboard form is already open 'NOTE - current SLX bug nulls out the mainview caption and name, so we cannot inspect 'those. We must inspect the details form name instead, which is saved as '"frmExecutiveDashboard" in the plugin
For i = 0 to Application.MainViews.Count - 1 If (Application.MainViews.Item(i).DetailsView.Name = DS_FORMNAME) Then If (Err.Number = 0) Then Application.MainViews.Item(i).Caption = DS_CAPTION Application.MainViews.Item(i).BringToFront Exit Sub Else Call Err.Clear() End If End If Next
' Form not found in collection - create a new instance Set mvCurrent = Application.MainViews.Add("Dashboard:Executive Dashboard", 1, true) mvCurrent.name = "Dashboard:Executive Dashboard" mvCurrent.Caption = DS_CAPTION mvCurrent.DisplayMode = 1 ' Detail Call mvCurrent.DetailsView.Script.InitializeForm() Call mvCurrent.Show() Set mvCurrent = Nothing
Call ErrorCheckSLX("Executive Dashboard - Show had an error:", vbExclamation, "Dashboard:Executive Dashboard - Show") End Sub |
|
|
| |
|
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!
|
|
|
|
|
|
|
|