ObjectName in Activities

Hi!

I am using the example in the MS CRM SDK help file to create new activities.
It works like a charm, with one exception (of course).

The field ObjectName does not get written. This leads to the Regarding box
to be open when the Activity is opened.
It works in the sence that my Activity is in fact linked to, in this case,
an order which would indicate that I am doing the <activityparties> stuff
correctly. The attribute ObjectName on the Activity is read-only so I can't
set it either.

Does anyone know what I am doing wrong?


Gratefully

!Robert




The code:

string strXml = "<activity>";

strXml += "<subject>" + ddlWorkType.SelectedItem.Text + " /
Actual</subject>";

strXml += "<description>" + txtDescription.Text + "</description>";

strXml += "<category>" + ddlWorkType.SelectedItem.Text + "</category>";

strXml += "<subcategory>Actual</subcategory>";

strXml += "<actualstart>" + sTimeFrom + "</actualstart>";

strXml += "<actualend>" + sTimeTo + "</actualend>";

strXml += "<actualdurationminutes>" + sDuration +
"</actualdurationminutes>";

strXml += "<scheduledstart>" + sDate + "</scheduledstart>";

strXml += "<activitytypecode>134</activitytypecode>";

strXml += "<ownerid type=\"" +
Microsoft.Crm.Platform.Types.ObjectType.otSystemUser.ToString() + "\">";

strXml += userAuth.UserId + "</ownerid>";

strXml += "</activity>";

// Set up the XML string for the activity party

string activityPartyXml = "<activityparties>";

activityPartyXml += "<activityparty><partyid>{" +
ddlOrder.SelectedItem.Value + "}</partyid>";

activityPartyXml += "<partyobjecttypecode>" +
Microsoft.Crm.Platform.Types.ObjectType.otSalesOrder.ToString();

activityPartyXml += "</partyobjecttypecode>";

activityPartyXml += "<participationtypemask>" +
Microsoft.Crm.Platform.Types.ACTIVITY_PARTY_TYPE.ACTIVITY_PARTY_OPTIONALATTE
NDEE.ToString();

activityPartyXml +=
"</participationtypemask></activityparty></activityparties>";

// Create the activity

string strActivityId = activity.Create(userAuth, strXml, activityPartyXml);


0
Robert
7/29/2004 10:48:50 AM
crm 35858 articles. 1 followers. Follow

3 Replies
475 Views

Similar Articles

[PageSpeed] 8

To fill in the regarding box you need to include two 
variables. One is the object type and the other is the 
object id
like for cases it would be
strXml += "<objecttypecode>112</objecttypecode>";//object 
id case
strXml += "<objectid>"+l_caseid+"</objectid>";//id case

If you substitue the same with your order id and order 
object type code it will work

hope this helps

>-----Original Message-----
>Hi!
>
>I am using the example in the MS CRM SDK help file to 
create new activities.
>It works like a charm, with one exception (of course).
>
>The field ObjectName does not get written. This leads to 
the Regarding box
>to be open when the Activity is opened.
>It works in the sence that my Activity is in fact linked 
to, in this case,
>an order which would indicate that I am doing the 
<activityparties> stuff
>correctly. The attribute ObjectName on the Activity is 
read-only so I can't
>set it either.
>
>Does anyone know what I am doing wrong?
>
>
>Gratefully
>
>!Robert
>
>
>
>
>The code:
>
>string strXml = "<activity>";
>
>strXml += "<subject>" + ddlWorkType.SelectedItem.Text 
+ " /
>Actual</subject>";
>
>strXml += "<description>" + txtDescription.Text 
+ "</description>";
>
>strXml += "<category>" + ddlWorkType.SelectedItem.Text 
+ "</category>";
>
>strXml += "<subcategory>Actual</subcategory>";
>
>strXml += "<actualstart>" + sTimeFrom + "</actualstart>";
>
>strXml += "<actualend>" + sTimeTo + "</actualend>";
>
>strXml += "<actualdurationminutes>" + sDuration +
>"</actualdurationminutes>";
>
>strXml += "<scheduledstart>" + sDate 
+ "</scheduledstart>";
>
>strXml += "<activitytypecode>134</activitytypecode>";
>
>strXml += "<ownerid type=\"" +
>Microsoft.Crm.Platform.Types.ObjectType.otSystemUser.ToSt
ring() + "\">";
>
>strXml += userAuth.UserId + "</ownerid>";
>
>strXml += "</activity>";
>
>// Set up the XML string for the activity party
>
>string activityPartyXml = "<activityparties>";
>
>activityPartyXml += "<activityparty><partyid>{" +
>ddlOrder.SelectedItem.Value + "}</partyid>";
>
>activityPartyXml += "<partyobjecttypecode>" +
>Microsoft.Crm.Platform.Types.ObjectType.otSalesOrder.ToSt
ring();
>
>activityPartyXml += "</partyobjecttypecode>";
>
>activityPartyXml += "<participationtypemask>" +
>Microsoft.Crm.Platform.Types.ACTIVITY_PARTY_TYPE.ACTIVITY
_PARTY_OPTIONALATTE
>NDEE.ToString();
>
>activityPartyXml +=
>"</participationtypemask></activityparty></activitypartie
s>";
>
>// Create the activity
>
>string strActivityId = activity.Create(userAuth, strXml, 
activityPartyXml);
>
>
>.
>
0
Anna
7/29/2004 2:30:06 PM
Thank you very much Anna!

It worked perfectly! Funny how you need to set it for both the Activity and
the ActivityParty though, don't you think?

Anyway, THANX!

!Robert





"Anna" <anonymous@discussions.microsoft.com> wrote in message
news:679f01c47578$8b5a6920$a301280a@phx.gbl...
> To fill in the regarding box you need to include two
> variables. One is the object type and the other is the
> object id
> like for cases it would be
> strXml += "<objecttypecode>112</objecttypecode>";//object
> id case
> strXml += "<objectid>"+l_caseid+"</objectid>";//id case
>
> If you substitue the same with your order id and order
> object type code it will work
>
> hope this helps
>
> >-----Original Message-----
> >Hi!
> >
> >I am using the example in the MS CRM SDK help file to
> create new activities.
> >It works like a charm, with one exception (of course).
> >
> >The field ObjectName does not get written. This leads to
> the Regarding box
> >to be open when the Activity is opened.
> >It works in the sence that my Activity is in fact linked
> to, in this case,
> >an order which would indicate that I am doing the
> <activityparties> stuff
> >correctly. The attribute ObjectName on the Activity is
> read-only so I can't
> >set it either.
> >
> >Does anyone know what I am doing wrong?
> >
> >
> >Gratefully
> >
> >!Robert
> >
> >
> >
> >
> >The code:
> >
> >string strXml = "<activity>";
> >
> >strXml += "<subject>" + ddlWorkType.SelectedItem.Text
> + " /
> >Actual</subject>";
> >
> >strXml += "<description>" + txtDescription.Text
> + "</description>";
> >
> >strXml += "<category>" + ddlWorkType.SelectedItem.Text
> + "</category>";
> >
> >strXml += "<subcategory>Actual</subcategory>";
> >
> >strXml += "<actualstart>" + sTimeFrom + "</actualstart>";
> >
> >strXml += "<actualend>" + sTimeTo + "</actualend>";
> >
> >strXml += "<actualdurationminutes>" + sDuration +
> >"</actualdurationminutes>";
> >
> >strXml += "<scheduledstart>" + sDate
> + "</scheduledstart>";
> >
> >strXml += "<activitytypecode>134</activitytypecode>";
> >
> >strXml += "<ownerid type=\"" +
> >Microsoft.Crm.Platform.Types.ObjectType.otSystemUser.ToSt
> ring() + "\">";
> >
> >strXml += userAuth.UserId + "</ownerid>";
> >
> >strXml += "</activity>";
> >
> >// Set up the XML string for the activity party
> >
> >string activityPartyXml = "<activityparties>";
> >
> >activityPartyXml += "<activityparty><partyid>{" +
> >ddlOrder.SelectedItem.Value + "}</partyid>";
> >
> >activityPartyXml += "<partyobjecttypecode>" +
> >Microsoft.Crm.Platform.Types.ObjectType.otSalesOrder.ToSt
> ring();
> >
> >activityPartyXml += "</partyobjecttypecode>";
> >
> >activityPartyXml += "<participationtypemask>" +
> >Microsoft.Crm.Platform.Types.ACTIVITY_PARTY_TYPE.ACTIVITY
> _PARTY_OPTIONALATTE
> >NDEE.ToString();
> >
> >activityPartyXml +=
> >"</participationtypemask></activityparty></activitypartie
> s>";
> >
> >// Create the activity
> >
> >string strActivityId = activity.Create(userAuth, strXml,
> activityPartyXml);
> >
> >
> >.
> >


