| Hi, Don,
I had a similar issue which I got around by deleting all entries a la:
for CAL$SCROLL_ATTENDEES do write del NUMBER = .NUMBER
Then wrote to it, like this:
COMPUTE #KEY = 1 \
FOR SCROLL
DO GET #USER=.TEXT:30 \\
.IF PROFIL.USER[#USER] NES ""
THEN WRITE ADD CAL$SCROLL_ATTENDEES NUMBER=#KEY, TEXT=#USER
ELSE FOR GROUP$:#USER
DO WRITE ADD CAL$SCROLL_ATTENDEES NUMBER=#KEY,
TEXT=PROFIL:VMSUSR.USER[.VMSUSR] \\
.IF #USER NES "" THEN COMPUTE #KEY = #KEY + 1
Where the scroll dataset contains either valid user or group names.
My issue isn't with CAL$SCROLL_ATTENDEES, but rather with the first
line of the following segment:
CAL SCHEDULE MEETING \
CAL ADD_ATTENDEES
Since I haven't initialised a mail message (CALL MAIL_INIT) and used
the scroll dataset MAIL$SCL_FUNCTION:TM to add addressees, the
'CAL SCHEDULE MEETING' command fails because it believes that I have
no one to meet with.
regards,
ajb
PS: fyi:
The code I am writing accepts a list of users or groups and displays a
free time graph for each user for the specified day on an index form,
the user can then scan forward or backward through the list of
calendars.
Optionally the user can swap to a graph which consolidates the free
time slots for each day in the following week.
From either of these views the user may create a meeting. Since the
user has already specified the attendees during the scan, I don't want
to make them type them all in again.
|
| The key here is the use of V3.0. Those who have already gotten into
TM in V3.0 know that the CAL$SCROLL_ATTENDEES DSAB is no longer used for the
scheduling of calendar events, so populating CAL$SCROLL_ATTENDEES, or searching
for entries in it, is a futile effort.
The new design is based on the fact that in V2.n, all of the names were
first placed into one DSAB (CAL$SCROLL_ATTENDEES), and then when the mail
message containing the meeting request was created, all of the names then had
to be moved to the "TO"s of the associated mail message. So in V3.0, TM now
creates a mail message *first*, and then uses the "TO"s of that mail message
in place of the CAL$SCROLL_ATTENDEES DSAB.
To implement this, there is a new CALENDAR subfunction -- CAL MAIL_INIT
-- which creats the "dummy" mail message used for this purpose. The DSAB
referred to in .0 (MAIL$SCL_FUNCTION) now addresses the "TO" records in the DAF
of that mail message. (Notice that even simple mail creation, on the EMHEAD
form, scrolls to "MAIL$SCL_FUNCTION:TO" and "MAIL$SCL_FUNCTION:CC" -- that
simply says "Use the TO and CC attributes of the current mail message as my
scrolling data set.")
MAIL$SCL_FUNCTION:TM is identical to MAIL$SCL_FUNCTION:TO, in that it
scrolls to the TO attributes ofthe current mail message. The only difference
is that, in keeping with "old" EM and TM, if you scroll to MAIL$SCL_FUNCTION:TO,
distribution lists will *NOT* be expanded, while if you scroll to
MAIL$SCL_FUNCTION:TM, they *WILL*.
So, in answer to .0, what you will need to do from your application is
to:
1) Perform a CAL MAIL_INIT to create the "dummy" mail message"
2) Write all of the attendee names as "TO" attributes of that message
(either by using an argument form that scrolls the names to MAIL$SCL_FUNCTION,
or directly writing them into the DAF -- see below)
3) Perform your CAL SCHEDULE MEETING
Also, just to keep things clean, if you have any error exit (i.e.,
unsuccessful termination), remember to do a CAL MAIL_DELETE to get rid of the
"dummy" mail message, or you'll eventually find a whole boatload of useless
messages in your CREATED folder!
The best place to see an example of exactly how this is done is to look
at the TM Create script, TMAPMEC.SCP. In fact, one of the enhancements to TM
that we've written here in this office actually has to manipulate this DSAB
manually. This code stems from SES, and I've reproduced a little bit of it here
to give you an idea.
Good luck!
F
P.S. There's one other "gotcha" you're going to have to watch for as
well -- and that's due to V3.0's new "drawer" structure. Since all mail
really needs to be created in, and sent from, the MAIN drawer, you should
always make sure that the MAIN drawer is current before doing any CAL MAIL_INIT
function. See the V3.0 scripts for the various TM functions (e.g., TMAPMEC.SCP)
to see how they save and restore the current drawer so the user doesn't lose
context.
==============================================================================
.LABEL CLEAR_ATTENDEES
! Clear the old list of attendees, recreate scrolling file for second list
! If we come from scan, don't clear this out - it holds the scanned
! (valid) people
.IF #TM_SCAN NES "1"
.THEN
CAL MAIL_INIT
.ELSE
FOR CAB$ATTRIBUTES WITH .KEY EQS "TO" DO -
CAB ADD_ATTRIBUTE ,"CC",.VALUE
CAB DELETE_ATTRIBUTE ,"TO","*"
.END_IF
.LABEL DISPLAY_FORM
!Bring up the attendee form
GET #TM_TYPE = "M"
FORM TMSES_SCHDMA
.IF OA$FORM_DISPOSE EQS "0" THEN .GOTO END
! Go schedule using the info
GET #NOVALID="VAL_DONE"
.LABEL CHECK_PEOPLE
! Check if they have any non-validated people
! This is the new way to do this for V3.0 -- FN 12/03/91
FOR FIRST CAB$ATTRIBUTES WITH .KEY EQS "TO"
GET #COUNT_TO = OA$SEL_COUNT
.IF #COUNT_TO EQ 0 THEN .GOTO ALL_VALID
!Set symbol so mail isn't sent. We have to schedule it with the not valid
! people since add attendee doesn't recognize OA$TM_SEND_MAIL
GET OA$TM_SEND_MAIL = "3"
OA$MSG_PURGE
CALENDAR SCHEDULE MEETING
GET #STATUS = OA$STATUS
.IF OA$MSG_ID EQS "CMNOATTEND" THEN GET #FUNCTION = "SCHEDULE MEETING" -
\GET #STATUS = 2 \OA$MSG_PURGE ELSE GET #FUNCTION = "ADD_ATTENDEE"
!Set it back so everything else works properly
GET OA$TM_SEND_MAIL = "0"
GET #CAL_KEY = #TM_KEY = #TEMP_CALKEY
GET #NOVALID=""
.IF #STATUS EQS "0" THEN .GOTO END
.LABEL ADD_VALIDATED
!Add the validated people to the list
! Get rid of all TOs, move all CCs to TOs, and get rid of all CCs
! (This is the new way to do this for V3.0 -- FN 12/03/91)
.IF #COUNT_TO NE 0 THEN CAB DELETE_ATTRIBUTE ,"TO","*"
FOR CAB$ATTRIBUTES WITH .KEY EQS "CC" DO -
CAB ADD_ATTRIBUTE ,"TO",.VALUE
.IF OA$SEL_COUNT NE 0 THEN CAB DELETE_ATTRIBUTE ,"CC","*"
GET OA$FUNCTION="CALENDAR " #FUNCTION
.IF #FUNCTION EQS "SCHEDULE MEETING" AND OA$STATUS NE 1 -
THEN .GOTO NOT_SCHED
.IF #FUNCTION EQS "ADD_ATTENDEE" AND OA$MSG_ID EQS "NOTOADDRESS" -
THEN OA$MSG_PURGE
.GOTO RELATE_DOC
.LABEL ALL_VALID
! Get rid of all TOs, move all CCs to TOs, and get rid of all CCs
.IF #COUNT_TO NE 0 THEN CAB DELETE_ATTRIBUTE ,"TO","*"
FOR CAB$ATTRIBUTES WITH .KEY EQS "CC" DO -
CAB ADD_ATTRIBUTE ,"TO",.VALUE
.IF OA$SEL_COUNT NE 0 THEN CAB DELETE_ATTRIBUTE ,"CC","*"
CALENDAR SCHEDULE MEETING
GET #CAL_KEY = #TM_KEY = #TEMP_CALKEY
GET #NOVALID=""
.IF OA$STATUS EQS "0" THEN .GOTO NOT_SCHED
|
| � I was trying this from the command line.
I assume, by this, that you're referring to doing an interactive command
from a menu form. If that's the case, you have to remember that in between
every command you enter, any pre- or post-processing on that form will take
place. On many of the primary menus (such as EM, TM, or WP), some of this
processing includes resetting the current document, which would destroy the
context you're trying to create.
The only way to really do it, as you've discovered, is from a script.
F
|