cancel
Showing results for 
Search instead for 
Did you mean: 

URL Encoding in fiori master detail application

former_member187272
Participant
0 Kudos

Hi experts,

I am developing a fiori master detail application,i have to pass my customer name in url as parameter,my customer name include '/' character(Eg:M/s Robin James) .So when i pass this through my url it is not working since it contain '/',My plan is encode and pass url.How can i do it with my fiori application or can you suggest any other methods to resolve this problem

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

saurabh_vakil
Active Contributor

You can also just replace the forward slash '/' with the value %2F in the customer name and then pass it on to the URL. In case of other special characters except ~!$*()_'/\ you can use the encodeURIComponent() function.

Answers (1)

Answers (1)

saurabh_vakil
Active Contributor

Hi,

You can use the JavaScript function encodeURIComponent() and pass the customer as parameter to this function. The result will be encoded value which you can then pass as a parameter in your URL.

For e.g.,


var encodedVal = encodeURIComponent("Your/Customer/Name"); //this will result in an encoded value like Your%2FCustomer%2FName

Use the encodedVal variable to pass the value in your URL as parameter.

Regards,

Saurabh

former_member187272
Participant
0 Kudos

Hi

Thanks for your Answer,It is not working with customer name with  '/',but i can encode all other customer names

Thanks

Message was edited by: Shahid kakkkattummal

saurabh_vakil
Active Contributor
0 Kudos

Hi,

The example shown here converts the forward slash in the URL to its encoded value %2F

Tryit Editor v2.6

Regards,

Saurabh