0
Robert
7/29/2004 11:27:45 PM
Hi Robert
Glad it worked. What i find funny is that they provide 
examples that dont event work. It took me ages to figure 
this one out and believe me there are more catches for 
other entities.
Regards
Anna

>-----Original Message-----
>Thank you very much Anna!
>
>It worked perfectly! Funny how you need to set it for 
both the Activity and
>the ActivityParty though, don't you think?
>
>Anyway, THANX!
>
>!Robert
>
>
>
>
>
>"Anna" <anonymous@discussions.microsoft.com> wrote in 
message
>news:679f01c47578$8b5a6920$a301280a@phx.gbl...
>> To fill in the regarding box you need to include two
>> variables. One is the object type and the other is the
>> object id
>> like for cases it would be
>> strXml 
+= "<objecttypecode>112</objecttypecode>";//object
>> id case
>> strXml += "<objectid>"+l_caseid+"</objectid>";//id case
>>
>> If you substitue the same with your order id and order
>> object type code it will work
>>
>> hope this helps
>>
>> >-----Original Message-----
>> >Hi!
>> >
>> >I am using the example in the MS CRM SDK help file to
>> create new activities.
>> >It works like a charm, with one exception (of course).
>> >
>> >The field ObjectName does not get written. This leads 
to
>> the Regarding box
>> >to be open when the Activity is opened.
>> >It works in the sence that my Activity is in fact 
linked
>> to, in this case,
>> >an order which would indicate that I am doing the
>> <activityparties> stuff
>> >correctly. The attribute ObjectName on the Activity is
>> read-only so I can't
>> >set it either.
>> >
>> >Does anyone know what I am doing wrong?
>> >
>> >
>> >Gratefully
>> >
>> >!Robert
>> >
>> >
>> >
>> >
>> >The code:
>> >
>> >string strXml = "<activity>";
>> >
>> >strXml += "<subject>" + ddlWorkType.SelectedItem.Text
>> + " /
>> >Actual</subject>";
>> >
>> >strXml += "<description>" + txtDescription.Text
>> + "</description>";
>> >
>> >strXml += "<category>" + ddlWorkType.SelectedItem.Text
>> + "</category>";
>> >
>> >strXml += "<subcategory>Actual</subcategory>";
>> >
>> >strXml += "<actualstart>" + sTimeFrom 
+ "</actualstart>";
>> >
>> >strXml += "<actualend>" + sTimeTo + "</actualend>";
>> >
>> >strXml += "<actualdurationminutes>" + sDuration +
>> >"</actualdurationminutes>";
>> >
>> >strXml += "<scheduledstart>" + sDate
>> + "</scheduledstart>";
>> >
>> >strXml += "<activitytypecode>134</activitytypecode>";
>> >
>> >strXml += "<ownerid type=\"" +
>> 
>Microsoft.Crm.Platform.Types.ObjectType.otSystemUser.ToSt
>> ring() + "\">";
>> >
>> >strXml += userAuth.UserId + "</ownerid>";
>> >
>> >strXml += "</activity>";
>> >
>> >// Set up the XML string for the activity party
>> >
>> >string activityPartyXml = "<activityparties>";
>> >
>> >activityPartyXml += "<activityparty><partyid>{" +
>> >ddlOrder.SelectedItem.Value + "}</partyid>";
>> >
>> >activityPartyXml += "<partyobjecttypecode>" +
>> 
>Microsoft.Crm.Platform.Types.ObjectType.otSalesOrder.ToSt
>> ring();
>> >
>> >activityPartyXml += "</partyobjecttypecode>";
>> >
>> >activityPartyXml += "<participationtypemask>" +
>> 
>Microsoft.Crm.Platform.Types.ACTIVITY_PARTY_TYPE.ACTIVITY
>> _PARTY_OPTIONALATTE
>> >NDEE.ToString();
>> >
>> >activityPartyXml +=
>> 
>"</participationtypemask></activityparty></activitypartie
>> s>";
>> >
>> >// Create the activity
>> >
>> >string strActivityId = activity.Create(userAuth, 
strXml,
>> activityPartyXml);
>> >
>> >
>> >.
>> >
>
>
>.
>
0
anonymous
8/12/2004 3:44:39 PM
Reply:

