Quantcast
Channel: CRM Development forum
Viewing all articles
Browse latest Browse all 8223

CRM 4.0 to 2011 Plugin: How to use CrmNumber() in 2011 plugin

$
0
0

Hello...I am trying to modify code that was written for 4.0 into 2011.

The problem I am having is with the CrmNumber() function and using it to attach a pdf report in a plugin.

Here is the line of code. It is from this blog: http://ekoncis.blogspot.com/2012/01/crm-2011-custom-email-with-pdf-report.html

// Attaching Pdf report
//LINE BELOW NEEDS TO BE RE-WRITTEN
CrmNumber crmNextActorID = new CrmNumber();

 RetrieveEntityRequest request = new RetrieveEntityRequest();
request.LogicalName = "email";
RetrieveEntityResponse response = (RetrieveEntityResponse)service.Execute(request);
int objecttypecode = response.EntityMetadata.ObjectTypeCode.Value;                
Entity attachment = new Entity("activitymimeattachment");
attachment.Attributes.Add("subject", "Report");
attachment.Attributes.Add("filename", "Report.pdf");
attachment.Attributes.Add("body", Convert.ToBase64String(result));

//LINE BELOW NEEDS TO BE RE-WRITTEN
attachment.Attributes.Add("filesize", new CrmNumber(Convert.ToInt32(result.Length.ToString())));


Mike Karls


Viewing all articles
Browse latest Browse all 8223

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>