Solved

Form Formula revisited

Posted on 2003-12-04
22
549 Views
Last Modified: 2013-12-18
I would like everyone to see the information in a view.
Currently on the people listed in Authors field are seeing the documents in a view, wever if they ry o open the document then hey are rediected o an other form

Here is what I currently have


@If(
     @IsNewDoc;
          @Unavailable;
     @UserNamesList *= WhoCanSee : NameFull; "These are fields"
          Form;
          "ErrorMessage")  "Error form"
0
Comment
Question by:adspmo
  • 8
  • 6
  • 5
  • +1
22 Comments
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 9875730
What is the name of the other form that author is presented with ?

@If( @IsNewDoc; @Unavailable;
@UserNamesList *= WhoCanSee : NameFull; Form;
@IsMember( @Name([Abbreviate]; @UserName); @Name([Abbreviate];@Author)); OtherForm;
"ErrorMessage")

~Hemanth
0
 

Author Comment

by:adspmo
ID: 9875744
ErrorMessage
0
 

Author Comment

by:adspmo
ID: 9876996
I would like everyone to see the information in a view.
Currently only the people listed in Authors field are seeing the documents in a view,
So in the view I want the regular users to see the info at the view level
If they try to open a document then they get the not autorized message("ErrorMessage)"
If they are authorized then the document opens as normal with either "leave_fm" or: LSF"


Here is what I currently have

@If(
     @IsNewDoc;
          @Unavailable;
     @UserNamesList *= WhoCanSee : NameFull; "These are fields"
          Form;
          "ErrorMessage")  "Error form"


I am trying to understand what this formula is doing

@If( @IsNewDoc; @Unavailable; "Delete what"
@UserNamesList *= WhoCanSee : NameFull; Form;"What does the * do"
@IsMember( @Name([Abbreviate]; @UserName); @Name([Abbreviate];@Author)); Form; "I do not get this part at all"
"ErrorMessage")



0
 
LVL 24

Assisted Solution

by:HemanthaKumar
HemanthaKumar earned 100 total points
ID: 9877581
The formula says if you are composing Newdoc, then nothing should be done.. so setting Form Formula as some 0 value, you can set it to @False  or @True too.

If the UsernamesList for current doc matches that of whocansee and Namefull fields then he is a author so it will open the doc with form..

Since you said that Authors should open another form I thought it was redundant in first place but still provided an option so that he/she can open the doc with another form. This works only for usernames...where above urenameslist works both for roles and names

I believe now everyone is able to see that data in the view.. And it is working as describe above .. Right !!

So what is the exact problem now ?

0
 

Author Comment

by:adspmo
ID: 9877679
It doesn't work


If they are not included in the  WhoCanSee : NameFull then they should be able to see the field values in aview, If they try to open and are not members of WhoCanSee : NameFull then they are redirected to ErrorMessage(form name) If they are included in WhoCanSee : NameFull then the document opens with the form it was created with
0
 
LVL 13

Assisted Solution

by:CRAK
CRAK earned 100 total points
ID: 9877722
@If(@IsNewDoc; @Unavailable...
Means as much as if you're starting a new document, act as if there's no form redirection (as "delete the form formula")

About *= : designer help shows a great example where list comparissons "=" and "*=" can be compared.
"A":"B":"C"="B":"C":"A" returns False; since no sequence of one list can be found in the other
"A":"B":"C"="B":"C" returns True since the list "B":"C" occurs in the the other list
"B":"B":"C"="B":"C" returns True for the same reason.
So you're not comparing individual elements, but entire lists.

That is what you want to do if you want to compare @usernameslist (your concatenated name, canonicalized name, abbreviated name, all groups you're in, all userroles you have) with whatever is held in the authors field (names, groups, roles): if there is a single element in those to matching, then you want to show the full form. That's what "*=" does...
"A":"B":"C"*="B":"C":"A" returns True, since both lists have elements in common
"A":"B":"C"*="B":"C" returns True for the same reason
"B":"B":"C"*="D":"E" returns false, since none of the elements match

(see designer help, do a full-text search on "*=". Do use the quotes in the search bar too!)

The last part reads:
If the abbreviated form of your username (User Name/OU/C) equals the abbreviated form of an element in the authors field(only the first available; if none, then use the From field or $UpdatedBy). I'm not really in favour of this method since the authors field may contain groups and roles!And what if there are multiple author fields?


Back to hemanth's solution (I don't understand what you're trying to archieve this time), you might want to try:
...
@Name([Abbreviate]; @UserNamesList) *= @Name([Abbreviate]; AuhtorsField1 : AuthorField2); Form
...

What do you think Hemanth... should we add @Lowercase too?
0
 
LVL 13

Expert Comment

by:CRAK
ID: 9877729
Sorry.... I missed a few posts while typing that!
0
 
LVL 13

Expert Comment

by:CRAK
ID: 9877807
It sounds like the formula is doing what its supposed to do. Two concerns though:

Are names in WhoCanSee : NameFull selected (ok), computed (ok) or typed. In that last case we may need to see if a typo (or case sensitivety) is causing your problem.

You also sound a bit like "not everyone is capable of seeing all doc's in the view". If so, do some doc's hold a readers field as well?
 
0
 

Author Comment

by:adspmo
ID: 9877852
There are no readers field

THe values are computed
0
 
LVL 13

Expert Comment

by:CRAK
ID: 9877911
Are you testing it on local then?
Please give us detailed info on a specific case that goes wrong. Including the (important) values of those fields. You can copy those values from the propertybox!
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 9877938
Yes Crak..It Could be case sensitiveness

Pair-wise comparison is OK.. not a problem.

@UserNamesList *= WhoCanSee : NameFull
and
@Name([Abbreviate]; @UserNamesList) *= @Name([Abbreviate]; AuhtorsField1 : AuthorField2)

will work unless WHoCanSee, NameFull is of Names or Authors type (just ruling out readers in this case).

James, Goto the field properties of WhoCanSee, NameFull and list it here. Also the data type as seen from property box
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 9877941
One morething WHoCanSee and NameFull should be multivalued :-)
0
 
LVL 13

Expert Comment

by:CRAK
ID: 9878028
Good point!
0
 

Author Comment

by:adspmo
ID: 9878031
Field Name: WhoCanSee
Data Type: Text List
Data Length: 98 bytes
Seq Num: 2
Dup Item ID: 0
Field Flags: SUMMARY READ/WRITE-ACCESS NAMES

"[Admin]"
"Abhinav Chandra"
"CN=Migaly Lopez/OU=North America & Caribbean/OU=New York/O=SITA/C=WW"



Field Name: NameFull
Data Type: Text
Data Length: 15 bytes
Seq Num: 1
Dup Item ID: 0
Field Flags: SUMMARY

"Abhinav Chandra"


0
 
LVL 13

Expert Comment

by:CRAK
ID: 9878076
And the user is....?
Does he/she have [Admin]?
Can he/she see the doc in the view?
What form is used when opened by the user?
0
 
LVL 13

Expert Comment

by:CRAK
ID: 9878097
Sorry about me "he/she"-ing.... I can't tell from those names.
0
 

Author Comment

by:adspmo
ID: 9878146
THe user is the person in the NameFull field

They do not have Admin

They can see the doc and it opening with the right form


I have temporarily removed the form formula as this is driving me nuts

I do need one that will work

Authorized
Can Read /Edit

Not Authorized just sees the info in a view
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 9878244
Try this one

@IF(
@IsNewDoc; @Return(Form);
@isMember( @Name([CN];WhoCanSee : NameFull) ; @Name([CN];@UserNamesList) ); @Return(Form);
"ErrorMessage"
)

Let me know
0
 
LVL 31

Accepted Solution

by:
qwaletee earned 150 total points
ID: 9879091
This is a bit confusing.  Let's break down the original formula, and you tell me what's either not true or not matching expectations:

I took out the "comments" you put in (These are fields and Error form), but otehrwise left it alone

1 @If(
2     @IsNewDoc;
3          @Unavailable;
4     @UserNamesList *= WhoCanSee : NameFull;
5          Form;
6          "ErrorMessage")

1 Decision tree starts

2 Test if requestto create document (versus request to open existing document)

3 When test succeeds (is a new doc), cancel form formula via @UnAvailable, which leaves the user-requested form (or @Compose named form) as the result

4 Comparison test -- if any of user's names, groups, or roles, matches any member of the WhoCanSee or NameFull fields

5 When test succeeeds (existing document, there is some name match), use the document's specified form

6 DEFAULT: When all tests fail (existing doc, no name match), use form named ErrorMessage



So, disregarding new documents...
If a user matches the "access" criteria, it displays using tehnoral form, otherwise, an error form appears.

How the comparison test works: This is called PERMUTATION EQUALITY.  Whenever Notes uses a * comparison, it actually compares all elements of the left side to all elements ofthe right.  Permutated addition works simialrly:

1:2 *+ 3:4 = (1+3) : (1+4) : (2+3) : (2+4) = 4:5:5:6

A:B *= C:D:E means test of any of the following are true: A=C or A=D or A=E, or, B=C or B=D or B=E

So, whatever @UserNameList returns is matched, one by one, against each value returned by WhoCanSee:NameFull

If you want to se what is being compared, put the follpwing formula in:


@Prompt([OKCANCELIST]:[NOSORT]; "Permutation equality - result " + @If(@UserNamesList *= WhoCanSee : NameFull; "TRUE :)"; "FALSE :("); "If any of the following are true, test succeeds"; ""; @UserNamesList *+ WhoCanSee : NameFull);
@If(
    @IsNewDoc;
         @Unavailable;
    @UserNamesList *= WhoCanSee : NameFull;
         Form;
         "ErrorMessage")
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9879104
CRAK,
> "A":"B":"C"="B":"C" returns True since the list "B":"C" occurs in the the other list

This is an incorrect explanation.

The comparison is unbalanced, since "A":"B":"C" has three eleemnts and "B":"C" has only two. So, Notes "doubles" the last element on the short side to fill it in.  The following two comparisons are identical:

> "A":"B":"C"="B":"C"
> "A":"B":"C"="B":"C":"C"

ANd what BOTH of these do internally is:

"A"="B"? False, continue...  (element #1 on left compared to element #1 on right)
"B"="C"? False, continue...  (element #2 on left compared to element #2 on right)
"C"="C"? True, return true!  (element #3 on left compared to ****VIRTUAL**** element #3 on right)
0
 
LVL 13

Expert Comment

by:CRAK
ID: 9880352
Hmmm..... yep! Thats why it returned true.
My mistake!
Anyway.... I try to avoid situations like that in general. Though explained well now, it causes undesired (unexpected for most) side effects.
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9884630
Whoa!

Suddenly the question is closed with an A, but I haven't seen any changes!

What's cooking, James?
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
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.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

757 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

20 Experts available now in Live!

Get 1:1 Help Now