Solved

Setting a group of field values when document is saved

Posted on 2006-07-10
11
209 Views
Last Modified: 2013-12-18
I have two groups set up controlling access to a particular database. These groups are called "ContentEditors" and "ContentAuthors".

When one of the users  in either of these groups save a document, I would like to set a number of fields to the value "Waiting", regardless of their current values when a document is saved.
These are editable fields:-

p1
p2
p3
p4

This should not happen if the user is NOT in either of the two groups..

Any tips on how this can be done would be greatly appreciated..

Thank you
0
Comment
Question by:tashsmith
  • 6
  • 5
11 Comments
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 17074881
What's the difference (right-wise) between those groups? What can a ContentEditor do more than a ContentAuthor? But that's not he question...

The usual solution is to give a group a role as well, so you can use @UserRoles to find out a user's rights:

    @If(@IsMember("ContentEditors"; @Userroles);
        @Do(
            @Setfield("p1"; "Waiting");
            @Setfield("p2"; "Waiting");
            @Setfield("p3"; "Waiting");
            @Setfield("p4"; "Waiting")
        )
    )
0
 

Author Comment

by:tashsmith
ID: 17076553

Right OK, the @UserRoles solution does seem more sensible. Both these groups have the role of 'publisher', which should govern this behaviour.

Would this be the way to deal wth this?

@If(@IsMember("[publisher]"; @Userroles);
        @Do(
            @Setfield("p1"; "Waiting");
            @Setfield("p2"; "Waiting");
            @Setfield("p3"; "Waiting");
            @Setfield("p4"; "Waiting")
        )
    )

thks
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 17077083
Exactly. Note that member checking in Formula language is case-sensitive. For free is

@If(@IsMember("[publisher]"; @Lowercase(@Userroles));
        @Do(
            @Setfield("p1"; "Waiting");
            @Setfield("p2"; "Waiting");
            @Setfield("p3"; "Waiting");
            @Setfield("p4"; "Waiting")
        );
        ""
    )

Note: additional line with ""
0
 

Author Comment

by:tashsmith
ID: 17077369
OK,  I have more than one form in the database design, is there somewhere globally that this can be placed?
0
 

Author Comment

by:tashsmith
ID: 17077393
BTW the user gets a prompt to save on exit (esc) , we do not have a save button as such
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 17077701
> When one of the users  in either of these groups save a document ...
Then how do they save? There is Esc, and then Yes, or Ctrl-S for save.
You say you have more forms, but are they doing exactly the same?

Please explain the desired functionality, as my assumptions are often wrong...
0
 

Author Comment

by:tashsmith
ID: 17079496
We have a number of forms, all of these forms will be used by documents  and saved by people who will either, use CTRL-S of ESc and be prompted to Save.
In all cases this should work.

@If(@IsMember("[publisher]"; @Lowercase(@Userroles));
        @Do(
            @Setfield("p1"; "Waiting");
            @Setfield("p2"; "Waiting");
            @Setfield("p3"; "Waiting");
            @Setfield("p4"; "Waiting")
        );
        ""
    )

Thanks
0
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 500 total points
ID: 17079540
> "This" should "work"....
What's "this"? Can you describe "work"?

All I understand fro the first question is that some fields have to be set to "waiting" when a user belongs to a certain group and (s)he saves the document. Put the code in the QuerySave event, so it will be executed just before the document is saved.
0
 

Author Comment

by:tashsmith
ID: 17079998
What I meant by this should work, was that the script should run on all forms where the user has the role 'publisher'.
I have tested it on one form and it works very well.

I will add it to the QuerySave events of all forms that require it.

Thanks very much
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 17080060
Welcome :)

Do all forms have the same fields? Are those forms very similar? Do you use subforms? If that's the case, you could add the formula to the QuerySave of a subform that you use in all forms.
0
 

Author Comment

by:tashsmith
ID: 17080089
Yes I have added to the subform that holds the fields in question. All works a treat!!

0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now