The views and opinions expressed in this blog are those solely of the author(s) and do not necessarily reflect Microsoft’s current policy, position, or branding. For official announcements and guidance on Dynamics 365 apps and services, please visit the Microsoft Dynamics 365 Blog.
Choose your path Increase your proficiency with the Dynamics 365 applications that you already use and learn more about the apps that interest you. Up your game with a learning path tailored to today's Dynamics 365 masterminds and designed to prepare you for industry-recognized Microsoft certifications.
Visit Microsoft Learn
2020 release wave 1 Discover the latest updates and new features to Dynamics 365 planned through September 2020
Release overview guides and videos Release Plan | Preview 2020 Release Wave 1 Timeline
Ace your Dynamics 365 deployment with packaged services delivered by expert consultants. | Explore service offerings
Connect with the ISV success team on the latest roadmap, developer tool for AppSource certification, and ISV community engagements | ISV self-service portal
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance TechTalks | Customer Engagement TechTalks | Upcoming TechTalks
We already saw how to use Pen/ Signature control in Dynamics CRM in the previous blog: https://someshblogs.wordpress.com/2017/05/03/adding-signature-control-on-mobile-and-tablets-in-dynamics-crm/
In this blog, we will see how to generate an image of the pen control data and store in Record as an attachment.
Now it will be a common scenario where the Users will need to see the Signature image in browser as well. This is how data is captured on Web browser.
//// The plugin is registered on the Post Update on "Customer Approval" field on Opportunity.
Entity entity = (Entity)context.InputParameters["Target"];
//// The field which stores the data for Signature
string signatureFieldName = "new_customerapproval";
string encodedData = entity.GetAttributeValue<string>(signatureFieldName);
//// Remove the additional Metadata from the text generated.
int startIndex = encodedData.IndexOf("base64,") + 7;
encodedData = encodedData.Substring(startIndex, encodedData.Length - startIndex);
string contentType = "image/png";
Entity Annotation = new Entity("annotation");
Annotation.Attributes["objectid"] = new EntityReference(entity.LogicalName, entity.Id);
Annotation.Attributes["objecttypecode"] = entity.LogicalName;
Annotation.Attributes["subject"] = "Customer Signature"; //// You can have any subject as required.
Annotation.Attributes["documentbody"] = encodedData;
Annotation.Attributes["mimetype"] = contentType;
Annotation.Attributes["notetext"] = "Customer Signature Attached"; //// Again, add any note text as needed
Annotation.Attributes["filename"] = "Customer Approval Signature.png"; //// OR Any name as required
Guid annotation = service.Create(Annotation);
If you have any issues or need more information, please post in the comments section below.
Business Applications communities