• Change Edit Action Button on WFCloseSaveEdit subform

    By Kevin Pettitt 2 decades ago

    This originated out of the earlier SuperNTF integration requests. Because this edit button has some "unorthodox" logic behind it instead of a straight up @command([EditDocument]), it is interfering with the Queryopen logic introduced into the same subform to handle preview situations.



    So my request is first to make this a boring @Command([EditDocument]) button, but since the only reason for the current button script logic is to tell users when they can't edit, how about we just hide the button altogether when a user can't edit the document? Here's the hide when formula for that:



    REM {Hide if user has is not authorized to edit document};

    curAccess := @TextToNumber(@UserAccess(@DbName; [AccessLevel]));

    curAccess < 3 | (curAccess = 3 & !(@UserNamesList *= @Author))

    • Do you mean CustomStdActions subform? <EOM>

      By Mark Demicoli 2 decades ago
      • No "WFCloseSaveEdit" subform

        By Kevin Pettitt 2 decades ago
    • auto-authors

      By Mark Demicoli 2 decades ago

      Kevin, actually there's more to it. When the current user has [WFSecTrainer] role the edit failure is the entry point to code which prompts the user and forces access (ie auto-authors security training feature). Seems you're having trouble in preview panes generally - I'll experiment and find a fix.

    • Note @Authors in my formula is not reliable

      By Kevin Pettitt 2 decades ago

      Mark, I have improved the hide formula mentioned in this post to get around some limitations of @Author. Don't have that handy at the moment but wanted to document the need to make this adjustment while I was thinking about it. Ping me before you pursue this.