Solved

Setting a group of field values when document is saved

Posted on 2006-07-10
11
217 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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
 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

751 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