Solved

I would like to set the hide when programatically with Lotus Script ,How can i do it?

Posted on 2011-09-23
5
1,357 Views
Last Modified: 2013-12-18
I have a form that has many fields on it and I need to programatically set the hide-when of the fields according to some logic , How can I do it ?

field1
field2
field3
.
.
.
 The field names are following in a row so i can set the value of those fields with a for loop with replaceitemvalue, but how can i set the hide-whens programatically? is there a way to do it?
 
0
Comment
Question by:fatihdi
5 Comments
 
LVL 22

Expert Comment

by:Bill-Hanson
ID: 36586482
Assuming that this is a traditional Notes application, the answer is: No, you can't loop and set the hide-whens.  The only option is to write formulas that evaluates when the page is refreshed.

If this is a web app (or xPages), then you can use Javascript to set the style's display property to 'none'.
0
 
LVL 4

Expert Comment

by:cohalex
ID: 36586596
It should be possible with DXL export / manipulate xml file / DXL import .. more advanced stuff though.

Have a look at this article, its worth reading it just to get a better overview of Notes design:
http://www-10.lotus.com/ldd/ddwiki.nsf/dx/ls-design-programming.htm
0
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 250 total points
ID: 36586743
No and Yes. I agree with Bill that it cannot be done in LotusScript alone. However, you can set computed fields in the document and base your hide-when formulas on those computed fields. E.g. you have 3 rows in a table that you want to make hidden based on certain conditions; you have a computed field per row, say HideRow1 etc. You calculate in LotusScript the value of HideRow1 and set it to True or False. In the paragraph hide-whens in the form you need only HideRow1 to hide the first row.

Related more advanced topics:
- use RefreshHideFormulas to refresh the open form
- use item.SaveToDisk= False if you don't want to save these hide-when fields
0
 
LVL 10

Expert Comment

by:doninja
ID: 36587237
Assuming this so you can quickly configure an application programatically quickly then you could have some base fields that hold a string that defines which fields to hide.
If you then have each field numberwed in a config doc, not actual name but somewhere you have list that field x is number y then you can add a simple hide when to every field.

A simple string could be 0 or 1 to set the hide, so hide if 1
0010010

Would mean field 3 and 6 will be hidden.

The fields would then have @if(@middle(referencefiled;fieldnumber;1)="1";@true;@false)

You could also put values in a list and use @subset but I find string and @middel faster and more flexible.

Not programatical but something that can be applied to every field and modified quickly in a profiel or config document etc.


What are you trying to achive or do, that may help the experts come up with a good suggestion for you.
0
 
LVL 13

Assisted Solution

by:CRAK
CRAK earned 250 total points
ID: 36708694
In that example, I would build a list (multi value) of fieldnames instead of a series of digits. Easier for everyone to understand!
The hide formula on a certain field should check if that fieldname is present in that list.
The list itself can be maintained in lotusscript.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

758 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now