Skip to main content

Notifications

Supply chain | Supply Chain Management, Commerce
Suggested answer

Odata PATCH fails with double-encoded forward-slash

Posted on by 20
01T12:00:00Z,RouteId='ROUT0003938',ProductSizeId='HB65',ProductColorId='SP100',ProductionSiteId='85',ProductConfigurationId='219875',ProductStyleId='3',ItemNumber='HIDN-TED200%252F2-SLV')?cross-company=true
 
Note: ExpRouteVersions is a custom entity built by the company I work for - it's in our custom F&O model.
 
Please note that you don't need to do an actual PATCH to repro this. You can simply copy/paste that URL into the address bar of a browser and see the same error.
 
Now contrast the URL above with the following URL, which is structurally identical to the one above, but this one is successful: https://HIDDEN.sandbox.operations.dynamics.com/data/ExpRouteVersions(dataAreaId='ita',ValidFromQuantity=1,ValidFromDate=1900-01-01T12:00:00Z,RouteId='ROUT0000805',ProductSizeId='HB',ProductColorId='SP100',ProductionSiteId='85',ProductConfigurationId='217566',ProductStyleId='3',ItemNumber='HIDN-TED300_3')?cross-company=true
 
I believe the problem is data related. Please notice the ItemNumber value for each. For the non-working URL, the value contains a double-encoded forward-slash (/): HIDN-TED200%252F2-SLV If you double-decode /HIDN-TED200%252F2-SLV/ you will get the following: /HIDN-TED200/2-SLV/ (notice the forward-slash). That unescaped slash character is illegal and must be double-encoded to work. But in this case it is throwing this error:
 

Bad Request - Invalid URL


HTTP Error 400. The request URL is invalid.

This customer likes to put slashes in their F&O items, which has caused difficulty for our VAR solution. But in the past we have always been able to solve the problem by double-encoding the slash. In this case, however, F&O chokes on it.
 
Any ideas?
  • Community member Profile Picture
    Community member 20 on at
    Odata PATCH fails with double-encoded forward-slash
    Layan, single-encoding doesn't work. Even in the post/link you posted it is stated that special characters must be double-encoded.
  • Suggested answer
    Layan Jwei Profile Picture
    Layan Jwei 7,316 Super User 2024 Season 2 on at
    Odata PATCH fails with double-encoded forward-slash
    Hi Community member,
     
    In general, It seems / is equivalent to %252F
    And you already tried that, so maybe try %2f

    Check out this old thread if it helps 

    Just to confirm, this is ur exact item number in d365fo right? HIDN-TED200/2-SLV
     
    Please mark this answer as "Verified" if it solved your issue. In order to help others who will face a similar issue in the futur

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Complete!

🔔 Be sure to subscribe to the new forums you are interested in to stay up to date! 🔔

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,113 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,918 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans