Tech Support > Microsoft Windows > Windows CRM > mscrm plugin (module) development
mscrm plugin (module) development
Posted by ben on October 29th, 2003


hi,

does anyone have an example of a plugin for mscrm with .net code, and/or details of how to integrate with the product.

we're having real trouble finding out information about this.

thanks in advance,

ben

Posted by John O'Donnell on October 29th, 2003


you need to check the sdk out.

http://msdn.microsoft.com/library/de...tm/default.asp





"ben" <anonymous@discussions.microsoft.com> wrote in message
news:A543AA7A-4362-474E-8407-4D908648B0B6@microsoft.com...


Posted by Torsten Brasch on October 29th, 2003


Ben,

After many days, I was able to put together this code to compile a COM+
component.
Use these two links and follow the instructions:

http://www.greatplains.com/techknowl...0228&target=PS
http://msdn.microsoft.com/library/de...stcallouts.asp

After you followed the steps in those two articles and installed the
component below, you're all set. Works great for me.

Here's my code (you need to generate your own GUID's):

using System;

using System.EnterpriseServices;

using System.Runtime.InteropServices;

using System.IO;

[assembly: ApplicationName("Callout Example")]

[assembly: ApplicationActivation(ActivationOption.Server)]

namespace PostCallout

{

[GuidAttribute("F4233E5B-17DC-4661-9ABC-6707A9F99215")]

public interface ICRMCallout

{

void PostCreate(int ObjectType, string ObjectId, string OrigObjectXml);

void PostUpdate(int ObjectType, string ObjectId, string OrigObjectXml);

void PostDelete(int ObjectType, string ObjectId);

}

[GuidAttribute("AA4AD2AC-97B8-4d24-8E81-388A655DDBE5"),

ClassInterface(ClassInterfaceType.AutoDispatch)]

public class CRMCaller : ServicedComponent, ICRMCallout

{

public CRMCaller()

{

}


public void PostCreate(int ObjectType, string ObjectId, string
OrigObjectXml)

{

FileInfo fi = new FileInfo(@"C:\CSCallout_Insert.txt");

StreamWriter s = fi.AppendText();

s.WriteLine("CRM Create Event Occurred...\n");

s.WriteLine("Object Type: " + ObjectType.ToString());

s.WriteLine("Object ID: " + ObjectId.ToString());

s.WriteLine("Object XML String: ");

s.WriteLine(OrigObjectXml);

s.WriteLine();

s.Close();

}

public void PostUpdate(int ObjectType, string ObjectId, string
OrigObjectXml)

{

FileInfo fi = new FileInfo(@"C:\CSCallout_Update.txt");

StreamWriter s = fi.AppendText();

s.WriteLine("CRM Update Event Occurred...\n");

s.WriteLine("Object Type: " + ObjectType.ToString());

s.WriteLine("Object ID: " + ObjectId.ToString());

s.WriteLine("Object XML String: ");

s.WriteLine(OrigObjectXml);

s.WriteLine();

s.Close();

}

public void PostDelete(int ObjectType, string ObjectId)

{

FileInfo fi = new FileInfo(@"C:\CSCallout_Delete.txt");

StreamWriter s = fi.AppendText();

s.WriteLine("CRM Delete Event Occurred...\n");

s.WriteLine("Object Type: " + ObjectType.ToString());

s.WriteLine("Object ID: " + ObjectId.ToString());

s.WriteLine();

s.Close();

}

}

}


"ben" <anonymous@discussions.microsoft.com> wrote in message
news:A543AA7A-4362-474E-8407-4D908648B0B6@microsoft.com...


Posted by ben on October 29th, 2003


thanks torsten,

that looks excellent. i'm not surprised that it took you a while to sort this out as it seems like there is v.little info around on this.

i'll see how i get on!

cheers,

ben