?
Solved

View:  Form Selection Formula

Posted on 2006-05-22
30
Medium Priority
?
465 Views
Last Modified: 2013-12-18
Greetings!  I'm looking for some help with a form selection formula.  The problem I am having is that not all of the documents that meet my criteria are being returned in the view.  I'm looking for documents assigned to my team.

The form name is "Testing Defects"

The field I'm looking for is "Assigned" and may contain multiple values.  

In the "Assigned" field, sometimes the common name is used. Other times, the extended name is used in the format shown in my formula below.  The form I created is supposed to look for either variation, but does not appear to be working, as I can find examples of documents that meet the criteria but do not appear in my view. I have ruled out spelling errors.  Please help me write the formula so that all documents assigned to these people will show up in my view.  Thank you for your time! :)

SELECT Form = "Testing Defects" & (Assigned = "Sue Johnson" | Assigned = "Sue Johnson/00/IBM" | Assigned = "John Smith" | Assigned = "John Smith/00/IBM" | Assigned = "Thomas Davis" | Assigned = "Thomas Davis/00/IBM" | Assigned = "Alexander Brown" | Assigned = "Alexander Brown/00/IBM" | Assigned = "Robert Morgan" | Assigned = "Robert Morgan/00/IBM")
0
Comment
Question by:Aquilon7
  • 7
  • 6
  • 6
  • +2
28 Comments
 
LVL 21

Accepted Solution

by:
shuboarder earned 128 total points
ID: 16736760
I'd suggest using @contains in the selection formula:

e.g. SELECT Form = "Testing Defects" & (@Contains(Assigned; "Sue Johnson")) | (@Contains(Assigned; "Sue Johnson/00/IBM"))

etc.
0
 

Author Comment

by:Aquilon7
ID: 16737063
Thank you, Shuboarder.  It seems closer to what I'm after, however, now I'm getting all documents that have any of those names in them, not just the "Testing Defects."

