keirbowden / sigcapapp

Signature Capture Samples
MIT License
9 stars 5 forks source link

Pull Singnature.png as image into WorkOrder to render as PDF #18

Open SFWannabe opened 5 years ago

SFWannabe commented 5 years ago

Hi Keir,

Id like to pull in the png file once my workorder has been signed... to then attach as image so I can render this as a pdf in a printable form or ability to email.

Is this some thing you could help with?

Code I have is:

All I get is an image dummy placer... any ideas?

KR, John

keirbowden commented 5 years ago

Hi John,

That markup won't work as you are referencing the ID of the workorder object rather than the attachment/file that contains the signature. I assume that this is a VF page you want to render as PDF? if so, you'll have to write something that figures out the id of the image and then uses that.

There are a number of threads about this on the developer boards - here's one I chose at random:

https://developer.salesforce.com/forums/?id=906F000000099XCIAY

SFWannabe commented 4 years ago

Hi Keir,

Going off topic...

I only use Professional edition... is it possible to write 'classes' for this or only with the free DevEditon?

I read the examples you sent links to... combination of Apex and Class...

Wondered if there was an Apex only option or am i miles away from target here!

keirbowden commented 4 years ago

Hi John,

Unfortunately, Professional Edition doesn't allow authoring Apex - Signature Capture apex is allowed to run as it is inside a managed package that has been through the security review.

I think in your case you'd have to store the id of the attachment/file on the record you are associating it with. Then you would be able to reference it as any other field in your Visualforce. The main downside is this would tie you to a single signature per record - the last one captured would make the most sense. However, you wouldn't be able to use triggers in Professional Edition to achieve this and I don't know if the attachment or file (contentversion) sobject types are supported by flows., but I'm pretty sure they aren't by workflow or process builder.

I've had a request open for a while to produce a sample that allows a record to be updated when the signature is captured, so I'll roll your requirements into that and see what I can come up with.

keirbowden commented 4 years ago

Linking to #21