Is this possible using REST? Does anyone have any success with receiving transfer orders through REST?
In Epicor’s Receive Transfer Order entry program, it calls a CustomUpdate method according to the trace. However, I can’t seem to find this method in the Erp.BO.TransOrderReceiptSvc service in REST. Also, I can’t seem to get any of the POST methods in that REST service to do anything.
At the top right of the screen select switch to custom methods lists. You can find all the Post methods there when you are in the Erp.BO.TransOrderReceiptSvc service
I found the CustomUpdate method. Unfortunately, I’m still unable to receive the transfer order. I keep getting the error “Asm is required” even though this should not have anything to do with an assembly.
This is a transfer order that I’m trying to receive, but it seems like the CustomUpdate method wants an assembly sequence number. If I pass in any value to the AssemblySeq field, it errors and says “Asm references invalid value”.
So, I’m stuck and not able to receive any transfer orders using REST. Anyone came across this problem and can offer any suggestions?
I just tried running the method and had no issues, what are the parameters are you passing? Is there any reason why are you calling custom update and not just update method?
Thanks
Thanks for the response. I did a trace in Epicor’s Transfer Order Receipt and saw that it uses the CustomUpdate method. I’ve also tried just the Update method as well and got exactly the same error.
I’ve tried passing in all fields or just a subset (with field and modified data from the Epicor trace), but continuously get this same error. If I use Epicor’s Transfer Order Receipt program, it does the receiving fine.
Do you have to pass in all fields? Do you mind posting the Json that you used, please?
Not sure I understand, but here’s part of the trace in Epicor’s Transfer Order Receipt after selecting “Receive All” from the Actions menu and clicking the Save button:
Oh! I was confused and read custom method, not custom update!
As mentioned in other REST posts, capture the data sent and put EVERYTHING into that json payload. Then start deleting unneeded columns until you find the minimal columns needed.
I just tried it again and made sure I get the dataset tables from the GET methods, so that all fields are included and the data for the transfer shipment are correct. However, even with everything in the json payload, I still get this same error:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Ice.Common.BusinessObjectException: Asm is required.
at Ice.Publisher.AssertNoBLExceptions() in C:\_Releases\ICE\3.1.600.12\Source\Framework\Epicor.Ice\Exceptions\Publisher.cs:line 143
at Ice.Core.BizRuleEngine.Validate(IceRow oldRow, IceRow newRow, LinqRow curRow) in C:\_Releases\ICE\3.1.600.12\Source\Framework\Epicor.Ice\BizRuleEngine\BizRuleEngine.cs:line 124
The CustomUpdate does nothing special. It calls update and returns the legal number. I am not sure if that is needed by you or not.
If not, then call the OData Update. It is designed to support partial data graphs instead of filling in every column.
If you need that legal number as a part of your process then you have a much larger task to pull apart which fields are required. That error Asm is required - is stating that the Field with the LABEL or NAME of Asm is required. That’s all data inside of the Zdata - ZDataField.FieldName and ZDataField.FieldLabel to track down which. That’s if you really want to go down the custommethod route. Remember custom methods assume you are sending a complete graph of data - every table and column with lots of empty strings like the WCF services take. Your json payload is obviously not sending everything.
Looking at the Asm field in ice.ZDataField shows the field name is AssemblySeq, which I’ve been passing in 0 in the Json payload because I’m trying to receive this transfer order to stock.
It seems like it’s trying to receive it to a Job, even though I specify it should go to STOCK in the ReceiveTo field in the Json being passed in.
I don’t think this error is REST specific because I tried the same thing using WCF and got exactly the same error. In WCF, I use GetByID to populate my dataset and then change the RowMod to “U” in the PlantTran table. Just as in REST, calling Update or CustomUpdate in WCF gives me exactly the same error.
I do have RowMod = “U” on the PlantTran object. I tried putting in on the TFShipHead and TFShipDtl objects as well, but it gave the error “This function is not allowed” when calling both Update and CustomUpdate.
I think, you need to take that CustomUpdate tracePacket in tracing, and take all fields from it, translated in json, not from ODATA call.
Also is CustomUpdate working for you in BLTester, not in REST?
Actually, I’m using all fields from the trace by translating the XML to Json, then modifying the content for the packnum that I want to receive. I’ve done that several times to be sure that no fields were missed.
I am able to get Update working using the BL Tester. So, it’s only REST and WCF that I can’t get it to work.
I question this response as I have come across this same issue. I am sending through every field in the dataset and even checked manually against a trace log that the values inside each column are the same and I still get the same error message.
I did some more testing and if you set the AssemblySeq to a number say 5. The error message becomes ‘DimCode Required’, changing DimCode to 1 changes the error message again… Could it be that the rest service converts the 0 value in AssemblySeq to null for some reason? Hence why it is asking for a ASM value.
Note that the method itself is not for an assembly part, when doing the same transaction through Epicor the trace indicates that it is submitting ‘AssemblySeq 0 /AssemblySeq’
Unfortunately, I wasn’t able to get this to work using REST either. So, I had to use the Epicor BO directly to get around this issue of not able to do this through REST.
Thanks for letting me know. I am looking at going down the Updatable BAQ route to resolve this issue and using the REST service to call that updatable BAQ.