Personalized Community is here!
Quickly customize your community to find the content you seek.
Have questions on moving to the cloud? Visit the Dynamics 365 Migration Community today! Microsoft’s extensive network of Dynamics AX and Dynamics CRM experts can help.
2022 Release Wave 2Check out the latest updates and new features of Dynamics 365 released from October 2022 through March 2023
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Community | FastTrack Program | Finance and Operations TechTalks | Customer Engagement TechTalks | Upcoming TechTalks | All 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(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