Sage 100

 View Only
  • 1.  SetUIControl question

    Posted 03-23-2020 16:40
    Hello,
     Can this not be set for lookup fields? I've done some testing & it works for other fields on the screen, but not the one I need.
    Looking to allow editing based on conditions in the script for the Labor Code field in Employee Maintenance, but it just doesn't work. It will work for other fields on that screen. Is it because of the field type? Thx. ~Dana

    ------------------------------
    Dana Young
    Lehman Wesley & Associates
    Lansing MI
    ------------------------------


  • 2.  RE: SetUIControl question

    Posted 03-24-2020 00:46
    Depending on when your script might be running, there could be subsequent sage logic running which might be reverting whatever you set. Try using the other UI control state, i.e. if you are trying to disable it and it doesn't appear to be working then try hiding it. 
    Also, use Customizer to be absolutely sure of the control's name. There are some controls for fields that have a prefix like "ML_" so if you are strictly going off the field name in the table, you may not ever get the actual control name.

    ------------------------------
    David Speck II
    Tennessee Software Solutions
    ------------------------------



  • 3.  RE: SetUIControl question

    Posted 03-24-2020 08:31
    David, that helped! I had the field name slightly wrong. Thank you for pointing me down that path.

    One follow up question. Now it works, however its like its not resetting itself properly.
    So, the logic is if the employee is a new record, the field should be available to everyone. If the employee is existing, only certain roles can change the field.

    As the restricted user:
    If I open Employee Maintenance & create a new employee, the field is available (which I want)
    If I open Employee Maintenance & open an existing employee, the field is disabled (which I want)
    If I already have Employee Maintenance open & previously created a new employee, then go to an existing, the field is disabled (which I want)
    If I already have Employee Maintenance open & previously selected an existing employee, then try to add a new employee, the field is still disabled (it should not be). I have to close & re-open Employee Maintenance & it is then enabled again.

    Its like its not resetting itself when I have previously disabled the field on a prior record. I am watching the script in debugging & its setting my "new" logic correctly. Once it sees it as a new employee, it should "exit sub"
    I am using Event - Post Read; I can't think of any other that would work here.

    Any thoughts? Thx!

    ------------------------------
    Dana Young
    Lehman Wesley & Associates
    Lansing MI
    ------------------------------



  • 4.  RE: SetUIControl question

    Posted 03-24-2020 09:08
    You need to use SetUIControl with "Enable" passed as the second argument which will require you to change the script's structure a little bit. You can't just use the exit sub.

    ------------------------------
    David Speck II
    Tennessee Software Solutions
    ------------------------------



  • 5.  RE: SetUIControl question

    Posted 03-24-2020 09:20
    Perfect! Thank you, that worked!!!
    ~Dana

    ------------------------------
    Dana Young
    Lehman Wesley & Associates
    Lansing MI
    ------------------------------