Solved

When creating a Sales Order, RequestedOn date is not creating correctly


Hi, 

I am able to successfully create a Sales Order and all of the customer data, line item data etc. is correct except for RequestedOn date. It seems to be auto-assigning to the day before delivery based on the delivery Route assigned to the customer. Even if I put the RequestedOn date weeks in the future, it still assigns to the day before the next delivery route is scheduled. 

This is what my JSON Request Body looks like: 

  {
"OrderNbr": {
"value": "<NEW>"
},
"OrderType": {
"value": "SO"
},
"CustomerID": {
"value": "XXXXX"
},
"note": "",
"CustomerOrder": {
"value": "XXXXXX"
},
"Details": [
{
"InventoryID": {
"value": "XXXX"
},
"OrderQty": {
"value": 1
}
},
{
"InventoryID": {
"value": "XXXX"
},
"OrderQty": {
"value": 1
}
},
{
"InventoryID": {
"value": "XXXXX"
},
"OrderQty": {
"value": 1
}
},
{
"InventoryID": {
"value": "XXXXX"
},
"OrderQty": {
"value": 1
}
}
],
"RequestedOn": {
"value": "2024-05-29"
},
"Date": {
"value": "2024-05-20"
}
}

The RequestedOn response looks like this: 

"RequestedOn": {
"value": "2024-05-26T00:00:00+00:00"
}

 

icon

Best answer by jmu216 22 May 2024, 22:47

View original

8 replies

Userlevel 7
Badge +18

@jmu216 Strange!! Do you have any customizations for the Sales Order screen→ Requested On field?

@Naveen Boga, good question. How would I go about checking that?

Userlevel 7
Badge +18

@jmu216  Please go to the Customization Projects screen and unpublish all customizations. Then, create a sales order through the API. If the sales order is created successfully, it indicates that the issue is likely with one of your customization packages

@Naveen Boga, I was not able to modify the customizations at the moment but I found out that the field I am targeting is not actually the ‘RequestedOn’ field, but a custom one. The custom info is as follows: 
 

Field ID = SOOrder.UsrNVFSDeliveryDate; Field Label = “Requested Date” and the information included in the screenshot.
 

Based on the documentation I have read, I need to include a url parameter as well as pass the field in the request body. I tried passing the url parameter ‘$custom=Document.AttributeUsrNVFSDeliveryDate’ and this in the request body: 

"custom": {
"Document": {
"AttributeUsrNVFSDeliveryDate": {
"value": "2024-05-31"
}
}
}

This was unsuccessful as well with the message: ‘The column 'Document_AttributeUsrNVFSDeliveryDate' is not found in the data set’

This is the main documentation I was referring to:

https://help.acumatica.com/(W(13))/Wiki/ShowWiki.aspx?pageid=6397c034-d191-4302-8f9d-0a0aec5b5ba8

https://help.acumatica.com/(W(18))/Wiki/ShowWiki.aspx?pageid=bd0d8a36-b00b-44c8-bdcd-b2b4e4c86fd0

https://help.acumatica.com/(W(16))/Wiki/ShowWiki.aspx?pageid=a0444120-2e5d-41cd-8c65-0385210b0f8a

Userlevel 7
Badge +5

Since it is a custom field vs an attribute, what you want to do is to modify the Web Endpoint to add that custom field. Then you can treat it like any other field in your JSon payload.

https://www.acumatica.com/blog/extending-acumatica-web-service-endpoints/

Hi @Django, thank you for the information. I followed the steps in the link and extended the endpoint. I believe I mapped it to the correct field based on the options available but I am still having trouble. 

What should my JSON payload look like for this field?

 

Edit: I see now that the ‘Extend Entity’ field is greyed out. I am assuming this is part of the issue.

Hi @Naveen Boga , @Django 

Thank you for your help, I figured it out via your information and by following this doc as well: https://help.acumatica.com/(W(23))/Wiki/ShowWiki.aspx?pageid=6397c034-d191-4302-8f9d-0a0aec5b5ba8

The JSON I was looking for was:

"custom": {
"Document": {
"UsrNVFSDeliveryDate": {
"type": "CustomStringField",
"value": "2024-05-28"
}
}
}

I could have sworn I tried this originally, but clearly I did not!

Userlevel 7
Badge

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

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