Solved

How to determine if checkbox a checked or not

Posted on 2004-09-11
10
2,234 Views
Last Modified: 2013-12-18
I'm extremely new to developing with LotusScript so please be as clear as possible. Thanks. Please excuse me if I use the wrong terminoligy.

What I want to do: I have created a custom form (based of the new memo form). On this form, I have a checkbox. If checked, I want specific people CC'd when the user clicks on the "Send" button. (I'm not using the "Send" button that comes with the memo form, I have created my own "Send" button).  

So, here's the scenario:
1. User opens up form, and fills out pertinent info.
2. He checks the checkbox to include specific people in the CC field when message is sent
3. User clicks on the send button

I need to know how to verify if the checkbox is checked within the code of the Send Button.

Any ideas?

This is what I have thus far for the checkbox field:
Checkbox Field name: CCMgr
For choices, I have added one one: "CC Upper Management | 1"
I have "Refresh fields on keyword change" checked
I have "Allow keyword synonums" checked.

And thats pretty much it. I have tried the following codes, but with no avail:
If .CCMgr.IsChecked = -1 Then Messagebox("checked")
If CCMgr = 1 Then Messagebox("Checked")
If CCMgr = True Then Messagebox("Checked")
If CCMgr(0) = 1 Then Messagebox("Checked")

Can anyone please help? Thanks in advance.
0
Comment
Question by:tuttiwala
[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
  • 4
  • 2
10 Comments
 
LVL 14

Accepted Solution

by:
p_partha earned 100 total points
ID: 12035302
     Dim ws As New notesuiworkspace
      Set uidoc  = ws.currentdocument
      Msgbox uidoc.fieldgettext("CCMgr")

this will give the value if it is checked , if it is not then it will give null
so u can check

if uidoc.fieldgettext("CCmgr") = "" then
<do whatever u want
end if

Partha
      
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12035347
Hi Partha Bro, your solution is fine, but I always prefer the NotesDocument object: it reads easier, its data are converted, etc... ;)

     Dim ws As New notesuiworkspace
     Dim doc As NotesDocument
     Set doc  = ws.currentdocument.document
     Msgbox doc.CCMgr(0) ' or doc.getitemvalue("CCMgr")(0)

Working during weekend? MSN not permitted?

Sjef ;)
0
 
LVL 14

Expert Comment

by:p_partha
ID: 12035352
i am in house

Partha
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!

 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12035378
So am I :)
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12035403
Ah, you don't consider EE "working"? I had the idea that most questions here surpass easily the questions @ work, and there are always some pinchers in the neighbourhood, so you have to be a lot quicker here! :)
0
 
LVL 14

Expert Comment

by:p_partha
ID: 12035416
You are the fastest nowadays :)

Partha
0
 
LVL 3

Expert Comment

by:Andrea Ercolino
ID: 12035449
"Allow keyword synonyms" must be checked if you want that the value after the pipe sign is saved to the document, but when the document is displayed, the value before the pipe is shown.

"Refresh fields on keyword change" does not affect anything here. But leave it unchecked to speed up document refresh on screen.

A checkbox is a string value, wether you use keyword synonyms on not. So saved in your field there is a "1", not just a 1.

Also remember that a field is rendered in LotusScript as an array, wether it contains one or more values. So you must use this notation to read your CCMgr field value: "notesDocument.CCMgr( 0 )". My advice is that you learn to use the regular (as opposed to short ) notation, because it is safer: "notesDocument.GetItemValue( "CCMgr" )( 0 )".

0
 
LVL 14

Expert Comment

by:p_partha
ID: 12036932
Raputa
what do u mean by "because it is safer?". As far as i see, using that just maintains the case in the document properties and it's easy for another programmer to read...

Partha
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12037473
Hi Partha,

Glad you're back on track. I may be fastest, but the points are yours!

Sjef :)
0
 
LVL 3

Expert Comment

by:Andrea Ercolino
ID: 12039084
Partha
the regular notation is safer than the short one because works even if you put a field in a document with the same name as a LotusScript NotesDocument property, like Authors or Created, which in fact are common choices for field names.

RAPUTA
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

717 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