Different Defaults for Different Users

SOLVED

Is it possible to have different Default values for the Work Order Issue Method for different users in Sage 100?  We have a situation where one plant is using the MANUAL issue method and another plant is using BACKFLUSH as the preferred issue method.  Is there a way to get the users for the one plant to default to MANUAL and the users for the other plant to default to BACKFLUSH?  

If we change the Default Values, I believe it changes the default values for ALL users, not just the specific user. Is that correct?

If this needs to be done by script, how would you recommend we do this?  If the script fires at the end of entering the work order, then it would prevent that user from ever creating a work order with a different issue method if they ever needed to do that.

Any suggestions?  

  • 0

    No scripting is currently possible in WO (old framework).

  • 0

    Hi Tyler - Like Kevin said there is no modern Framework style scripting for WO. But older style button scripts can work to a certain extent. The problem is it actually requires clicking a button instead of having an event driven script automatically fire off when # is clicked to get the next Work Order No.

    So the down side is a button script won't reduce the actual number of clicks but it would select the correct Issue Method by User ID. And you can place it at the top and use a keyboard shortcut. All of that might make it easier than remembering to click the right Issue Method in the dropbox. In case it might be helpful:

    The actual script would be something like this:

    'MAS_SCR_DBG = 1
    strUser = MAS_SCR_USR  'this is the currently logged in User ID

    Select Case strUser

     Case "Tyler","User2","User3"
      DB_ISSUE_MTHD = "B"     'Backflush

     Case "User4", "User5", "User 6"
      DB_ISSUE_MTHD = "A"     'Auto

     Case "User7", "User8", "User 9"
      DB_ISSUE_MTHD = "M"     'Manual

    End Select

  • 0 in reply to Alnoor

    Alnoor,

    A couple of us have been messing around with the script example you provided and it works for the first work order that you click the button on, but if you go to another work order and try the button again, it will not execute.  It is like the script is still running somewhere and hasn't finished.  Any suggestions on how we can make it work for the second and subsequent work orders?

    Thank you for sharing the script example above!

  • +1 in reply to Tyler Christensen
    verified answer

    Ah yes this sort of thing would happen in legacy. Let's just say Issue Method is not script friendly b/c some underlying extra pvx code needs to run for a dropbox. If it was a MULTI_LINE it would've been ok. If W/O wasn't legacy it would've been ok.

    Normally a small mod is written here but since I started this journey back to old skool with you, an in-between way is to run Perform Logic from the same Customizer button.

    Step 1: Modify your script so it only has this in it now (essentially only needs MAS_SCR_PFM line)

    'WO Entry - Change the Issue Method button by User
    MAS_SCR_PFM = "..\CM\Script\Tyler-HG2.pvx"
    'Any script code below will run first then the Perform Logic runs from above location / file
    'In our case no further VB Script code to execute

    Step 2: Create a TXT file in CM\Script and then rename to Tyler-HG2.pvx (or whatever you see fit). You can leave it as .TXT if you like but change the above reference to  .TXT as well.

    Step 3: Open Tyler-HG2.pvx (or whatever you called it) with a text editor then copy/paste this in below. 

    Step 4: TEST THIS!! Have multiple people TEST it. If you want to say run only in TST company code, either use Customizer to create button for TST only OR condition the company as I've noted below.

    ** Please note all my comments below which are noted with ! symbol


    ! WO Entry change Issue Method button

    ! OPTIONAL - Condition for test company. Uncomment out this line and the ending }
    ! Change TST to different company code if needed
    ! IF %SYS_SS'CompanyCode$ = "TST" {

    ! REQUIRED
    ! We don't run further if Order Status = Released. Only run for Firm Planned and Estimate.
    ! If you take out this conditional, data corruption may occur.
    ! If Status = Closed, screen would have loaded in Read Only mode anyway

    IF DB_STATUS$ <> "R" {

    strUser$ = %SYS_SS'UserName$
    SWITCH strUser$

    CASE "Tyler","User2","User3"
    DB_ISSUE_MTHD$ = "B" !Backflush
    BREAK

    CASE "User4", "User5", "User 6"
    DB_ISSUE_MTHD$ = "A" !Auto
    BREAK

    CASE "User7", "User8", "User 9"
    DB_ISSUE_MTHD$ = "M" !Manual
    BREAK

    DEFAULT
    !Use this for all other CASEs not specified above
    DB_ISSUE_MTHD$ = "M"

    END SWITCH

    ! OPTIONAL section: Puts focus back on Order Date.
    ! Set next line below to Control Name as seen in Customizer + ".ctl"
    tmpDestCTL = ML_WO_DATE.CTL ! Save off this numeric control ID assigned to WO Date control
    PREINPUT NEXT tmpDestCTL ! Get ready to set focus
    NEXT_ID = tmpDestCTL ! Sets focus on the WO Order Date control

    ! OPTIONAL section: Sets the Refresh_Flg
    REFRESH_FLG = 1 !Refresh screen. BUT take this out if any negative side effects

    } ! End Required check for DB_STATUS$

    ! } ! End Optional check if current company = TST. Uncomment 1st ! on this line as needed

    EXIT ! Exit from the Perform


  • 0 in reply to Alnoor

    Alnoor,

    Your help was exacty what was needed.  We were able to incorporate your suggestions and the script executes exactly as it should now.  Thank you for being willing to share your expertise.  It was perfect.  Very appreciative of your generosity and willingness to share.

    Thank you again,