I’m converting the following onclick javascript to a Skuid javascript snippet, and am getting an “Uncaught TypeError” at execute. Any ideas on how to resolve this?
Salesforce Button:
{!REQUIRESCRIPT("/soap/ajax/30.0/connection.js")} {!REQUIRESCRIPT("/soap/ajax/30.0/apex.js")}<br>var originalValue = this.value;<br>this.value = "Processing...";<br>var request = new Object();<br>request.Action = "view";<br>request.AttachmentId = "{!ATT_EXP__Attachment__c.Id }";<br>request.UserAgent = navigator.userAgent;<br>debugger;<br>var attachmentURL = sforce.apex.execute("ATT_EXP.AttachmentsController","GetViewSignature",{JSONrequest:JSON.stringify(request)});<br>this.value = originalValue;<br>window.open(attachmentURL);
Skuid Snippet:
var params = argumentsu0], $ = skuid.$; models = skuid.model.map(); var attachmentId = models.Attachment_view.getFirstRow().Id; var originalValue = this.value; this.value = "Processing..."; var request = new Object(); request.Action = "view"; request.AttachmentId = attachmentId ; request.UserAgent = navigator.userAgent; var attachmentURL = sforce.apex.execute("ATT_EXP.AttachmentsController","GetViewSignature",{JSONrequest: JSON.stringify(request)}); this.value = originalValue; window.open(attachmentURL);