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
JavierPonceJavierPonce 

Hyperlink to visualforce page changes id to lowercase

Hi,

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') 
 
JavierPonceJavierPonce
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')
fare?
Rishi Kumar 53Rishi Kumar 53
Hi,
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,
                                          OwnerId,VersionNumber,FirstPublishedDate,Attachment__Name__s
                                     FROM User_Documents__kav 
                                    WHERE Id ='ka73B0000004C9IQAU'