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: Item : Generically Setting a Form to Read Only : SLX 754
Mike Douglas
Posts: 19
 
Item : Generically Setting a Form to Read Only : SLX 754Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 19 Apr 12 11:14 AM
fiogf49gjkf0d

Item : Generically Setting a Form to Read Only : SLX 754


Any one had issues with Class in SLX754 ?


I have used in a SLX62x version for a few years but on upgrade is fails with "Variable Not Set : m_form" in the following "Let"


Public Property Let Form(ByRef val)
    m_form = val
End Property


 


Nothing has changed apart from slx version, I am using the forms from SLX626


I am setting the Opportunity Product Tab to ReadOnly (or not) from the Opportunity Detail


Dim frm
Set frm = New FormWrapper
frm.Form = Application.Forms("Opportunity:Products")


frm.ReadOnly = false

[Reply][Quote]
Mike Spragg
Posts: 1226
Top 10 forum poster: 1226 posts
 
Re: Item : Generically Setting a Form to Read Only : SLX 754Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 19 Apr 12 11:31 AM
fiogf49gjkf0d

You'd be better off rotating through the forms collection :


Sub RefreshOppDetailView
    Dim i


    For i = 0 To Application.Forms.Count - 1
        If Application.Forms.Item(i).Name = "frmOpportunityDetail" Then
           Application.Forms.Item(i).Refresh
           Exit For
        End If
    Next
End Sub


That way, you can do what you need once found (if not found, do nothing).

[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: Item : Generically Setting a Form to Read Only : SLX 754Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 19 Apr 12 11:40 AM
fiogf49gjkf0d

I have not tried this, but since it is complaining about Variable Not Set, why don't you try using a Set statement:


Public roperty Let Form(ByRef val)
    Set m_form = val
End roperty


 


 

[Reply][Quote]
Mike Douglas
Posts: 19
 
Re: Item : Generically Setting a Form to Read Only : SLX 754Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 19 Apr 12 5:41 PM
fiogf49gjkf0d

I am actually testing to see if the tab I wanted to set was visible, and then only trying to set the form to read only.

[Reply][Quote]
Mike Spragg
Posts: 1226
Top 10 forum poster: 1226 posts
 
Re: Item : Generically Setting a Form to Read Only : SLX 754Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 19 Apr 12 5:46 PM
fiogf49gjkf0d

By it's nature the forms collection would only be listed if it were open (or was in memory cache i.e. had been open). So, if it's not - no need to set to r/o.

[Reply][Quote]
Mike Douglas
Posts: 19
 
Re: Item : Generically Setting a Form to Read Only : SLX 754Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 19 Apr 12 5:46 PM
fiogf49gjkf0d

Let Vs Set


Hi Raul - the script/procedure for your info is : http://www.slxdeveloper.com/page.aspx?action=viewarticle&articleid=70

[Reply][Quote]
RJ Samp
Posts: 973
Top 10 forum poster: 973 posts
 
Re: Item : Generically Setting a Form to Read Only : SLX 754Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 19 Apr 12 7:07 PM
fiogf49gjkf0d

that comes close Mike....but many of have known for years that you need to Hide the Buttons themselves and on many of the control's (especially if you have HideButtonifReadOnly unchecked).

[Reply][Quote]
Mike Spragg
Posts: 1226
Top 10 forum poster: 1226 posts
 
Re: Item : Generically Setting a Form to Read Only : SLX 754Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 20 Apr 12 2:03 AM
fiogf49gjkf0d

Once you have the form - you can then access its controls? I've never found that works anyway (always seems to be r/o even when it isn't - see LookupEdit). Besides, if I want granularity I always use:


    


<p>cName = "pklQuoteType|lueVessel|lueCustomer|lueBroker|lueBroConID|lueAccConID|rgSendTo|pklStatus|txtLostTo    
     aControl = Split (cName,"|")

 


    ' If a NAV quote - do not enable controls (R/O) always
    If cbQuoteSource.Checked = False then
        For i = 0 to ubound(aControl)
            Execute aControl(i) & ".Enabled = " & gState
        Next
    Else
        For i = 0 to ubound(aControl)
            Execute aControl(i) & ".Enabled = " & Not cbQuoteSource.Checked
        Next
    End If


That way, I can get to any control and do what I want conditionally.

[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: Item : Generically Setting a Form to Read Only : SLX 754Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 20 Apr 12 9:17 AM
fiogf49gjkf0d

Mike:


  Did you figure out your issue with the Variable not Set?


 


  Maybe you need to figure out if val is a valid object. If it is not, then off course that would cause problems.


 If val in indeed a valid object, then maybe you need to "Set" the variable (not thinking about the Property type - Let or Set), but the actual assignment of the variable:


 


  m_form = val   or Set m_form = val   (since you are dealing with objects).

[Reply][Quote]
Mike Douglas
Posts: 19
 
Re: Item : Generically Setting a Form to Read Only : SLX 754Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 20 Apr 12 9:40 AM
fiogf49gjkf0d

I have amended the calling procedure as per mike spragg suggestion. At this time, that seems to have solved it. However this has fooled me before and "appeared fixed", until the next time


So at the moment I have this


  Dim i
    For i = 0 To Application.Forms.Count - 1
        If Application.Forms.Item(i).Name = "frmOppProducts" Then
            Set frm = New FormWrapper
            frm.Form = Application.Forms("Opportunity:Products")
            frm.ReadOnly = false
           Exit For
        End If
    Next

[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: Item : Generically Setting a Form to Read Only : SLX 754Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 20 Apr 12 9:48 AM
fiogf49gjkf0d

Also, you could always take a look at how it is done on the SLX_Common script (getting Form and Control References).


 


There is a function called "RefreshTabMiddleView. It takes 2 parameters: a Plugin Name and a Control Name (second one is optional).


It checks the Main Views Detail and Tab Views (could be easily extended to check the Detail form for the Main View).


If it finds the Form, it calls a function named "RefreshControl which calls Control.Refresh.


 


In the past I have copied these 2 functions (onto my own Include Script) and used them to set controls to Read Only. I rely on the Same code to find the Form, but instead of Calling Control.Refresh, I take whatever action I need to take on the Control.


 


As a separate Example, I once used this approach to set the "Cursor" of all controls to a Busy Cursor and then back to normal during a lengthy operation  (don't ask why.... ).

[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 11:42:55 AM