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,420 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
[X]
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
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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Simple Linear Regression
Introduction to Processes

729 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