Solved

Creating Check via API


  Version: {
AcumaticaBuildVersion: 22.114.0029,
OemBuildVersion: 2022.114.203.2690,
DatabaseVersion: 2022.114.203.2690
},

PUT: /entity/Default/20.200.001/Check

{
"Vendor": {
"Value": "A1",
"Error": null
},
"PaymentMethod": {
"Value": "AUTODISBUR",
"Error": null
},
"CashAccount": {
"Value": "100010",
"Error": null
},
"PaymentRef": {
"Value": "8ed73344409a4a6f84afcf846f3bbc84",
"Error": null
},
"ApplicationDate": null,
"Description": {
"Value": "[Fleet Batch: 000001]",
"Error": null
},
"PaymentAmount": {
"Value": 486.94,
"Error": null
},
"Status": null,
"ReferenceNbr": null,
"Type": null,
"Details": [
{
"DocType": {
"Value": "Bill",
"Error": null
},
"ReferenceNbr": {
"Value": "207668",
"Error": null
},
"AmountPaid": null,
"Id": null,
"RowNumber": null,
"LastModifiedDateTime": null,
"Note": null,
"Error": null
}
],
"Id": null,
"RowNumber": null,
"LastModifiedDateTime": null,
"Note": null,
"Error": null
}

returns

{
"id": "a1e17e0a-c8f2-ed11-ab3d-0a64d1455776",
"rowNumber": 1,
"note": {
"value": ""
},
"ApplicationDate": {
"value": "2023-05-15T00:00:00+00:00"
},
"CashAccount": {
"value": "100010"
},
"CurrencyID": {
"value": "AUD"
},
"Description": {
"value": "[Fleet Batch: 000001]"
},
"Details": [],
"Hold": {
"value": false
},
"LastModifiedDateTime": {
"value": "2023-05-15T02:27:41.374419+00:00"
},
"PaymentAmount": {
"value": 486.94
},
"PaymentMethod": {
"value": "AUTODISBUR"
},
"PaymentRef": {},
"ReferenceNbr": {
"value": "095825"
},
"Status": {
"value": "Balanced"
},
"Type": {
"value": "Check"
},
"UnappliedBalance": {
"value": 0.00
},
"Vendor": {
"value": "A1"
},
"custom": {}
}

The issue I’m having is that the PaymentRef value is not being stored on the Check when it’s created.

When I create a check manually via the UI, when I select the Vendor, if the Payment Ref field has a value, it’s cleared due to the default payment method being EFT.

The EFT payment method requires additional processing to use the Batch Payment process. This uses the Payment Ref field to store a check number so it’s not editable in the UI.

The AUTODISBUR payment method used for this check does not require additional processing and is configured to require a Unique Payment Ref.

If the remove the default Payment Method for the Vendor, the Payment Ref is saved successfully.

Is there a way that I can get the Payment Ref to be set on the check with the value passed in the request without removing the default payment method for the Vendor?

icon

Best answer by RohitRattan88 17 May 2023, 22:38

View original

5 replies

Userlevel 7
Badge +4

@anthonykeller79  not sure but something you could check is maybe limit your RefNbr to 15 character as per DAC definition:

/// <summary>
/// [key] Reference number of the document.
/// </summary>
[PXDBString(15, IsUnicode = true, IsKey = true, InputMask = "")]
[PXDefault()]
[PXUIField(DisplayName = "Reference Nbr.", Visibility = PXUIVisibility.SelectorVisible, TabOrder = 1)]
 

Maybe test and see if it helps.

Thanks for the suggestion, however, the PaymentRef is a different field to the one you mentioned. Additionally, if I remove the default payment method from the Vendor, the PaymentRef is successfully saved against the Check.

When the Vendor has a default payment method of EFT (which is configured with additional processing to use Batch Payments), in the UI, the field is not editable because the value is set to the Check number during the processing stage.

Userlevel 7
Badge +4

@anthonykeller79 I see. anything I try to do using APIs, I first try to do same process with UI just to make sure the behavior is same. But you mentioned that the field you are trying to update is not enable/editable in UI, if thats the case, i dont think you will be able to set it using API either

@RohitRattan88 correct, however, it’s only read-only when the payment method is EFT. In this case, the vendor has a default payment method of EFT, however, this request is specifying a payment method to AUTODISBUR which allows the PaymentRef to be entered via the UI.

The issue is - the API appears to be trying to set the PaymentRef before it sets the PaymentMethod which is preventing the update.

When I remove the default payment method for the vendor, the API works as expected and the PaymentRef is set.

It appears the solution is to remove the default payment method for all vendors.

Userlevel 7
Badge +4

@anthonykeller79 I see.

If you are able to do this in UI but not with APIs, I believe it is good candidate for review by our support/engineering.

I suggest to create a Dev support case for further review and if it is a bug it will be considered for fix for future development.

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