I have a requirement where I need to provide New Note and New Attachment buttons on a Visualforce page and cannot use the standard related list. Every method I've tried so far has led to an error:
- Using
URLFOR($Action.Note.New)
, but that$Action
does not exist. - A direct link to
/002/e?parent_id=[record id]
, but that gives a "Data Not Available" error message (tried with and without confirmation token) Using an
<apex:commandButton>
where the following controller method provides a redirect also yields "Data Not Available":public PageReference NewNote(){ PageReference redirect = new PageReference('/002/e'); redirect.getParameters().put('parent_id', sfObject.Id); redirect.getParameters().put('retURL', this.ReturnUrl); redirect.setRedirect(true); return redirect; }
Is there any way to invoke the pages for New Note and New Attachments without using the standard related list?