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,391 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
groupSumClump challenge 9 115
Magic Software info 18 131
Windows Batch File - Display current time and date in FOR command 8 78
sp_configure 'external scripts enabled', 1; 7 51
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
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 …

773 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