Skip to main content

I’ve created a Signature custom component with jSignature (based heavily on Peter’.s work here - thanks, Peter!).

The problem I’m running into is that I want to be able to run updateRow on save, so that I can store the value from jSignature in SFDC appropriately.

When a save happens, I need to run something like this:


//Save signature&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var sigData = element.jSignature("getData", "base30").join(",");<br>var sigName = signatureModel.getFieldValue(signatureRow,'Name') || defaultName;<br>&nbsp;<br>// update signature text field in database and save<br>signatureModel.updateRow(signatureRow, {<br> Name: sigName,<br> Signature_Date__c: skuid.time.getSFDateTime(new Date()),<br>&nbsp;Signature__c: sigData<br>});<br>signatureModel.save();


However, if I throw that into the handleSave function on my component, I’m going to get an infinite loop of saves.

Can anyone think of a good way to handle this?

NOTE: There’s some extra stuff in there, but the basic idea is that I need to get  element.jSignature(“getData”, “base30”).join(“,”) and save that as the value for the Signature__c field.


Why do you want to run updateRow on save? Seems like there would be a better way to architect this… 


Yes! There must be a better way. That’s what I’m looking for.

In Peter’s example using skuid’s “Custom” component, he used a pagetitle with a button that called a snippet to run something like the code above. That’s my starting point.

Perhaps I could for changes on the Signature__c field on the model and run updatedRow then?


Reply