Skip to main content

Notifications

Supply chain | Supply Chain Management, Commerce
Suggested answer

Nice Label JSON escape character

Posted on by 14
Hello Community,
 
Looking to see if there is a method to replace/remove the JSON escape characters (",/).
 
To reproduce
  • Warehouse management > Setup > Document routing > Label layout
  • Set Label layout type = License Plate Label
  • Under Data variables
    • Set Variable name
    • Set Value (with the escape characters replaced/removed)
 
  • Nice Label JSON escape character
    These classes are internal, unfortunately.
    Ideally, you could raise an extensibility request to Microsoft and submit it as a bug (i.e., it should be possible to select the formatting when configuring the label layouts).

    But until the request is processed, since it's hard-coded, you will have to write your own display method to handle the escaping.
  • CA-08101231-0 Profile Picture
    CA-08101231-0 14 on at
    Nice Label JSON escape character
    Thanks Jonas.
     
    I dug a little further through the code and Microsoft is hard coding the format when creating the translation from the values.
     
  • Suggested answer
    Anton Venter Profile Picture
    Anton Venter 18,669 Super User 2024 Season 2 on at
    Nice Label JSON escape character
    Escaping the " character is better than removing it. It should be possible with a small customization.
     
     
     

    ​​​​​​​
     
  • Suggested answer
    Nice Label JSON escape character
    I see. It can be problematic having quotation marks (") in item names.
    Is it out of the question to change the item name?

    I was about to recommend using custom formats, but it seems that this approach is limited when it comes to strings. See here for more information: Document routing label layouts - Supply Chain Management | Dynamics 365 | Microsoft Learn

    I'm afraid that my best answer is to create a display method on the WHSLicensePlateLabel table that escapes the quotation marks, and then you can add that method as an attribute.
     
  • CA-08101231-0 Profile Picture
    CA-08101231-0 14 on at
    Nice Label JSON escape character
    Our current dilemma is that we require the Item Name on the LP label. Example of an item = 1/4" pipe 
     
    With the layout of the label as below, the JSON created results in
    "Variables": [
    {
                    "ItemId": "1000-0934",
                    "ItemIdBC": "1000-0934",
                    "ItemName": "1/4" Pipe",
        }
    ]
    Thus, causing an error when sending.
     
  • Nice Label JSON escape character
    I don't recall having seen a parameter that can do this, I'm afraid you are looking into making a customization.
    But it sounds a bit odd... Can you share some of the label file with the escape character present?

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... 290,900 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,297 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans