Skip to main content

Posts

Showing posts with the label Relative URL for a document

How to get document URL dynamically ?

A we all know sales-force host name (na5,or cs20) used to change from sandbox to production and also when SFDC refresh their server. That is why it is always suggested not to use any hard coded link. Below is code snippet to get document URL dynamically.  //method to send document link       public Static String getDocumentRelativeLink(String documentName){         String documentURL= '';         try{             list<Document> doc = [Select id,Name,SystemModStamp From Document Where Name  = :documentName];             ID docIds = doc[0].id;             documentURL ...