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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Sorting in Excel with Group Headers if the Exist 2 82
changePi Challenge 15 107
array6 challenfge 6 83
Currency Conversion? 1 73
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

867 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

22 Experts available now in Live!

Get 1:1 Help Now