segunda-feira, 12 de novembro de 2007

How to download CRM note's attachments

This is something I never needed to do until today and since the info we can get inside the SDK is not very detailed, here's a quick example:

annotation a = (annotation)service.Retrieve("annotation", new Guid("{56889D1A-6391-DC11-8017-000C2928380D}"), new AllColumns());

string myNote = "{56889D1A-6391-DC11-8017-000C2928380D}";
string url = "http://localhost:5555/Activities/Attachment/download.aspx?" + "AttachmentType=5&AttachmentId=" + myNote;

WebClient myWebClient = new WebClient();
myWebClient.Credentials = CredentialCache.DefaultCredentials;
myWebClient.DownloadFile(url,@"C:\CRM\" + a.filename );


Please note that you must change the Attachment Type according to the entity that owns the attachment:

  • 1001 for ActivityMimeAttachment (like email attachments),
  • 5 for Annotation (note's attachments) and
  • 1070 for SalesLiteratureItem.

Hope that will help.


PS: This is not a Titan CRM post yet.

quarta-feira, 24 de outubro de 2007

Titan Vids

Hi all,

Phill Richardson has some nice videos introducing some Titan features.

Have a look at:

http://www.philiprichardson.org/blog/

Cheers.

domingo, 21 de outubro de 2007

Creating this parental association would create a loop in Accounts hierarchy.

Before starting to speak about Titan - Yes, the NDA has been lifted and there's a lot to talk about and other bloggers have just done so, I'd like to write a little bit about a problem that took me sometime to solve and I didn't find much info about it.

Here's the error message I was having:

«0x80040507
Creating this parental association would create a loop in Accounts hierarchy.
Platform»

This showed up in a migration I was building and I couldn't see why it was happening because I was filtering the chance of an Account being the Parent Account of itself on the very beggining of the process in the data I was receiving at that particular moment.

But after some research I found the problem and it got to be childish one: In the method that would return me the actual Parent Account guid, at the same time I was updating the Account's accountid with it. So I was trying to set a Parent Account link for one Account to itself. Pretty neat, hein?!

terça-feira, 25 de setembro de 2007