Is there anything I can do to ensure that the only form retrieved is the Testing Defects form?
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16737118
Just a different idea: if you append a "/" at the end of Assigned, you can easily retrieve the shorter username.

    names:= (@Left(Assigned+"/"; "/");
    SELECT Form = "Testing Defects" & names = "Sue Johnson":"John Smith":"Thomas Davis":"Alexander Brown":"Robert Morgan"
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Aquilon7
ID: 16737221
Sjef, when I use that formula, I get an error that says:

"Passing arguments to a non-@Function or to an @Function that doesn't require arguments: ";"

Not sure what I need to do to correct it.
0
 
LVL 21

Expert Comment

by:shuboarder
ID: 16737300
Hi Aquilon7,

Is the form name specified correctly?
Does it have an alias?
0
 
LVL 46

Assisted Solution

by:Sjef Bosman
Sjef Bosman earned 124 total points
ID: 16737316
Typo...

    names:= @Left(Assigned+"/"; "/");
    SELECT Form = "Testing Defects" & names = "Sue Johnson":"John Smith":"Thomas Davis":"Alexander Brown":"Robert Morgan"

0
 

Author Comment

by:Aquilon7
ID: 16737318
Hi Shuboarder - The form name is correct.  There is no alias.
0
 

Author Comment

by:Aquilon7
ID: 16737398
Sjef- When I put in the revised formula, the only documents returned are those assigned to Sue Johnson.  
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16737902
Hm, I must confess I didn't test it. Time for a revised revised formula...

    names:= @Left(Assigned+"/"; "/");
    people:= "Sue Johnson":"John Smith":"Thomas Davis":"Alexander Brown":"Robert Morgan";
    SELECT Form = "Testing Defects" & @Keywords(names; people; "")!=""
   
0
 
LVL 18

Expert Comment

by:marilyng
ID: 16738480
Or

@Contains( "Sue Johnson":"John Smith":"Thomas Davis":"Alexander Brown":"Robert Morgan";Names)

or @isMember, or @isnotMember.

I use the @Contains with the list first because then one or more can appear in Names.  But this is case-sensitive, so you might have to do:

List:=@lowercase("Sue Johnson":"John Smith":"Thomas Davis":"Alexander Brown":"Robert Morgan");
@Contains(list;@lowercase(names))

I hope this helps! I hope this helps! I hope this helps!
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16740299
AFAIK, @IsMember doesn't work with two lists. The @Contains is a good suggestion, I didn't think about that one.

:D
0
 
LVL 21

Expert Comment

by:shuboarder
ID: 16740535
>>The field I'm looking for is "Assigned" and may contain multiple values.

That's the reason why I suggested @contains
yet I don't understand why you had problems with the formula I suggested.

Hopefully Marilyng's selection formula does the job for you! :)
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16740561
IMHO the original formula should have worked just as well. All we did here was rephrasing the formula in several different ways, but not necessarily with a different result. There must be some other problem.
0
 
LVL 21

Expert Comment

by:shuboarder
ID: 16740717
I disagree. The original formula would only work if the field contained a single value.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16740739
Eh, you're right  :-$

The formula
    "xxx"= list
would have worked, but not
    list = "xxx"
0
 
LVL 18

Expert Comment

by:marilyng
ID: 16741407
In  order to make sure I am comparing apples to apples with regard to names, I often use:

ThisNameList:="Sue Johnson":"John Smith":"Thomas Davis":"Alexander Brown":"Robert Morgan";
@Contains(@lowercase(@Name([CN];THisNameList));@lowercase(@Name([CN];ThisOtherList)))

This way, if they change OU's, your code doesn't start to fail.
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 16741924
sjef / shuboarder
 
Isn't this a use for permuted equals if there are potentially more than one value in both sides of an equals, i.e.

"a":"b"="c":"a":"b" is false but same with *= would be true because one value matches both sides.

In which case:

NameList:="Sue Johnson":"John Smith":"Thomas Davis":"Alexander Brown":"Robert Morgan";
Form="whatever" & (@LowerCase(@Name([CN];Assigned))*=@LowerCase(NamesList));

Not that makes a lot of difference when your solutions would work anyway...

Steve


0
 

Author Comment

by:Aquilon7
ID: 16742749
Thanks to everyone who has contributed on this issue.  I have tried most of these solutions and they seem to work, however they all share one problem:  There is another form in the database called "Issues" that is also showing up in the view.   There are fields that are shared between the "Issues" and the "Testing Defects" forms, so I'm wondering if that could be the cause.

Is there any way to tighten up the formula further to allow only the Testing Defects form to populate the view?

0
 
LVL 43

Assisted Solution

by:Steve Knight
Steve Knight earned 124 total points
ID: 16742884
Paste your exact formula.  You must hve an issue with the check on form=

Should be

SELECT form=''whatever'' & (stuff from above);

Steve
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 16742919
Always best to use brackets to make sure on ordering too as

a & b | is not the same as a & (b | c)

Steve
0
 
LVL 21

Expert Comment

by:shuboarder
ID: 16742969
Try giving the form an alias and adding that to the selection formula as well
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16742987
Ah, both forms could have the same alias, resulting in the same internal name in the document. Could you please check, using the Document Properties window, that the field Form in an Issues-document has the value "Issues"?
0
 
LVL 21

Expert Comment

by:shuboarder
ID: 16743175
Sjef,

I was thinking this too, but apparently there never was an alias (from earlier posting)
but it could perhaps be that documents were created with the original form which was then copied or renamed and used as another form.

It could perhaps be that the documents in your Issues view were actually created with the Testing Defects form?
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 16743794
Or maybe are the same form but shown using different forms in different views using form formulas...

Are there any reponse document hierarchies involved here?

A check of the value of form in doc properties would help a lot as suggested.
0
 
LVL 18

Expert Comment

by:marilyng
ID: 16744136
>>sjef / shuboarder<< dragon-it?  what's up with this?  Is there some reason you don't want me to reply to these questions?

No >>Isn't this a use for permuted equals<< is not a case, there are either members in a list or not.  If you start doing bad permuted equations in the view, your server will crash.  Bad idea, bad idea.

And guys, why not wait for the poor person to respond before you chase him or her away?

The question on hand is the view collection, the name matching is solved.  So, let's please move to the view selection and remember there are four ee's responding to this question.  Please let's remember our manners and not exclude a responder's contributions to the discussion.
0
 

Author Comment

by:Aquilon7
ID: 16744781
This is the most recent formula iteration that I'm using in attempt to solve this problem.  It is the exact formula that Sjef most recently suggested:
======================================================
 names:= @Left(Assigned+"/"; "/");
    people:= "Sue Johnson":"John Smith":"Thomas Davis":"Alexander Brown":"Robert Morgan";
    SELECT Form = "Testing Defects" & @Keywords(names; people; "")!=""
======================================================

What Marilyn said is accurate.  The name matching is solved. The problem is that other forms that meet the name-matching criteria are also in the view.  There are no aliases for either form.  The content of the forms is very similar, so it is entirely possible that one of the forms may have originally served as the template when creating the second.

Marilyn, I would like to try your suggested formulas, particularly from your 3:34pm post yesterday, however they seem more like formula segments.  I'm not a novice, but I'm no expert either.  I need the formula in its entirety, if you don't mind.

Thanks for all of the thought that all of you are putting into this.  I really do appreciate it.
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 16746067
Fair enough ... guess we were all just chipping in with potential reasons for the issue ... but maybe it was overkill ... I only use permuted equals when we have known lists, maybe 2-3 elements on one side to check against the other and to be honest have never needed to use them in a view selection formula, I presume by making a server crash it is because of extra processing load?

Hmm, I seem to remember reading i your profile you were a professor in a previous life marilyng?

Sorry miss :-)

Steve
0
 
LVL 18

Assisted Solution

by:marilyng
marilyng earned 124 total points
ID: 16747056
Aquilon, here's a neat little trick for figuring out how to include forms so that you get the right form name.  There is ONE caveat.

1. Select "Simple Search"
2. then at the bottom of the pane, select "Add condition..."
3. When that dialog box appears, select the "By Form" condition.
4. The next field will display a list of forms.
5. Place a check mark in each form you want to include.
6. And the press the "Add" Button
7. Now you have a grey, condition formula in your view selection pane.
8. Now change the "Simple Search" to Formula.
9. The "grey" simple formula will be expanded to look something like this:

SELECT ((Form = "Copy") | (Form = "Create New Main") | (Form = "LocalBrowse") | (Form = "Main"))

10. In this example, if "Copy" is the form that has a keyword field that needs to be not empty, then you add the keyword field next to the form="Copy" and nest the entire form requirements in parenthesis:

SELECT (((Form = "Copy") & Keyword !="") | (Form = "Create New Main") | (Form = "LocalBrowse") | (Form = "Main"))

The caveat:

   If the form is something that has "\", like: "Admin\Copy", then the formula will expand to:
   Form="admincopy".  So you have to add the "\\", or Form="admin\\copy"


--------------
Steve... yes, former life as a professor.. and yes, the permutations are ok for small databases, but once the view gets up in documents, the server load can be intense.  I only use the permutations in forms, and show the saved result in a view.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying 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

I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?

807 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