function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
MonaliDMonaliD 

URLFOR in apex

Hi

 

Can we use URLFOR function in apex or is there any equivalent to it?

I want to create URLFOR expression dynamicaly

Something like this

URLFOR($Action.ArticleType .FileFieldDownload,ArticleId,[field = $ObjectType.ArticleType .fields.Files__Body__s.name] )

where ArticleType and articleId will vary

 

 

Thanks,

Monali

  

IspitaIspita

You must be aware for the final generated URL? Aren't you , then probably you can use your custom login to generate dynamic URL as suggested by you.

 

 

  public PageReference save() {
         insert ords;
        PageReference parrec = new PageReference('​/'+ parOrd.id);
        parrec.setRedirect(true);
        return parrec; }

UVUV

Go through this Link to understand the URLFOR functionality-

http://salesforcesource.blogspot.com/2008/12/urlfor-function-finally-explained.html

 

Regards,

UV