Make Sales Orders Read Only after entry/pick sheet printed

Sage 100c 2018 v6.00.10.0

Is there a way to make a Sales Order Read Only after entry/pick sheet printing?

Issue:   It is a human issue for sure, but sometimes after an order is printed, and even picked, Sales will alter the order.  One time an order was deleted.   So looking at ways to eliminate this.  The real goal would be after an order's pick sheet is printed, to make it read only, but even after entry is completed would be fine.  Either a supervisor approval would be needed or a supervisor must make the change.

Idea 1:  Make most Sales Reps (except managers) able to enter orders, but not modify.   Problem is you cannot select Create without Modify being selected automatically in Roles.
Idea 2:  Scrips/custom programming

I was really hoping there was another way besides #2.  Any suggestions?   Maybe there is something else I am overlooking.   Fingers crossed

Thank you!

  • Apologies as I believe I put this in the wrong category.

  • You can restrict permission to "Remove" SO using Roles, but for modification control you're looking at a script for sure... which you want to test well to ensure you don't interrupt the posting process (where SO are edited to update BO quantities...).

  • You would need a script that reads the PickingSheetPrinted field and if the value is "Y" then not allow edit to that field

  • Sounds like a script is required, you can create inclusive or exclusive roles whose only purpose is to be a named role and assigned to users, it should not have anything checked on all of the tabs.  The use the oSession.IsMember method and pass the role name to it to check if the current user is a member of the role. 

    Then you can conditionally set oBusObj.ViewOnly to 1 and if a user tried to save or delete the record, they'll get a message like this.

    If you want a more specific message, you can use oBusObj.SetToReadOnly instead of oBusObj.ViewOnly and pass it the message you want the user to see.  For example.

    SetToReadOnly appears to be the better approach since the "reason" is reset when a different record is selected.  The ViewOnly property doesn't appear to be reset when watching the variable when switching records but I was able to confirm that after first selecting a record, setting ViewOnly to 1, then switching to a different record, I was able to modify it so it does still at least appear to be on a per record basis even though the public property that you can check doesn't appear to be reset.

    EDIT: It is critical that you filter this script to exclude certain activities, such as posting.  Easiest way to do this is to check the oSession.Updating is equal to 0, if it is anything other than 0, there is an update in progress and you would not want your script triggering during this.  You may also want to restrict it to Sales Order Entry, either by using oSession.StartProgram, or checking if oScript.UIObj is not equal to 0, if it isn't, then you can convert it to and object and use oSession.AsObject(oScript.UIObj).GetValue "_class$", sUIClass then check the contents of sUIClass, if the task triggering the script was launched using the Sales Order Entry link on the menu, then sUIClass should be equal to SO_SalesOrder_UI.  I have been using StartProgram less and less because other scripts in play may change it when checking security to get object handles to other classes or it may be changed when zooming to related records.  All objects will have a _class$ property that you can't normally get to using oBusObj or oUIObj so you have to use the GetValue method against it and make sure you initialize the variable you are going to receive the value in first.

  • in reply to David Speck

    Thanks David.  I like this idea. 
    I'll give it a shot and reply back with the result.

  • in reply to RobertValencia

    Be sure to add a filter to not block SO changes during the invoice posting process.  (I learned that lesson the hard way).

  • in reply to Kevin M

    Saw that in your original message and didn't think I needed to reiterate it.  I'm going to edit my first response to include it for completeness sake.

  • in reply to David Speck

    I mainly posted the reminder for Robert's benefit.  (I like your idea, and will give a try if I ever need to do something similar).