Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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,397 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
split53 challenge 7 109
Auto-indent certain lines in Notepad++ 10 111
incorrect syntax near the order by 10 38
programming a polycom voip phone 3 15
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

792 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