You need to sign in to do that
Don't have an account?
Sureka
Issue in Case sensitive Ids in URL
Hi,
I am facing a strange issue in Building a URL:
I have the following URL - where I have two Ids - 00NA0000009yWHr & 00NA0000009yWHR. These are different fields.
But when the fields are rendered in UI, it is just changed to one id . Please help me in resolving the issue.
/a6i/e?00NA0000009yWHr=Created+in+error&00NA0000009yWHR=RKI+Account&retURL=%2F001J000000ZaCxGIAV
/a6i/e?00NA0000009yWHR=RKI+Account&retURL=%2F001J000000ZaCxGIAV
Hello,
Where are you using these ids? How is the url created? A pagereference in a controller? Can you please show a little more code?
Also, have you tried using the 18 char version of the ids? I know, it shouldn't matter since the 15 one is case sensitive... http://www.salesforce.com/us/developer/docs/api/Content/field_types.htm#i1435616
Ty,
Adrian
Hi,
This is my code:
String redirctURL;
Pagereference p;
redirctURL = '/'+ objResult.getKeyPrefix()+'/e?'+'00NA0000009yWHr='+account.Industry__c
+'&00NA0000009yWHR='+account.NewSite
+'&retURL=%2F'+account.Id;
p = new pagereference(redirectURL);
return p;
Above code is rendered as '/021/e?00NA0000009yWHr=NewIndustry&retURL=%2F00100000012A21;
ie. Other Id value is not coming.
Please help me in resolving the issue
Thanks
You're right. I played with your code in the Dev Console and it gives indeed that weird result... I guess the parameters set for a pageReference is not case sensitive.
Anyway, try smth like this in your code and tell me if it works:
Thanks,
Adrian
Hey,
Thanks for the suggestion. I got the following error after using Encoding.
java.lang.IllegalArgumentException: Illegal view ID %2Fa6i%2Fe%3F00NA0000009yWHR%3DRKI+Account%2600NA0000009yWHr%3DCreated+in+error%26retURL%3D001J000000ZaCxGIAV. The ID must begin with /
Thanks
Let's try to tackle this from another angle.
Instead of forming the url in the controller with a PageReference, which as it seems it's not working, let's try to add the url in the page. Add an onclick event to your button or link that references some js redirect code
You'll need to create a getter for the keyprefix and the account. Also comment out or remove the existing PageReference. Change the methods type to void.
Ty,
Adrian
HI
I was looking at your code ,You have written account.NewSite . What is NewSite here?
It seems from syntax It is a standard field of Account, but there is no such field in account.
If this post answers your question please mark it asl solved and give kudos for this post If It helps you
Thanks