I have made a button in MS Dynamics CRM 2013 that runs some JavaScript, which runs a workflowactivity, that executes my .NET function.
I have tried returning just a string from the .NET code and all the above works.
However, when I now try to send my specific object through I get this error: The specified type 'CRM.DataModel.my_object' is not a known entity type
I have deducted that this is where my code crashes, at line 4:
1 try
2 {
3 //base.Context.ClearChanges();
4 my_object crmObject = base.Context.my_objectSet
5 .SingleOrDefault(p => p.my_objectId.Value == objectId && p.statecode == my_objectState.Active);
6
7 if (crmobject != null)
8 {
9 base.Logger.Trace("Object retrieved");
10 result = this.CorvertFromCRM(crmObject);
11 }
12 }
Google gives my nothing usefull, and I dont know what the error means. Any kind of help is appriciated. Thank you.
So it was figured out by a college of mine:
Go to Basis.WFActivities -> Properties -> AssemblyInfo.cs At the bottom of this file paste the following:
[assembly: Microsoft.Xrm.Sdk.Client.ProxyTypesAssemblyAttribute()]
And thats it.