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.
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)
Subject: 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)
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.
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?