Solved

Generating Bill with status "Balanced" via REST requests

  • 21 December 2021
  • 14 replies
  • 456 views

Userlevel 4
Badge +2

 Hi,

The aim of this case is to identify how to form REST request properly in order to create Bill with status "Balanced"

Our client is using our application, which creates requests and put data to Acumatica. Client asked if we can  create invoices with status "Balanced". I checked such request with our Test Acumatica environment and it was easy to implement. 

My request successfully worked and created Bill in Acumatica with status "Balanced" 

However, when we do same request with client's Acumatica we get this error : 

 "exceptionMessage": "Bill.CashDiscountDate: 'Cash Discount Date' cannot be empty.\nBill.DueDate: 'Due Date' cannot be empty.\nBill.LocationID: 'Location' cannot be empty.\nBill.Terms: 'Terms' cannot be empty.\nBill.Vendor: 'Vendor' cannot be empty.\nBill.VendorRef: 'Vendor Ref.' cannot be empty.\nInserting 

I searched and found that this error is caused by this field

When I removed it from the request it successfully worked.

My question is : what is the possible difference between our Acumatica and client's Acumatica,

because as I mentioned above same requests with Hold field are working with our system, while during

work with client's Acumatica we get this error, but when we remove "Hold" field from the request, it perfectly works

and creates Bill in system.

I also searched and found that it can be achieved by setting “Hold Documents on Entry” checkbox to false value on the “AP Preferences” (AP101000), but it did not help.

I checked client's endpoint, all fields that we need to work with are present. 

What should be done to make it work with client's Acumatica same as with our environment ?

Kindest regards

icon

Best answer by jinin 22 December 2021, 08:21

View original

14 replies

Userlevel 7
Badge +11

HI @Ivan 

Can you please share the request to review?

Userlevel 4
Badge +2

HI @Ivan 

Can you please share the request to review?

Hi Jinin,

Sure 

{

  "VendorRef": {

    "value": "12"

  },

  "Description": {

    "value": "docAlpha BatchID \"1008\""

  },

  "Vendor": {

    "value": "0000002346"

  },

  "Date": {

    "value": "12/03/2021"

  },

  "Hold": { "value": false },

  

  "PostPeriod": {

    "value": "12-2021"

  },

  "Type": {

    "value": "Bill"

  },

  "Details": [

    {

      "InventoryID": {

        "value": "321"

      },

      "Description": {

        "value": "123"

      },

      "Branch": {

        "value": "TIGER"

      },

      "POOrderNbr": {

        "value": "PO00987543"

      },

      "POReceiptNbr": {

        "value": "054300"

      },

      "UOM": {

        "value": "EA"

      },

      "ExtendedCost": {

        "value": "117.51"

      },

      "Qty": {

        "value": "1.0"

      },

      "UnitCost": {

        "value": "117.51"

      },

       "POReceiptLine": {

        "value": "1"

      },

      "rowNumber": {

        "value": "1"

      }

    }

  ]

}

 

Userlevel 7
Badge +11

Thanks @Ivan . Will check and update you.

Userlevel 7
Badge +11

Hi @Ivan 

I tested with the same Request and working fine for me too. Not sure exactly what happened with your client instance.

We can try with an alternate to resolve the issue. Once the Bill is created,  can you make one more API call to Remove the hold check box?

Sample code:

Url:  /entity/Default/20.200.001/Bill/ReleaseFromHold

Method :  POST

Request:
 

{

    "entity": {

        "Type": {

            "value": "Bill"

        },

        "ReferenceNbr": {

            "value": "002939"

        }

    }

}

Userlevel 7
Badge +17

Hi @Ivan  Since you are saying that above JSON request is working as expected in you local machine, is there any other customizations deployed in Client instance but NOT present in your local machine?

I hope you are working in 21 R1/21 R2/ 22 R1 version, and this version, Acumatica has introduced a new action “REMOVE HOLD” to change the status from the HOLD to BALANCED. We can not directly make Hold = false from the API request.

 

To Remove from Hold, you need to make another API call to invoke the REMOVE HOLD action to change it to BALANCED status.

Userlevel 4
Badge +2

Hi @Ivan 

I tested with the same Request and working fine for me too. Not sure exactly what happened with your client instance.

We can try with an alternate to resolve the issue. Once the Bill is created,  can you make one more API call to Remove the hold check box?

Sample code:

Url:  /entity/Default/20.200.001/Bill/ReleaseFromHold

Method :  POST

Request:
 

{

    "entity": {

        "Type": {

            "value": "Bill"

        },

        "ReferenceNbr": {

            "value": "002939"

        }

    }

}

I tried this request with Client’s Acumatica and that worked. But we need to do that with help of one request. By this approach that you have introduced we will need 2 steps : 1)Bill creation 2)Remove Hold

Maybe you can suggest what settings we can check ? We asked our client what modifications they performed to their system, but they do not know

