Solved

Compliance Management API

  • 5 April 2023
  • 8 replies
  • 129 views

Userlevel 2
Badge
Has anyone come across - is it possible to add a document to this page using Rest API. Which API entity can be used for this. I tried to find a separate document or find a link to the vendor, but I can't find it. The vendor can expand the api using the WebService Endpoint, but there the work is carried out not with a collection of documents, but with one - and there is a warning that the documents must be requested one at a time and not included in the upload, the message is not clear what is available and how to do with this. Does anyone have experience with this entity using Rest API, I will be glad for any ideas

 

icon

Best answer by AndrewMuzalov 25 April 2023, 22:24

View original

8 replies

Userlevel 7
Badge +4

Hi @AndrewMuzalov,

In these cases, instead of using filter like below to fetch the specific Vendor and expanding the Compliance entity,

<<Instance URL>>/entity/DefaultExt/22.200.001/Vendor?$filter=VendorID eq 'AASERVICES'&$expand=Compliance

 

You need to point directly to the vendor using VendorID(the key field of the screen) like below then you can expand the Compliance entity

<<>Instance URL>/entity/DefaultExt/22.200.001/Vendor/AASERVICES?$expand=Compliance

 

I hope that helps.! Thanks, 

Userlevel 2
Badge

Hi @AndrewMuzalov,

In these cases, instead of using filter like below to fetch the specific Vendor and expanding the Compliance entity,

<<Instance URL>>/entity/DefaultExt/22.200.001/Vendor?$filter=VendorID eq 'AASERVICES'&$expand=Compliance

 

You need to point directly to the vendor using VendorID(the key field of the screen) like below then you can expand the Compliance entity

<<>Instance URL>/entity/DefaultExt/22.200.001/Vendor/AASERVICES?$expand=Compliance

 

I hope that helps.! Thanks, 

As I understood correct it works with get data from Acumatica - Do you know does it works with save data? Can I save several Compliance records by API to vendor? 

Userlevel 7
Badge +4

@AndrewMuzalov, I missed to respond that in my previous response.

Yes, you should be able to save using a PUT request, below is a sample request payload you can try,

{

    "VendorID": {

        "value": "AASERVICES"

    },

    "Compliance": [

        {

            "DocumentType": {

                "value": "Certificate"

            },

            "ReceivedfromVendor": {

                "value": true

            }

        },

        {

            "DocumentType": {

                "value": "Other"

            },

            "Required": {

                "value": true

            }

        }

    ]

}

 

You can update the VendorID that is available in your instance. Thanks,

Userlevel 2
Badge

@AndrewMuzalov, I missed to respond that in my previous response.

Yes, you should be able to save using a PUT request, below is a sample request payload you can try,

***

You can update the VendorID that is available in your instance. Thanks,

It still don’t work for me and I can’t find the reason. I tried to extend the endpoint for  versions 20 and used 22 endpoints (default and ecomerce)  - result is the same for all cases - I am getting an error:  "The given key was not present in the dictionary." when I try to get Compliance  ***/entity/eCommerce/22.200.001/Vendor/VND0000001?$expand=Compliance.

 

When I try to save data with put method  ***/entity/DefaultTest/20.200.001/Vendor - save successfully but any data change in Acumatica - it seems Acumatica just skip these changes

If I am trying extend vendor entity with complience fields I get this error: “More than one entity satisfies the condition.”

For example Payment model has extension ApplicationHistory and I can get this info from API

but Vendor’s model don’t has may be I need extend Vendor model for Compliance?

Are there any ideas what is wrong I am doing?

 

Userlevel 7
Badge +4

@AndrewMuzalov yes, from initial discussion description, I assumed you extended the Vendor entity, 

Yes, you can extended the Vendor endpoint add the Compliance entity as a Detail entity, then maps all the required field there. Below is the screenshot of my setup,

 

Please let me know if you have any questions.

Userlevel 2
Badge

@AndrewMuzalov yes, from initial discussion description, I assumed you extended the Vendor entity, 

Yes, you can extended the Vendor endpoint add the Compliance entity as a Detail entity, then maps all the required field there. Below is the screenshot of my setup,

 

Please let me know if you have any questions.

this is exactly what I want to achieve, but I can’t add Compliances to vendors, I only add Compliances fields to the vendor itself - apparently I’m doing something wrong when expanding the vendor model. Thank you for showing this screenshot, now I know that it is definitely possible, I just need to undesrtand why it dosen’t work for me :)))
Userlevel 2
Badge

@AndrewMuzalov yes, from initial discussion description, I assumed you extended the Vendor entity, 

Yes, you can extended the Vendor endpoint add the Compliance entity as a Detail entity, then maps all the required field there. Below is the screenshot of my setup,

 

Please let me know if you have any questions.

this is exactly what I want to achieve, but I can’t add Compliances to vendors, I only add Compliances fields to the vendor itself - apparently I’m doing something wrong when expanding the vendor model. Thank you for showing this screenshot, now I know that it is definitely possible, I just need to undesrtand why it dosen’t work for me :)))

I found how it can be added. May be it can be helpful someone else, it wasn’t clear for me previously. In the first I selected Vendor entity in the list and clicked button “insert”:

Then I filled Create Entity modal window:

After save “Compliance” detail appeared for vendor entity and then I populated fields exactly Compliance - not vendor

An now I can get compliance data by Postman:

 

@vigneshponnusamy89    Thanks for help wit it!

 

Userlevel 7
Badge

Thank you for sharing your solution with the community @AndrewMuzalov !

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved