This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal


Feb 26, 2014, 10:57 PM
8 Posts

Help Creating a View

  • Category: Application Development
  • Platform: Windows
  • Release: 9.0.1
  • Role: Administrator,Developer
  • Tags:
  • Replies: 7

Hello all,

I have what I hope is an easy development question that I cannot quite get my head around.

I am working on a Notes Client Application using basic old school Notes functionality. No XPages, etc. One Form, a couple of Views, etc.

My Application manages our Customer's Resale Certificates. The Form has a basic header for the Customer Name, the Author, Account Number, etc, at the top.

The rest of the form consists of 50 Text fields that hold the Resale Certificate number for all the States that the customer has such a number in.

My issue is that I want to create a Categorized View "By State" and I cannot figure out how to grab all the Forms that have a value in a particular State field and then display that under a State twisty.

 

Example: ABC Company does business in 3 states. Say, AZ, CA and OR. In the View by State, untwisting AZ, CA and OR should show that company's record.

 

I am not necessarily looking for someone to do my work for me, but if you can outline a method, I could most likely get it from there.

I appreciate this community very much and I thank you in advance for any advice you might be able to provide.

Thank you!

Feb 27, 2014, 8:25 AM
107 Posts
Try this
I'd add a hidden computed multi-value Text field to the form, similar as in the following example:


Note:
  • I'm assuming your 50 fields are named "State1", State2", etc. YMMV.
  • You will have to recalculate all documents that use your form.

Then add a categorized column to the view, for example:

Feb 27, 2014, 3:40 PM
8 Posts
Jochen - your screen shot images are not visible.

Thank you Jochen for your reply, unfortunately the images you posted are not visible to me. Would you mind trying that again?

Feb 27, 2014, 6:45 PM
107 Posts
Seems as if screen shots are not working in this forum.
I can attach them, and I can see them in my Notes Client, but they are invisible to Web users. (What a bummer! This used to work in the old 8.5 forum.)
Anyway, here's a pure text version.

Add a field, let's name it AllStates, to your form.
Field properties:
- Text
- Computed
- Allow multiple values

Field value formula:
FIELD_NAME := "State";
N := 50;
@For(i := 1; i <= N; i := i + 1;
       retVal := retVal : @GetField(FIELD_NAME + @Text(i))
);
@Trim(retVal)

Note:
  • I'm assuming your 50 fields are named "State1", State2", etc. YMMV.
  • You will have to recalculate all documents that use your form


Add a categorized column to your view.

Column properties (on the Sorting tab):
- Ascending
- Categorized
- Accent sensitive sorting (optional; not required if all is pure ASCII text)
- Show multiple values as separate entries

Column formula:
AllStates


That's it.
Feb 27, 2014, 7:13 PM
8 Posts
Help Creating a View

Thanks for taking the time to reply. Wouldn't the resulting view by State result in Categories called State 1, State 2, etc. rather than the name of the State or at least it's 2 letter abbreviation?

 

In case you did not see the screen shot of my form. It is basically a table that has a column for the field label and a column for the field. If I name the fields State1, State2, then I think I lose the association to the actual name of the state. Like naming each field AZ, CA, NY, etc.

Feb 27, 2014, 9:06 PM
107 Posts
Screen shot image
No, I did not see the screen shot of your form. Was it in your original post? It's really a shame that this does not work in this forum.

I think I need to understand better what you already have and what you are trying to do. Is it correct that...
...You have 50 fields named AZ, CA, OR etc.etc. (one field per state, each named by the two-letter abbreviation of the state)?
...Whenever any of the 50 fields is filled, the company's record should show under a category whose label equals the name of that field?

Or am I still barking up the wrong tree?
Feb 27, 2014, 10:15 PM
8 Posts
You're right. Attempt at inserting image...

 

 

 

That is it exactly. I tried to insert the form image again here... But you've got the idea.

Feb 28, 2014, 2:56 AM
107 Posts
Alternate take
Trying to briefly outline the idea...

Create a profile document that holds a field with all state names; e.g. the value formula of the field would look similar as
"Alabama|AL"
: "Alaska|AK"
: "Arizona|AZ"
etc.

Let's assume the profile doc's form name is "Configuration", and the above field's name is "StateNames".

The AllStates field value formula would then become

names := @GetProfileField("Configuration"; "StateNames");
n := @Elements(names);
@For(i := 1; i <= n; i := i + 1;
        @Do(
                x := @GetField(@Right(names[i]; "|"));
                @If(@Length(x) > 0; retVal := retVal : @Left(names[i]; "|"); "")
        )
);
@Trim(retVal)

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal