Skip to main content

Hello Community!!,

Using SalesDemo, I am trying to add/update One Line item in Appointment Details with ActualQty, having Line type as "Non-Stock Item" through Postman PUT call using the “Appointment” EndPoint.

 

Add Scenario: 

  1. If the ActualQty is not included in the JSON request or if added as null then ActualQty is saving as 1.00 by default.
  2. But when I try to insert any value for ActualQty field I am getting an error as "exceptionMessage": "An error occurred during processing of the field Qty: Specified cast is not valid..".

Update scenario: 

  1. If the ActualQty is not incuded in the JSON request then the other fields are updating with out any error.
  2. If the ActualQty value is null then getting "error": "'BaseEffTranQty' cannot be empty.; 'BaseEffTranQty' cannot be empty.; BaseEffTranQty: 'BaseEffTranQty' cannot be empty.". Tried including the BaseEffTranQty but no fields are udpating.
  3. If the AcutalQty has any value such as 2, 2.0, 2.000000 or “2” then getting an "exceptionMessage": "An error occurred during processing of the field Qty: Specified cast is not valid..". 

 

PUT Callhttp://localhost/SalesDemo/entity/Default/20.200.001/Appointment?$expand=Details

JSON request :
 

{

  "AppointmentNbr": {

    "value": "005807-1"

  },

  "ServiceOrderType": {

    "value": "SUPP"

  },

  "Details": <

    {

      //"id": "269ad423-1798-ee11-aa65-c8f750455784",

      "LineType": {

        "value": "Non-Stock Item"

      },

      "InventoryID": {

        "value": "CARRENT"

      },

      "Description": {

        "value": "Car and vehicle charges"

      },

      "ActualQty": {

        "value": 2.000000

      },

      "BillableQty": {

        "value": 1.000000

      },

      "EstimatedQty": {

        "value": 1.000000

      },

      "note": {

        "value": "Notes for testing from Postman"

      }

    }

  ]

}

 

Thank you.

 

Since ActualQty on this Entity is a Decimal you need to send 2.00m or 2.00M as your value 

This is one of these little tricks from C# and .Net

See this article

https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/floating-point-numeric-types

 


Sorry @Troy Vars, we tried the sloution you were providing but the issue still presists.
Tried with this combinations 2.00m, 2.00M,”2.00m”,”2.00M”.
I think the issues is not realted to literals because as you see the BillableQty and EstimatedQty also decimal types same as the ActualQty these two fields are saving without literals.
 

 


Hi Dinesh, I tried this myself on 20.200.001, 22.200.01 and 23.200.01 all failed.

Then I noticed:

The mapped field for Actual Qty is Qty on the Default 20.200.001 Endpoint, this field is listed as an unspecified data type in the DAC Browser

I extended the Endpoint and the Appointment Entity 

Then Populated Actual Quantity field from Details object

Updated my JSON body with the ActualQuantity field and removed ActualQty

I was then able to add the Line to the appointment as long as it was in status that allow the Actual Quantity to be modified like the In Process Status

from the DAC Schema Browser

and dac class declaration

 


Thank you @Troy Vars, it works as expected, Intially the ActualQty was auto updating to 1.00 for appointments based on status. So I was misguided thinking it was the correct field but after your answer I have updated my Entity and the Acutal Qunatity is updating as expected. 


Thanks a lot...😊 it worked like a charm😁.


Hello @Troy Vars ,

Much appreciated the above solution. Hopefully, Acumatica will update it in the new version.

I tried removing ActualQty field after extending the Appointments entity and it shows X mark but didn’t delete. What additional step I am missing here?

 


Hello Harish!

You need to extend the entity before you can make changes. The red X is telling you it will delete but since the entity isnt extended you cant save your changes.

The extend entity button is at the top of the grid 2 to the right of the X


Hi @Troy Vars ,

The screenshot was incorrect, sorry about that!
I tried after extending the entity and no luck. I think it was blocked in 23.200.001 version. Your thoughts?
 

 


Looks like you cant remove the ActQuantity but can add the ActualQuantity field.

Probably restricted the remove functionalty to only added items...

Tested and yes I was able to remove ActualQuantity but not ActQuantity in 2024R1 and 2023R2

 

 


Reply