Similar Artilces:

Detecting active customview
Hello I have to create a piece of code wich makes a few buttons visible or in visible depending of te active customview that is selected on a sheet.It has to be something like this: Private Sub Worksheet_Activate() If (ACTIVECUSTOMVIEW = view1) then CommandButton1.Visible = False End If If (ACTIVECUSTOMVIEW = view2) then CommandButton1.Visible = True End If End Sub Thanks in advance... I'm not a proper coder, maybe someone else will chip in. However, I couldn't find anything on this, so if it *can't* be done, I'd suggest check...

SBS 2003 saying Rebuilding Active Directory Indices.
I have a big problem here. A fairly new customer contacted me and indicated the server was running very slow. After getting remotely logging into it I noticed heavy paging. Seemed to be caused by SQL databse they use. Normally shuting down and restarting that databse the server would start to run normally but it didn't. At the customers request I rebooted the server. About 15 minutes later the custmer called to say she was looking at the screen and it said Rebuilding Active Directory Indices.. Eventually completes this and gets to CTrl Alt Del but indicates some s...

Activating software
I'm moving software to a new computer but can't activate it on the new computer because I have already done so on my "old" computer. Is there a way to deactivate the software on my "old" computer so I can reactivate it? Judie wrote: > I'm moving software to a new computer but can't activate > it on the new computer because I have already done so on > my "old" computer. Is there a way to deactivate the > software on my "old" computer so I can reactivate it? Any reason you cannot use the telephone activation option? There&#...

Windows 2003 Active Directory and Exchange 2000 Server
I had to build a test lab to simulate a customers Windows 2003 domain which has Exchange 2000 installed on a Windows 2000 Server. These were the steps that I took. 1. INstalled Windows 2003 Server onto my laptop and connected it to the production network. DCPROMO'd it and then disconnected it from the domain. 2. Brought the laptop with Windows 2003 installed back to my office and build a test lab. 3. Seized the FSMO roles onto this server (laptop) and then transferred the roles onto another domain controller. So now I have 2 domain controllers in my test lab 4. I then installed a W...

CRM 4 and Active Voice outlook client
I have a client using an Outlook voicemail player from Active Voice, which allows a user to open a voicemail like an email and play a message. Since the CRM 4 Outlook client has been installed, when the user opens their voice mail the player will not work, unless they disable the CRM client. Has anyone had experience or found a work around for this case? The app plug in is View Mail for Microsoft Messaging "ilibhart" wrote: > I have a client using an Outlook voicemail player from Active Voice, which > allows a user to open a voicemail like an email and play a message...

Multiple emails w/ same tracking token in one activity?
Is it possible to track an ongoing email conversation as a single activity (assuming tracking token is present and accurate), instead of having each outgoing and incoming email result in a separate activity? One troubleshooting conversation with a contact can end up creating 12 activities in their history. If anyone knows the answer and/or can tell me how to do so, please let me know. Thanks! Afraid not. Each of those seperate emails is a seperate "activity" and thus is tracked seperately. -- Matt Parks MVP - Microsoft CRM "SCAB" <SCAB@discussions.microso...

Money 2006 Activation Date
How can I tell when my version of Money 2006 will stop giving me Internet-based services updates? Presumably it is the earlier of 2 yrs after the activation date or 9/1/08 whichever is earlier. Tony See http://money.mvps.org/faq/article/186.aspx -- Regards Bob Peel, Microsoft MVP - Money For UK tips & fixes see http://support.microsoft.com/default.aspx?scid=fh;EN-GB;mny. I do not respond to any emails that I have not specifically asked for. "TonyK" <tony73@hotpop.com> wrote in message news:u4CWcDpXIHA.4808@TK2MSFTNGP05.phx.gbl... > How can I tell when my ...

Campaign Activity
We have created multiple campaigns with a single campaign activity - channel = email. Our SMTP server is Exchange. We are on v3c, Outlook 2003 SP2. Our marketing lists range anywhere from 1,000 - 5,000 email addresses. We have attempted to clean all bad addresses so as not to hang the system up (quick campaigns abort when it meets a bad address). When we hit the Distribute Campaign button it builds anywhere from 20% - 80% of the email volume, then the system aborts. I have no idea why. ANY help would be appreciated. Melissa ...

Frontape 2003 activation
I just bought Frontpage 2003 on Ebay- seller assures me the software has been deleted, but had been activated. I bought FP to use in the future on a new computer that I plan to buy in 2011 - so I do not want to activate the software now, but probably in 2011. Since Microsoft is discontinuing support to FP, 1) will I be able to activate the FP software in a year or 2- and 2) if I use the telephone activation, can I "delete" the "old" activation and get 2 new activations on my computers without a problem. I'm hesitant to to try to activate the software now o...

Money Plus Deluxe will not activate
I upgraded my desktop and laptop computers to Windows 7. When I reinstalled Microsoft Money Plus Deluxe, I received a message that the software had expired and would not activate. I contacted Microsoft and was sent override keys for both computers. The override key worked on the laptop. On the desktop computer, I get a message that the key is valid and that the software is activated. However, when I restart Money, I am told that I must activate within 60 days. I e-mail MS each time this happens. Each time, they respond with the same instructions. I can't seem to get it ac...

advertise to 3,300 active members!!!
We will send your ad out to our very active database of members for a fee. There is at least a 45% click thru rate on all ad's sent from our company. This means, if we send your ad out to our members almost half or more of them will be seeing your advertisement! Our database is growing continually everyday. Send out your ad's for your company now. You won't find cheaper advertising.. http://bythebeachemails.com ...

Activities assigned to contacts or accounts???
I created some activities associated with a contact and completed/closed them. They now show up in the history associated with that contact. But if I go to the account associated with the contact I don't see any history at all. I can create and close some activities associated with the account and these will show up in the account history. But I'd expect the contact history to rollup to the parent account. Anyone found a way to make this happen. I want the detail of which contact the activity was really done, but NEED to be able to view ALL activities for an account regard...

New purchase/activation
New computer has trial version. I can purchase new H/S 2007 at discount. Do I need to uninstall current software, then re-install purchased version to activate? Or just use activation key from new software to activate included trial version without installing again? Thanks for you help. Uninstall the Trial version and also the Activation Assistant before attempting to install your purchased version If you have trouble uninstalling fro Add\Remove then see the following http://support.microsoft.com/kb/971179 -- Peter Please Reply to Newsgroup for the benefit of others ...

Query Active Directory for OWA users
Can anyone tell me if it possible to query active directory to resolve all users with access to outlook web access enabled? and if so, how? this is making me crazy. By default all mailbox enable users have access to outlook web access. You can query the AD for the attribute protocolSettings to find user that have OWA disable. Good article on OWA in the link below. http://www.msexchange.org/tutorials/Securing-Exchange-Server-2003-Outlook-Web-Access-Chapter5.html <rob@robnles.com> wrote in message news:1110916531.628512.237870@g14g2000cwa.googlegroups.com... > Can anyone tell me...

Workflow: assigning activities to another users
Is it possible in some way? I want to assing workflow-created task to some user... could at least be done by calling a workflow assembly which you would have to write ======================= John O'Donnell Microsoft CRM MVP http://codegallery.gotdotnet.com/crm "Rock3" <Rock3@discussions.microsoft.com> wrote in message news:69D8B77C-7B33-45B9-BE9D-2EE721CB9F28@microsoft.com... > Is it possible in some way? I want to assing workflow-created task to some > user... ...

