Quantcast
Channel: Acumatica Singapore
Viewing all articles
Browse latest Browse all 110

REST based WEB Service. Using the Note field Correctly.

$
0
0

Hi Everyone,


Here is a tutorial on how to set/update the note field for records.

Setting a note value
To set a note value by the contract-based REST API, do the following:
  1. Retrieve the record in question
    1. Set your contract-based REST API request with the following settings:
  • HTTP method: GET
  • URL: https://<entity>/Default/<endpoint version>/<endpoint name>/<record name>
  • No parameters for request
  • Headers:
    • Accept -> application/json
    • Content-Type -> application/json
  • Send the request. The response contains 200 OK status. The body of the response includes the list of fields of the record in JSON format. The following is an example
  • {"id":"e72ca73d-ffcf-4b96-a07b-54988f9cd632","rowNumber":1,"note":"","CountNbr":{"value":"FCN000021" },"Details":[...],"custom":{},"files":[]}
  • Save the request
  • Update the note field
    1. Set your contract-based REST API request with the following settings:
    • HTTP method: PUT
    • URL: https://<entity>/Default/<endpoint version>/<endpoint name>/<top-level record name>
    • No parameters for request
    • Headers:
      • Accept -> application/json
      • Content-Type -> application/json
    • Body of the request (where NOTECONTENT should be the note):
    • {"id":"e72ca73d-ffcf-4b96-a07b-54988f9cd632","note":"NOTECONTENT",}OR{"CountNbr":{"value":"FCN000021" },"note":"NOTECONTENT",}
  • Send the request. If the request is successful, the response contains the 200 OK status code and includes the list of updated records in JSON format. The following is an example
  • {"id":"e72ca73d-ffcf-4b96-a07b-54988f9cd632","rowNumber":1,"note":"NOTECONTENT","CountNbr":{"value":"FCN000021" },"Details":[...],"custom":{},"files":[]}
      Important information to remember

      • Make sure to always specify the note parameter to the note value, even when it is not being changed, as otherwise the note will be set to a empty string. This goes for all PUT requests



        Viewing all articles
        Browse latest Browse all 110

        Trending Articles



        <script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>