Issues with REST, marking Pack Slip Ready to Invoice

Make sure you “promote” the function to “production” after you import it. (Actions -> Promote)

and remove “staging/” from your URL.

As I mentioned, I new to the new Functions feature – where do I go in the Epicor Client to import the Function?

Search the menu for function I believe is like function maintenance or something like that.
You need special permisions in your user settings (Function Admin) group/

I have access to all the groups and am Security Manager. I only see this…

image

You are assigned all of these?
image
If you were not and now are make sure you restart your client or the menu item still won’t show up.
Lean on the Epicor Application help, functions are actually very well documented in there.

I assumed a logoff/change user would be sufficient but no. So also restarted the Client and still no luck. I have all those groups and I still see the same menu options shown in my screenshot.

A public cloud limitation?

Why not just add this code to the existing code he is running? Is that what you tried and the pack got deleted?

@Jonathan there is a bug in the Implementation of UpdateMaster where if a BeforeImage isn’t sent the pack gets deleted.

Unfortunately you can’t send a BeforeImage in rest.

Maybe… I’m not an expert on the Cloud @Mark_Wonsil thoughts?

Can you browse to it? Heard of some issues with Menu search recently.

image

Oh, I managed to miss that even though it is in the title :man_facepalming:

1 Like

Why you cannot send it? Just create it yourself and send

1 Like

You know @Olga… that’s why they pay you the big bucks LMAO… I tried that before and didn’t work but it appears to work fine in 600…
@Jeff_Owens try this

//Run get by ID
dynamic packData = EpicorRest.DynamicPost("Erp.BO.CustShipSvc","GetByID", new { packNum = 293 });

//Serialize the current ShipHead to clone it #Hack
var originalShiphead = Newtonsoft.Json.JsonConvert.SerializeObject(packData.ds.ShipHead[0]);

//Clone the Shiphead
dynamic shipHeadBeforeImage = Newtonsoft.Json.JsonConvert.DeserializeObject(originalShiphead);
//Clone the Shiphead
dynamic shipHeadModified = Newtonsoft.Json.JsonConvert.DeserializeObject(originalShiphead);

//Generate a new ShipHead Array
dynamic newShipHeadArray = new { ShipHead = new[] { shipHeadBeforeImage, shipHeadModified } } ;
            
//Update the Record
newShipHeadArray.ShipHead[1].RowMod = "U";
newShipHeadArray.ShipHead[1].ReadyToInvoice = true;

//Generate new Pack DataSet
dynamic masterUpdateDS = new { 
                                ds = newShipHeadArray, 
                                doValidateCreditHold = true, 
                                doCheckShipDtl = true,
                                doLotValidation = false,
                                doCheckOrderComplete = true,
                                doPostUpdate = true,
                                doCheckCompliance = true,
                                ipShippedFlagChanged = true,
                                ipPackNum = 293,
                                ipBTCustNum = packData.ds.ShipHead[0].CustNum 
                            };
//Invoke Update Master
dynamic newMU = EpicorRest.DynamicPost("Erp.BO.CustShipSvc", "UpdateMaster", masterUpdateDS);

Works like a dream for me.

note update the Pack num… obviously.

3 Likes

Was gonna try it, guess you beat me to it.

1 Like

@josecgomez … Your comment about the new pack num… is the 293 you’re showing in your example different from the pack num you got from the original flow?

Or are you just reminding me to not use your “293” value and make sure I use the one relevent to my instance, right?

Just asking for clarification.

Yeah just reminding you to not use 293 instead use the one you need to

Just confirming that this is now working! So in summary, we have to do the ShipHead trick twice. Once while creating the record and once in the last process of setting ReadyToInvoice = true.

I just want to give a super-shoutout :medal_sports: to everyone here, especially @josecgomez for the help with this issue!

1 Like

BTW, is this “kludge” whereby the two ShipHead records have to be manually adjusted a known issue or is this expected behavior that’s just not evident in the tracelog?

I ask, because as Epicor releases some, I want to know if this is something that will be fixed that I need to keep an eye out for or?

Any insight on this anyone?

This is expected behavior Epicor uses the BeforeImage all the time. technically every call to Epicor should go along with the BeforeImage

it isn’t a “kludge” it’s the behavior that Epicor has always had, but it protects you from it internally with the Adapter Taking care of it.

More info on Before Image: Update BO Deleting PackSlip - #3 by hmwillett

1 Like