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

Hyperlink to visualforce page changes id to lowercase


Im trying to open a VF Page from a formula hyperlink field as follows:
HYPERLINK('/apex/PDFView?id=' +   Id , 'View PDF')
I have also tried:
HYPERLINK('/apex/PDFView?id=' +  CASESAFEID(id) , 'View PDF')

And i always get the following error:
Id value ka426000000000p is not valid for the XXXXX__kav standard controlle

I have noticed that if I set the Id manually on the url bar to kA426000000000p ('A' in upper case) it works fine, as is the Id value when you go into the standard record view.

Any idea about what could be causing this?

Thank you very much!
sharathchandra thukkanisharathchandra thukkani
HYPERLINK('/apex/PDFView?id=' +   Id , 'View PDF') should work.

Id is aslways case sensitive.
sharathchandra thukkanisharathchandra thukkani
HYPERLINK('/apex/PDFView?id=' +  {!ObjectName.Id} , 'View PDF') 
It should work, but it doesn't hehe

The second option is not valid for a formula field.

Thanks for your comments anyway.
Christian Dylan CarterChristian Dylan Carter
How does 
HYPERLINK('/apex/PDFView?id=' +  UPPER(CASESAFEID(id)), 'View PDF')
Rishi Kumar 53Rishi Kumar 53
Use below query to find the mapping of salesforce knowledge Article id from ka and kA.

SELECT Id,KnowledgeArticleId,Language,Type__c ,PublishStatus,Summary,Link__c,Embedded_Video__c,
                                          SystemModstamp,Title,ArticleNumber, CreatedDate,
                                     FROM User_Documents__kav 
                                    WHERE Id ='ka73B0000004C9IQAU'