Quantcast
Viewing all articles
Browse latest Browse all 130

Using ActivityParty - VB\C#.net examples

The activitypointer is used when you need to add goups to a field (i,e required attendees on a appointment or to/from fields on a email)

Created a vb.net version also for anyone that obviously develops in it , but also for the users of SQL SSIS 2005 and below (C#.net scripting only came in SQL Server 2008)

The examples show you how to create a CRM appointment and populate the required attendees field.

C#.net

activityparty cont = new activityparty();
cont.partyid = new Lookup();
cont.partyid.Value = new Guid("Contact GUID");
cont.partyid.type = EntityName.contact.ToString() ;

appointment appt = new appointment();
appt.requiredattendees = new activityparty[] { cont };
appt.description = "This is a description";
appt.subject = "Test Appointment making use of activityparty"

service.create(appt);

VB.net

Dim cont As activityparty = New activityparty
cont.partyid = New Lookup
cont.partyid.Value = New Guid("CONTACT GUID")
cont.partyid.type = EntityName.contact.ToString()

Dim appt As New appointment
appt.requiredattendees = New activityparty() {cont}
appt.desctription = "This is a description"
appt.subject = "Test Appointment making use of activityparty"

service.create(appt)

Enjoy

Jonathan


Viewing all articles
Browse latest Browse all 130

Trending Articles