Challenge #4 – Translate Item Descriptions

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.

Expected result

Click image to see animation:Challenge #4

Pre-requisites

To complete this challenge, you will need:

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 https://docs.microsoft.com/en-us/azure/cognitive-services/translator/reference/v3-0-translate
  • Use taction snippet and add code to call the translate method

Cheat Sheets

Enjoy

Freddy Kristiansen

Passwords: Mahi1776, Koha3443, Mowu5430, Fehy2599, Lesu5260

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s