Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Monday, November 25, 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: MainView list view problem
Rick Smith
Posts: 96
 
MainView list view problemYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 29 Apr 06 8:22 AM

how to buy abortion pill

where to buy abortion pill online jihying.com buy abortion pill kit online
fiogf49gjkf0d
I have a problem with a MainView that I want the DisplayMode to be list-view only. I un-check mvmDetails in Architect, so only mvmList is checked. No forms are added to any of the Panels. When viewed in the Client, the MainView can still "switch" between List and Detail using F8, and I get an error message relating to Editing a group (?). My workaround is to add a form to the DetailsView Panel that doesn't have any controls - just an empty form. This stops the error from occurring. But since the user can still switch between List and Details views with F8, they see nothing in Details view.
So, two questions:
1. What good is un-checking the mvmDetails property in the MainView if it can still be toggled;
2. Anyone have a better solution than the empty form in the DetailsView panel? (OK, I could add a label control to the form that says "Hey, hit F8 if you want to see anything!")
(v6.2.3, SQL 2000)
[Reply][Quote]
Jeremy Brayton
Posts: 491
Top 10 forum poster: 491 posts
 
Re: MainView list view problemYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 29 Apr 06 11:51 AM
fiogf49gjkf0d
How are you using the MainView? I know .AddEx has the DisplayMode property that opens a MainView in the 3 modes, detail (1), list (2), or split (3). There's also true which uses the last known setting from the UserOptions or false ignores UserOptions and defaults to the list mode.

This doesn't solve the F8 problem which I know of 2 possible ways to trap it that in theory may work (haven't tested, never had this requirement though I suspect I will):
1) OnSwitchViewMode event of the MainView: it fires AFTER the mode is changed. You could programmatically do something like If Mode = 1, Mode = 2 if it allows switching of that nature or you may need to set a runtime property.
2) Each form has an OnKeyPress event. You could trap F8 and disable it but I think this ultimately won't work. You could still switch the views using the menu commands so OnSwitchViewMode is your only option.

Throw this code in your OnSwitchViewMode event (I tested in Account Details MainView):
Sub MainAXFormSwitchViewMode(Sender, Mode)
dim objectMainView
dim integerResult
integerResult = 0
select case Mode
case 1
' Details
' Mode = 2 does not work
integerResult = MsgBox("Switching views is forbidden" & vbCrLf & "For punishment of your crimes you must now close this window", vbYes, "User error!")
set objectMainView = Application.MainViews.ActiveView
objectMainView.DisplayMode = 2
set objectMainView = nothing
case 2
' List
case 3
' Split
end select
End Sub

I would probably just silently switch views and omit that MsgBox call but my luck a user would consider it a bug that it switches modes without any explaination. For extra credit you could use a counter outside of OnSwitchViewMode to build a system of elaborate responses such as "If you hit F8 one more time, somewhere in the world a kitten will die". For the finale you could send them to time out by using a details view form with just a label and a timer on it to simulate a sleep() call.

When the MainView is opened, OnSwitchViewMode is called so if a user did have the details mode set previously it will correct itself and save as list in their user options. You could abstract the code to define default modes for other mainviews or lock them in a specific mode such as split mode for remotes on wider screen laptops, details only for network 800x600 displays, and a mix for others.
[Reply][Quote]
Mike Boysen
Posts: 53
 
Re: MainView list view problemYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 30 Apr 06 10:08 AM

narcan vs naltrexone

naloxone vs naltrexone
fiogf49gjkf0d
Another thing you could try is using the ViewListDetail SECFUNCTION to intercept prior to the mode changing. I believe this is the function that switches between the two. You just need to write a global function.
[Reply][Quote]
Jeremy Brayton
Posts: 491
Top 10 forum poster: 491 posts
 
Re: MainView list view problemYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 01 May 06 5:39 PM

name of abortion pill in u

abortion pill over the counter in usa click
fiogf49gjkf0d
I was waiting for Mr. MainView to comment. Mike's got a good article on custom secured functions here: http://www.saleslogix-guru.com/custom-secured-function.html I'm guessing if the utility is a bundle all of the work could be done within the sales client but "with all the normal hassles" that I'm not accustomed to.

How would one write a function to intercept the ViewListDetail secfunction? I assume it's something like hooking the OnFunction* global events and doing something with that? This would be the more ideal method as you could stop the switch from happening without having to explain why you're switching back (since you couldn't fool a user into not noticing that the detail view was shown for a split second).
[Reply][Quote]
Rick Smith
Posts: 96
 
Re: MainView list view problemYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 01 May 06 11:22 PM
fiogf49gjkf0d
Thank you very much - Jeremy's code worked nicely. Yes, I'd be interested also in intercepting the secfunction, though of course you'd have to be careful to know which MainViews allowed it and which ones did not (and revise the code each time that changed?).
It seems to me that setting the DisplayMode property of the MainView at design time has no effect - whereas it would be ideal if simply un-checking one of the two modes would automatically disable the ability to cause F8 to switch...
[Reply][Quote]
Jeremy Brayton
Posts: 491
Top 10 forum poster: 491 posts
 
Re: MainView list view problemYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 02 May 06 1:50 AM

usa buy abortion pill

abortion pill online usa
fiogf49gjkf0d
Turning it off at design time would be a more ideal solution I will admit but I think I found what Mike was referring to by doing a little of what I call "coding math".

Looking at the Account Details mainview there's this line of code which is a Global Function (as defined in Mike's other articles):
Function OnFunctionBeforeExecute_ViewAltAddress(MainView, FunctionNumber, FunctionName)

Change ViewAltAddress to ViewListDetail and we have our global function that hooks into whenever this is fired for our mainview ONLY. No need to try to set up a list of valid mainviews.

Here's a rough outline of what the code should be but I haven't tested so it might need some tweaking:
Function OnFunctionBeforeExecute_ViewListDetail(MainView, FunctionNumber, FunctionName)
dim booleanResult
booleanResult = true
select case MainView.DisplayMode
case 1
case 2
booleanResult = false
case 3
end select
OnFunctionBeforeExecute_ViewListDetail = booleanResult
End Function

Now the only problem I see with this code is what if the view is set to anything other than list when the mainview initially opens, it will continue to function. The code would also allow you to switch between details and split but lock you in once you switched to the list mode.

The answer to that problem is combining the two techniques. OnSwitchViewMode will automatically switch to the list mode when the mainview opens and OnFunctionBeforeExecute will keep them from being able to switch modes. You may even be able to omit the OnSwitchViewMode by placing MainView.DisplayMode = 2 in the case 1 and case 2 statements. If you run into the same byref (or is it byval, I forget) problem that Mode = 2 has in OnSwitchViewMode then you can just copy the entire case 1 statement from OnSwitchViewMode and use that.

Would you mind letting us know which method works ultimately? I don't have the time to test these suggestions out as I should and I'd like to know what method works exactly just in case I run into a similar requirement in the future.
[Reply][Quote]
Rick Smith
Posts: 96
 
Re: MainView list view problemYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 02 May 06 8:39 AM

nizoral

nizoral
fiogf49gjkf0d
Thanks for taking time to research this further - I read Mike's article on global functions and now understand this much better.

After adding the Function described above, I tested and found that it works, but.... the presence of the OnSwitchViewMode subroutine caused the brief display of that unwanted Details view.

So, I realized that there is not a need to trap that event any longer, and instead added code for the OnOpen event to the MainView (in addition to the OnFunctionBeforeExecute_ViewListDetail function):

Sub MainAXFormOpen(Sender, ID)
Application.MainViews.ActiveView.DisplayMode = 2
End Sub

Once the OnSwitchViewMode sub is removed, the transient Details display is gone.

It works!
[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/25/2024 11:33:33 PM