You need to sign in to do that
Don't have an account?
Regarding document id
Hi,
Iam inserting document in to documents object using custom controller .So once i save the document its saving to document object. After saving i want to dispaly the saved document id in the visualforce page.So how to catch the saved document id in apex controller and then how to pass that id to the vpages and howto display it in visualforce page up on saving the document.please give me any ideas.
If possible please explain me with an example code of doing it .
Thanks and regards,
ANu..
Hi anukarthi,
Below is the code,that will help you.
// *********** you created new document
Document d=new Document();
d.Body=this.theBlob;
d.Name=this.fileName;
d.FolderId='00lS0000000Qjcj';
insert d;
//*********** after insert it , now u have id of this document,using this id you can fetch this document
this.myUrl='https://cs1.salesforce.com/servlet/servlet.FileDownload?file='+d.Id;
The marked url is the fixed format of accessing document, only id is changed.
so provide id of your document (which is u have after inserting document).
I think,this snap of code will help u,if u have more problem,let me know.
Thanks.