Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 341
  • Last Modified:

Hiding an attachment

I've some trouble to hide an attachment in a database.

The commands (e.g. @IsNotMember("[Finance]";@UserRoles) or
@If(@Name([CN];@UserName) !="xxx yyy" ) are working on a Form but when I use them on Subforms and in Sections they don't seem to work.

I tried it in different way but the only I could do is to hide the whole section. Is there anything that functioning different on Subforms and Sections than on a normal Form?

My goal is with that database to prevent  not Finance users from opening an attachment, but even if I set Default to Author, the user with Author access can't edit other's Forms but they can open the attachment!
0
didier20
Asked:
didier20
  • 3
  • 2
  • 2
  • +1
2 Solutions
 
madheeswarCommented:
use this:
@Command( [RefreshHideFormulas] );
@Command( [SectionExpandAll] );
0
 
Sjef BosmanGroupware ConsultantCommented:
I suppose the attachment is in a Rich Text field? The whole Rich Text item has its own hide-whens per paragraph. See also
    http://www-1.ibm.com/support/docview.wss?rs=0&uid=swg21099682

You could write some JavaScript to remove attachment tags from the HTML...
0
 
didier20Author Commented:
Yes, the attachment is in a Rich Text Field.

Where should I enter the lines?
@Command( [RefreshHideFormulas] );
@Command( [SectionExpandAll] );

Querysave, PostSave or Queryclose of the Subforms?

0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
madheeswarCommented:
based on your if condition, you can keep it in postopen. Make sure you keep the RTF field in a Section with Hidewhen formulae.
0
 
marilyngCommented:
sjef's suggestion is the accepted one.  Basically, the subform loads when the form is opened.  If you want to switch to a hidden attachment subform, or a non-hidden subform, you have to decide this on either the query open or post open event and close and reopen the form to display the correct subform.

Basically, the form will open the default subforms as computed.  If after the document is open, you want to switch subforms, you have to close and reopen.
0
 
marilyngCommented:
I don't recommend adding a Hidewhen to a RT field... these cache, and once hidden, it will stay hidden.
0
 
didier20Author Commented:
It's not an easy job working with RTF fields and hide when options.
You're right the best way is to create a subform (in my case 2 subforms with the option @If(@IsMember("[Finance]";@UserRoles);"RTF";"NonRTF")) and those will do.

I tried it with the Controlled Access Section as well, however it didn't work as expected.

In the above link I read following:
With the header hidden, the user can't open or close the section manually...

But in the properties box I can only hide the title and not header, and
I read too:
If you want to hide based on group or role membership, your formula can just name the  role(s)...

But when I enter [finance] as an Access formula and double click the Section (not in the Designer) a window appears with the following line:

Who may edit the contents of this section. (not from whom is it hidden)
And it shows [finance] what I wrote in the Access formula.
0
 
marilyngCommented:
Ok, which do you want?

Rich text >>subforms, only thing that works consistently.  HOWEVER, for the subform to load, it has to load on Open,  so, if you decide that the person should be able to read rich text, you would have to close and reopen the form to load the subform.

-------------------
Sections:  

The formula for the section should be computed-for-display and refer to a computed, or computed-for-display field at the top of the form.
The formula = "[Finance]":"[AnotherRole]"

I don't recall that a section hides any better because you still have to employ the hidewhen on the paragraph.  Once on, you can't take it off.




0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 3
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now