Userlevel 4
Badge +2

Hi @Ivan  Since you are saying that above JSON request is working as expected in you local machine, is there any other customizations deployed in Client instance but NOT present in your local machine?

I hope you are working in 21 R1/21 R2/ 22 R1 version, and this version, Acumatica has introduced a new action “REMOVE HOLD” to change the status from the HOLD to BALANCED. We can not directly make Hold = false from the API request.

 

To Remove from Hold, you need to make another API call to invoke the REMOVE HOLD action to change it to BALANCED status.

Hi Naveen B

We asked our client what modifications they performed to their system, but they do not know. Maybe you can suggest what settings we can check ? I found this topic - 

And tried to do what was suggested. I set “Hold Documents on Entry” = false, but it did not help. Also it was suggested to set Automatically Release Retainage Bills flag = false, but I can not find this tab  “Release AP Retainage”. 

 

Userlevel 7
Badge +11

Hi @Ivan 

I tested with the same Request and working fine for me too. Not sure exactly what happened with your client instance.

We can try with an alternate to resolve the issue. Once the Bill is created,  can you make one more API call to Remove the hold check box?

Sample code:

Url:  /entity/Default/20.200.001/Bill/ReleaseFromHold

Method :  POST

Request:
 

{

    "entity": {

        "Type": {

            "value": "Bill"

        },

        "ReferenceNbr": {

            "value": "002939"

        }

    }

}

I tried this request with Client’s Acumatica and that worked. But we need to do that with help of one request. By this approach that you have introduced we will need 2 steps : 1)Bill creation 2)Remove Hold

Maybe you can suggest what settings we can check ? We asked our client what modifications they performed to their system, but they do not know

 @Ivan    Which Acumatica version you are using?

Userlevel 7
Badge +17

Hi @Ivan  In Accounts Payable Preferences screen → Uncheck the Hold Documents on Entry checkbox, so that by default status will BALANCED. You can avoid the second API call.

 

Userlevel 4
Badge +2

Hi @Ivan  In Accounts Payable Preferences screen → Uncheck the Hold Documents on Entry checkbox, so that by default status will BALANCED. You can avoid the second API call.

 

I mentioned in case description that I tried that and it did not help 

Such behavior we get only with client’s system. There must be some configuration settings that provoke this but we do not know what definitely it is 

Userlevel 4
Badge +2

Hi @Ivan 

I tested with the same Request and working fine for me too. Not sure exactly what happened with your client instance.

We can try with an alternate to resolve the issue. Once the Bill is created,  can you make one more API call to Remove the hold check box?

Sample code:

Url:  /entity/Default/20.200.001/Bill/ReleaseFromHold

Method :  POST

Request:
 

{

    "entity": {

        "Type": {

            "value": "Bill"

        },

        "ReferenceNbr": {

            "value": "002939"

        }

    }

}

I tried this request with Client’s Acumatica and that worked. But we need to do that with help of one request. By this approach that you have introduced we will need 2 steps : 1)Bill creation 2)Remove Hold

Maybe you can suggest what settings we can check ? We asked our client what modifications they performed to their system, but they do not know

 @Ivan    Which Acumatica version you are using?

2020R1

Userlevel 7
Badge +11

Hi @Ivan 

I tested same in 2020R1 instance also. Not getting any error. 

Can you try with only header section and check once ? we can make sure that the issue is not related to the line item. 

sample request:

{

    "VendorRef": {

        "value": "12"

    },

    "Description": {

        "value": "docAlpha BatchID \"1008\""

    },

    "Vendor": {

        "value": "ATDSECUR"

    },

    "Date": {

        "value": "12/03/2021"

    },    

    "Hold": {

        "value": true

    },

    "PostPeriod": {

        "value": "12-2021"

    },

    "Type": {

        "value": "Bill"

    },

    "Details": []

}

Userlevel 4
Badge +2

Hi @Ivan 

I tested same in 2020R1 instance also. Not getting any error. 

Can you try with only header section and check once ? we can make sure that the issue is not related to the line item. 

sample request:

{

    "VendorRef": {

        "value": "12"

    },

    "Description": {

        "value": "docAlpha BatchID \"1008\""

    },

    "Vendor": {

        "value": "ATDSECUR"

    },

    "Date": {

        "value": "12/03/2021"

    },    

    "Hold": {

        "value": true

    },

    "PostPeriod": {

        "value": "12-2021"

    },

    "Type": {

        "value": "Bill"

    },

    "Details": []

}

I did as you suggested and result remains the same. With “Hold” field I receive error, when I remove it from the request everything is ok

Userlevel 7
Badge +11

Hi @Ivan 

Am not sure we have any other setting to make the Hold checkbox as checked or unchecked. It may be due to customization issue.

In the client instance, If published any packages, can you unpublish and try once?

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