Skip to main content
Solved

Generating Bill with status "Balanced" via REST requests


Forum|alt.badge.img+2
  • Varsity I
  • 279 replies

 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

Best answer by jinin

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?

View original
Did this topic help you find an answer to your question?

14 replies

jinin
Pro I
Forum|alt.badge.img+11
  • Pro I
  • 659 replies
  • December 21, 2021

HI @Ivan 

Can you please share the request to review?


Forum|alt.badge.img+2
  • Author
  • Varsity I
  • 279 replies
  • December 21, 2021
jinin wrote:

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"

      }

    }

  ]

}

 


jinin
Pro I
Forum|alt.badge.img+11
  • Pro I
  • 659 replies
  • December 21, 2021

Thanks @Ivan . Will check and update you.


jinin
Pro I
Forum|alt.badge.img+11
  • Pro I
  • 659 replies
  • December 21, 2021

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"

        }

    }

}


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3375 replies
  • December 21, 2021

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.


Forum|alt.badge.img+2
  • Author
  • Varsity I
  • 279 replies
  • December 21, 2021
jinin wrote:

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


Forum|alt.badge.img+2
  • Author
  • Varsity I
  • 279 replies
  • December 21, 2021
Naveen B wrote:

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

 


jinin
Pro I
Forum|alt.badge.img+11
  • Pro I
  • 659 replies
  • December 21, 2021
Ivan wrote:
jinin wrote:

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?


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3375 replies
  • December 21, 2021

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.

 


Forum|alt.badge.img+2
  • Author
  • Varsity I
  • 279 replies
  • December 21, 2021
Naveen B wrote:

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 


Forum|alt.badge.img+2
  • Author
  • Varsity I
  • 279 replies
  • December 21, 2021
jinin wrote:
Ivan wrote:
jinin wrote:

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


jinin
Pro I
Forum|alt.badge.img+11
  • Pro I
  • 659 replies
  • December 21, 2021

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": []

}


Forum|alt.badge.img+2
  • Author
  • Varsity I
  • 279 replies
  • December 21, 2021
jinin wrote:

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


jinin
Pro I
Forum|alt.badge.img+11
  • Pro I
  • 659 replies
  • Answer
  • December 22, 2021

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings