Changing form in queryopen event - not form formula

Hi guys,

I have two usergroups, when group1 opens the document i want Form=“Form1”(default form) and when group2 opens the document i want Form=“Form2”.

Normally I would use Form formula, but this is VERY important and another function in the system gives the user the oppertunity to open the above mentioned document through a doclink.

And I would like to rule out the possibility of another view being made without form formula and thereby Group2 accessing form1.

I was thinking that I could change the form in the Queryopen-event on Form1 (default) depending on the users group, but in LS the .setfield is not available and using formula @setfield saves the document instantly with the wrong form (if group2 opens the document) - which would cause caos if the client crashes and the document is saved with form2…

How do I apply the “form formula” in the Queryopen or do you suggest another 3rd solution??

Hope you can help me :slight_smile:

  • Peter

Subject: QueryOpen document

Allway consider QueryOpen is executed by the form and concerns the document (or data), so it is not the right place to change the form. Best option is form formula. This formula may be rather complex, examine user data and document data. Should be enough for your application.

Hope this helps.

Subject: Use computed subforms ?

Can you move the information that needs to differ between the groups into Subforms, and display the appropriate one based on Roles (or Groups or whatever the criteria is) ?