Article ID: 163802
Article Last Modified on 7/1/2004
* BEGIN CODE
oSched = CREATEOBJECT("SchedulePlus.Application")
oSched.Logon
mySched = oSched.ScheduleLogged
myTasks = mySched.SingleTasks
IF myTasks.Rows > 0 && Make sure there are tasks to process
myContacts = mySched.Contacts
aTasks = myTasks.getrows(100,"text","contactitemid")
FOR x = 1 TO ALEN(aTasks,1) && process the rows in the array
* The following line limits the Contacts table to the given
* criteria: ItemId = <contactitemid from the task>
myContacts.SetRestriction("itemid",aTasks(x,2),"==")
oneContact = myContacts.Item
?"Task Description: ", aTasks(x,1)
?"Contact First Name: ", oneContact.GetProperty("FirstName")
?"Contact Last Name: ", oneContact.GetProperty("LastName")
ENDFOR
ENDIF
oSched.Logoff
* END CODE
* BEGIN CODE
oSched = CREATEOBJECT("SchedulePlus.Application")
oSched.Logon
mySched = oSched.ScheduleLogged
myTasks = mySched.SingleTasks
myContacts = mySched.Contacts
DO WHILE !myTasks.IsEndofTable
oneTask = myTasks.Item
?"Description: ", oneTask.GetProperty("Text")
* We must verify that there is a contact for the task; otherwise,
* the GetProperty call will cause an error.
IF TYPE('oneTask.GetProperty("ContactItemID")') = "C"
* The following line limits the Contacts table to the given
* criteria: ItemId = <contactitemid from the task>
myContacts.SetRestriction("itemid",;
oneTask.GetProperty("contactitemid"),"==")
oneContact = myContacts.Item
?"Contact Name: "
??ALLTRIM(oneContact.GetProperty("FirstName")) + " "
??ALLTRIM(oneContact.GetProperty("LastName"))
ELSE
?"Contact Name: No Contact For This Task"
ENDIF
myTasks.Skip(1)
ENDDO
oSched.Logoff
* END CODE
Keywords: kbhowto kbinterop kboop kbautomation KB163802