Skip to main content
Answer

Compliance Management API

  • April 5, 2023
  • 8 replies
  • 225 views

Forum|alt.badge.img
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

 

Best answer by AndrewMuzalov

@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!

 

8 replies

Vignesh Ponnusamy
Acumatica Moderator
Forum|alt.badge.img+5

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, 


Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • April 5, 2023

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? 


Vignesh Ponnusamy
Acumatica Moderator
Forum|alt.badge.img+5

@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,


Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • April 10, 2023

@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?

 


Vignesh Ponnusamy
Acumatica Moderator
Forum|alt.badge.img+5

@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.


Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • April 13, 2023

@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 :)))

Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • Answer
  • April 25, 2023

@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!

 


Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • April 25, 2023

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