+ Start a Discussion

how to us @Remoteaction feature


I have a requirnment where I have to select an image on Visualforce page then Crop it in fixed size and then save as attacment in the record.
In visualforce I am filling record field valueas as well as image(attachment). On click of save button I want to save record first then save the selected image as atttachment. 

I have used javascript to crop the image and using <input> and <canvas> tag i am creating my image and try to save it by using @RemoteAction feature.

Here my issue is on click of Save First I want to save the record and then in the same method I want to call the saveimage methood (@remoteaction). But i am not able to call @remoteaction in my void save method.

Please advise