Redirect To Standard New Note & New Attachment Pages Using Apex
Redirect to New Attachment:
public PageReference redirectToNewAttachment() { PageReference pgRef = new pageReference('/p/attach/NoteAttach?pid=' + String.valueof(acc.Id).subString(0, 15) + '&retURL=' + acc.Id); pgRef.setRedirect(true); return pgRef; }
Redirect to New Note:
public PageReference redirectToNewNote() { PageReference pgRef = new pageReference('/002/e?parent_id=' + String.valueof(acc.Id).subString(0, 15) + '&retURL=' + acc.Id); pgRef.setRedirect(true); return pgRef; }