PO Suggestion Can't be Created from Epicor REST API

We have separate requisition system for miscellaneous items in our company ,which links with budget and multiple level approval system.

But PO is going to create from Epicor ERP System. To accommodate that, We are going to use Epicor REST API.

Problem- We tried to generate PO suggestion through Epicor Web API But following error was appeared. Please Check following detail.

Can you help me to sort this out.
Note-
Our Current Epicor version is 10.2.300.16.
Other POST methods work properly (Ex, JCDept)

POST POSuggSvc

Create new item [POST] form the service Erp.BO.POSuggSvc generates below ErrorDetails in Response Body.

{

“HttpStatus”: 400,

“ReasonPhrase”: “REST API Exception”,

"ErrorMessage": “Suggestion is no longer valid”,

“ErrorType”: “Ice.Common.BusinessObjectException”, “ErrorDetails”: [ { “Message”: “Suggestion is no longer valid”,
“Type”: “Error”, “Table”: “SugPoDtl”,
“Program”: “Epicor.RESTApi.dll”,
“Method”: “ThrowUpdateExtRESTApiException”,
“ColumnNumber”: 17, “LineNumber”: 194 } ]

}

I still try to solve above. Issue. Can anyone help me to sort this out?

first thing I would try would be to try to create an Updateable BAQ/Dashboard for this table and see if you can add a record from there… if you cannot, then it is not “Rest” that is the problem. It is the UpdateExt process that is not working.

2 Likes

Have you tried to launch the process from an updatable BAQ, via the pre or post method directive available? If not, give it a try.

Besides, in terms of REST API, you may consider BAQ as an “entry point” in Epicor. You’ll be able to reuse your code easily from any source instead of tightening it up in your client app.

2 Likes

Hi timshuwy

Thank you for your feedback. Can we do insert in updateable BAQ?

I don’t familiar with updatable BAQ. Is there any technical reference related to this?

If so , Please share, Then I can try.

Hi Louis

Thank you for your feedback. Can we do insert in updateable BAQ?

I don’t familiar with updatable BAQ. Is there any technical reference related to this?

If so , Please share, Then I can try.

You will want to understand basic Epicor functionality before you get into REST. You are basically calling the same methods. So start with the tools user guides to start looking through how to make a UBAQ, then run a trace on the method in the UI to look at what you will have to do to make it work.

What you are asking is a pretty complicated request so it takes some time and some research to understand what is going on.

You cannot generate a PO suggestion directly. PoSugs can be created through PO Requistions. After a requestion is created and MRP is ran it turns into a PO sug.

1 Like

Try tracing the Generate PO Suggestions and go from there.

Hi @NuwanG ,

The point of using UBAQ here IS NOT to insert using the UBAQ itself. The UBAQ allow you to create your own logic in a pre or post processing method. Also, you can send parameter to your UBAQ if you need any in your logic. So, the UBAQ could be consider as an “entry point” and from there run the process you would like. You could also call any custom DLL … if desired.

Make a simple UBAQ attempting to modify a simple table (ABCCode as example) on which you put a criteria where company == null. Therefore, nothing will happen in the UBAQ itself. But, if you have created a pre-processing method on GetList (from memory), your custom logic will do something.

2 Likes

Hi Charity
Thank you for your response, I have created requisitions from API. Now I try to create Suggestions from that.
But I couldn’t find way to create PO suggestions from PO Requisitions.
PO Suggestion was automatically created when requisitions is dispatched.
So we can’t run generate PO Suggestions to do so.

Hi timshuwy

I tried it from UBAQ. Result is same. Is it related to in adequate data to create PO Suggetion?

Hi Louis

I tried it from UBAQ. Result is same. Is it related to in adequate data to create PO Suggetion?


Can you clarify what did you try to say from following “You’ll be able to reuse your code easily from any source instead of tightening it up in your client app.”

How should I try to Generate POs for PO suggestions?