Share via


CHALLENGE #4 - Translate Item Descriptions (LEVEL 2)

Scenario

For companies that provide item descriptions in more than one language, storing these descriptions on the item card (via extended text, for example) provides a ready-to-use reference.  As new items are entered, a service would translate the item description into one or more languages and store the translation for reference or use on orders or e-commerce engines.

To complete this challenge, you will need

To complete this challenge, you will need:

Expected result

Steps

  • Create an empty app
  • Create a table extension for the item table and add fields
  • Create a page extension for the item card and add fields
  • Add a Codeunit with a function that translates a text from one language to another.
  • Add a button to the Item card, calling the translate method for all new description fields.

Hints

  • In VS Code, use Ctrl+Shift+P and type AL GO and remove the customerlist page extension
  • Use the ttableext, and the tfieldtext snippet
  • Use the tpageext and the tpagefield snippet
  • Use HttpClient to communicate with the Web Service and use Json types (JsonObject, JsonToken, JsonArray and JsonValue) to build content and extract values from the Web Service result. See /en-us/azure/cognitive-services/translator/reference/v3-0-translate 
  • Use taction snippet and add code to call the translate method

Cheat Sheets

 

Happy coding

Freddy Kristiansen
Technical Evangelist

Passwords: Mahi1776, Koha3443, Mowu5430, Fehy2599, Lesu5260