Exchange Message Tracking activation failure
Hi out there, I have the following problem. We have Microsoft Exchange 2003 SP1 (Build 7226.6 SP1) on a cluster. Anytime i want to enable "Message Tracking" or "subject logging and display" i get an error "You Must connect to the WMI service on the target Exchange Server to invoke this method" Facility: Microsoft Exchange Management ID no: c10327c5 Microsoft Exchange Management I have no matches trying to find the id on googlegroups or google itself. What could that be? Have restarted the hole server. Nothing. Thx cHRIS Nobody ever encountered this Problem o...

Activity.Route
I am trying to programmatically move an email from a user's assigned folder to his In Progress folder. It doesn't seem like you can use Activity.Route to do this. Has anybody done this before? ...

Remote Active Sync
Hello, I just upgraded to Exchange 2003 Server and I have no idea how to setup Mobile Access. I would like to sync my pocket pc remotely. Does anyone know where I can get step by step instructions on how to do this? Thanks, Jose ...

Promote E-mail to CRM Activity
Anyone have run into the following problem? E-mail with a URL in the body of a message is promoted to a CRM activity and the hyperlink to the URL is lost. ...

CRM 4 cannot activate Language pack activation after upgrade
Hi folks!! I have an important migration to work on, basically driven because of the need of the language pack, but after upgrading from 3 to 4, I cannot activate the language pack. They install without error, but no way to activate them. I am almosr certain it may be related to the fact that many of the different entities may have found themsleves modified and some "default" field removed (as some other post mentionned), but just in case, I am posting this request for help. I am goign to embark in trying to work around this by doing (in lab of course) many steps to see if it will...

Store activities
For monitoring recruitment actions per applicant I need to store about 50 actions per applicant. The activity table would look like: ApplicantID* ActivityID* DateStart DateEnd My concerns are: 1. The table would have an enormous amout of records if I had let's say 30,000 applicants. 2. When an new applicant would be added I would have to automatically add all the 50 action records, otherwise the user would have to pick them manually. Also some jobs require other applicant actions than others. A not normalized table would seem easier but would require a table design ...

Exchange tabs in Active Directory Users and Computers
Hi, We have an exchange server and many other domain controllers. In order for us to have the Exchange tabs in Active Directory is to use the Exchange server. We want to be able to have the Exchange tabs in our domain controllers so that other admin can create email accounts on our only one exchange server. Can someone help me on this? Much appreciated. --kent On Tue, 6 Jan 2004 03:58:07 -0800, Kent Nguyen wrote: > We have an exchange server and many other domain > controllers. In order for us to have the Exchange tabs > in Active Directory is to use the Exchange serve...

Viewing of Proposal (under Proposals and Activities) work under My
We are about to enable Proposals and Activities in our Production Environment, but I'm observing a problem in My Tasks. The question is why our resources are unable to view their assignments generated under a Proposal Resource Plan. In our Dev Environment, I have a Proposal with two resources reserved under a Resource Plan (not via the Build Team button) using an FTE calculation. After the Proposal and Resource Plan were both published, both resources showed their time committed for this Proposal in the Resource Center. However, neither resource sees anything under M...

Customizing Activities views in MSCRM
Activies views should be customizable to meet business requirements of Partners and Customers. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.microsoft.com/Businesssolutions/Community/NewsGroups/dgbrowser/en-us/default.mspx?mid=560d1923-37dd-4333-ba24-30fb7...

Ways to activate a macro
Is there a way to cause a macro to execute when a certain cell is exited? My end goal is described in an additional post: How can I force certain text formatting in a cell? Yes....set up a private global variable in sheet code like this Private strLastCell As String Then use this code (changing "$A$1" to whatever cell you want)..... Private Sub Worksheet_SelectionChange(ByVal Target As Range) If strLastCell = "$A$1" Then Call yourmacroname End If Let strLastCell = Target.Address End Sub This won't work the first time you exit the cell as the global variable i...