You need to sign in to do that
Don't have an account?
Displaying PICK LIST Values in a single line
Hi All
I need to send a request to another URL
This is my request
endpoint = 'http://api.icentera.com/v1/TestService.svc/json/SearchDocumentsForSF?token='+tokenval+'&search=&sfValues=Industry__c:'+o.Industry__c+'&page=1';
Industry__c is a pick list field which will return values like "Public Safety"
But it should go as "Public+Safety" in the above URL.
How can we make my picklist field value incorporate "+sign" in the space.?
Thanks in advance
then put this revised value in your endpoint link to send.
u can convert a picklist to text by TEXT(Industry__c) function..try it out..
Hello Adil_SFDC,
Its always better to use url encoding while generating a dynamic URL.
Try using EncodingUtil.urlEncode or some other encoding function.
This solved my problem
String pickval = String.valueof(o.Industry__c);
if(pickval!=null)
pickval=pickval.replace(' ','+');
system.debug('--------'+pickval);
endpoint = 'http://api.icentera.com/v1/TestService.svc/json/SearchDocumentsForSF?token='+tokenval+'&search=&sfValues=Industry__c:'+pickval+'&page=1';
I would like to solve this usung urlencode. Any suggestions
When encoding a String, the following rules apply :
1. The alphanumeric characters "a" through "z", "A" through "Z" and "0" through "9" remain the same
2. The special characters ".", "-", "*", and "_" remain the same.
3. The space character " " is converted into a plus sign "+".
4. All other characters are unsafe and are first converted into one or more bytes using some encoding scheme.
Then each byte is represented by the 3-character string "%xy", where xy is the two-digit hexadecimal representation of the byte.
5. The recommended encoding scheme to use is UTF-8.
However, for compatibility reasons, if an encoding is not specified, then the default encoding of the platform is used.
Hi
Can you suggest me an example on how to use encoding.url based on the Url in my question please