Specify All Localized Values of a Multilingual Field
For some text boxes on MYOB Acumatica forms, users can type values in multiple languages if multiple locales are configured in MYOB Acumatica. For example, if your MYOB Acumatica instance has the English and French locales activated and multilingual user input configured, you can specify the value of the Description box on the Stock Items (IN202500) form in English or French.
This topic describes a way to specify all localized values of a multilingual field. However, we recommend that you use another way that allows you to specify any number of localized values of a multilingual field (see Specify Any Number of Localized Values of a Multilingual Field).
HTTP Method and URL
To specify all localized values of a multilingual field of a record that you create or
update in MYOB Acumatica, you use the PUT
HTTP method and the following URL.
PUT http://<Base endpoint URL>/<Top-level entity>
<Base endpoint URL>
is the URL of the contract-based endpoint through which you are going to work with MYOB Acumatica. This URL has the following format:http://<MYOB Acumatica instance URL>/entity/<Endpoint name>/<Endpoint version>/
.<Top-level entity>
is the name of the entity for which you are going to create a record.
For example, suppose that you want to create a stock item record in a local MYOB Acumatica instance with the name AcumaticaDB by using the system endpoint with the name Default and Version 23.200.001. You should use the following URL to create a record.
PUT http://localhost/AcumaticaDB/entity/Default/23.200.001/StockItem
Parameters
For information on the request parameters, see the Parameters section of Create a Record and the Parameters section of Update a Record.
Request Headers
For the information on HTTP headers to use, see Create a Record or Update a Record depending on the operation you perform (creation or update of a record).
Request Body
In the HTTP body, you specify values in the following format:
[{language_code1:value1},{language_code2:value2},...]
. As the language code,
you use the two-letter ISO code of the language with which the value should be associated.
Response Status Codes
The following table lists the HTTP status codes that the system returns for a request that creates a record.
Code | Description |
---|---|
200 | The request has been completed successfully. The response of a successful method call contains the created record in JSON format in the response body. The response includes only the values of the fields of the created record that were specified during creation of the record or that were specified to be returned by using the parameters of the request. |
400 | The data specified in the request is invalid. |
401 | The user is not signed in to the system. |
403 | The user has insufficient rights to access the MYOB Acumatica form that corresponds to the entity. |
412 | You have used the If-None-Match header with the * value, and the record already exists. |
422 | The data specified in the request is invalid and the validation errors are returned in the error fields of the response body, as in the following example.
|
429 | The number of requests has exceeded the limit imposed by the license (see License Restrictions for API Users). |
500 | An internal server error has occurred. |
Example
In the example that is mentioned at the beginning of the topic, if you need to specify values
in English and French in the Description box on the Stock Items form, you
specify the value of the Description field of the
StockItem entity in the following format: [{en:English
description},{fr:French description}]
. See below for an example of a stock item
record with localized Description field values.
<MYOB Acumatica instance URL>
is the URL of the MYOB Acumatica
instance (such as https://my.acumatica.com/MyInstance). You can omit the instance
name in the URL (that is, you can use https://my.acumatica.com) if the instance
is installed in the root of the website.PUT / HTTP/1.1
Host: [<Acumatica ERP instance URL>]/entity/Default/23.200.001/StockItem
Accept: application/json
Content-Type: application/json
{
"InventoryID" : {"value" : "BASESERV" },
"ItemClass" : {"value" : "COMPUTERS" },
"Description" : {"value" : "[{en:Item},{fr:Pièce}]" }
}
Usage Notes
In the payload, you should specify the actual values of the field in all languages that are
configured for multilingual user input. If you specify the values of the field in particular
languages, the values of the field in other languages configured for multilingual user input
become empty. For example, suppose that in your instance of MYOB Acumatica, multilingual fields can have values in English and French. If you pass the value of a
field in the following format [{en:English description}]
, the French value
of the field becomes empty.
If you specify the value of a multilingual field as plain text, this text is saved as the value of the corresponding box in the default language of MYOB Acumatica. For details on how to specify the default language, see Setting Up Languages.