You need to sign in to do that
Don't have an account?
Bavukat
Test Class for @Remote Action?
Friends- I am not sure how to write a test class for below menthod. Can you help ?
@RemoteAction public static RemoteSaveResult saveSignature(Id ehsId, String signatureBody) { Attachment a = new Attachment(ParentId=ehsId, name='Signature.png', ContentType='image/png', Body=EncodingUtil.base64Decode(signatureBody)); Database.saveResult result = Database.insert(a,false); RemoteSaveResult newResult = new RemoteSaveResult(); newResult.success = result.isSuccess(); newResult.attachmentId = a.Id; newResult.errorMessage = result.isSuccess()?'':result.getErrors()[0].getMessage(); return newResult; } public class RemoteSaveResult { public Boolean success; public Id attachmentId; public String errorMessage; }
You need to write class like this:
As a common practice mark best answer if it helped you.
All Answers
You need to write class like this:
As a common practice mark best answer if it helped you.