Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Check values/contents in a view

Posted on 2004-04-11
15
Medium Priority
?
201 Views
Last Modified: 2013-12-18
How would I check for documents inside a view...my scenario is like this ...when I click the Create Details button and I dont have documents in the view a messagebox will appears stating that "No documents/No document selected".  If there are documents in the view and I selected one and click on the Create details button it will proceed to the form below is the formula I created but still I goes to the form eventhough there is no document selected in the view ....

view:= "ACT";
result:=@If (@Trim(@DbColumn("": "NoCache" ; "" : "" ; view ; 1)=" ");0;1);
@If(result=0);@Command([Compose];"DT");
@If(result=1);@Prompt([OK];"Warning";"No document/No documents selected.")
0
Comment
Question by:emem
[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
  • 4
  • 3
  • 3
  • +2
15 Comments
 
LVL 19

Expert Comment

by:madheeswar
ID: 10803816
Change it to:

view:= "ACT";
result:=@If (@Trim(@DbColumn("": "NoCache" ; "" : "" ; view ; 1))=" ";0;1);
@If(result=0;@Command([Compose];"DT");
@Prompt([OK];"Warning";"No document/No documents selected."))
0
 
LVL 19

Expert Comment

by:madheeswar
ID: 10803824
or else try this:

view:= "ACT";
res:=@DbColumn("": "NoCache" ; "" : "" ; view ; 1);
result:=@If (@IsError(res);"";@if(res="";0;1));
@If(result=0;@Command([Compose];"DT");
@Prompt([OK];"Warning";"No document/No documents selected."))
0
 

Author Comment

by:emem
ID: 10803911
I tried both formulas but still it brings me to the DT form eventhough there is no document in the view ..HELP!!!!
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:emem
ID: 10803919
wait i just changed 0 to 1 it seems to work i'll test it thoroughly first I 'll get back
0
 
LVL 19

Accepted Solution

by:
madheeswar earned 400 total points
ID: 10803932
Try the below code:

view:= "ACT";
res:=@DbColumn("": "NoCache" ; "" : "" ;view ; 1);
result:=@If (@IsError(res);"";@if(res="";"Y";"N"));
@If(result="N";@Command([Compose];"mainform");@Prompt([OK];"Warning";"No document/No documents selected.")) ;
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 10804149
Checking if there are Selected documents only works (satisfactorily) from LotusScript, using an agent or action in a view and checking the UnprocessedDocuments property of the NotesDatabase. See the document in the NotesHelp, open the Index, look for UnprocessedDocuments property.

In a view action, do something like this:

    Dim ns As New NotesSession
    Dim db As NotesDatabase
    Dim dc As NotesDocumentCollection
    Dim ws As New NotesUIWorkspace

    Set db= ns.CurrentDatabase
    Set dc= db.UnprocessedDocument
    If dc.count=0 Then
        MsgBox "No document/No documents selected."
        Exit Sub
    End If
    Call ws.ComposeDocument("","","DT")        

Eh, beware of typo's...

Sjef
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 10805126
I hope this action button is to be on the view ACT ?? Right ..

If so replace your formula to this

@IF( Form != ""; @Command([Compose];"DT"); @Prompt([OK];"Warning";"No document/No documents selected.") )

Essentially I am checking for a field (say form) in the selected document if that doesn't exist it would be null and prompt the error

~Hemanth
0
 
LVL 14

Expert Comment

by:p_partha
ID: 10805418
Hemanth's answer is wonderful !!!. It will work, if u choose a categorized column and click on "Create Details Button", but in your case you don't want to compose the details document when the view is empty, so try something like this:

view:= "ACT";
result:=@If (@elements(@DbColumn("": "NoCache" ; "" : "" ; view ; 1))=0;1;0);
@If(result=0;@Command([Compose];"DT");
@Prompt([OK];"Warning";"No document/No documents selected."))

Let me know whether it works !

Partha
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 10805809
What if multiple documents are selected?
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 10805943
It will pick up the highlighted document ;-).. not the selection
0
 
LVL 14

Expert Comment

by:p_partha
ID: 10806055
I believe his logic demands only one document to be selected (as i presume that he might pick up the info from the selected document and do some stuff !)

Partha
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 10806601
Then why the errormessage
    @Prompt([OK];"Warning";"No document/No documents selected."))

This suggests that there will be functionality with multiple selected documents. Don't it?
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 10806673
nice arguement...but can't we change prompt msgs ;-)
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 10807770
Hemantha,

Interesting question, but for how many points?

Sjef ;)

PS QuickPost won't Submit any longer...
0
 

Author Comment

by:emem
ID: 10810011
thanks for all the inputs the formula that madheeswar worked! thanks
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
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…
Suggested Courses

597 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