Solved

Setting a group of field values when document is saved

Posted on 2006-07-10
11
218 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
[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

 

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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…
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

624 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