Solved

Setting a group of field values when document is saved

Posted on 2006-07-10
11
211 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

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…
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.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

770 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