+ Start a Discussion

oncomplete-- commandbutton field


I wrote a custom button which takes to Attachments page --> Attaches the file --> Returns to the previous page

I created a PageReference using URL-- https://na5.salesforce.com/p/attach/NoteAttach  to  Attach File.

Is there a way to check a condition after going to the page and just before saving the file ?

Or atleast

I want to check some condition and delete the records using oncomplete field in <apex:commandButton> but can I use the
method in the custom controller for that or do I need write only Java script function ?

I am facing this problem for 2 days but cud n't find solution so far.

Any help is greatly aprreciated..