Different Plants in subsequent REST calls

Is there a way to change plants for a user in a REST call? I’ve tried SessionMod’s SetPlant, but it doesn’t stick. I need to perform a transfer order entry and fulfillment in the same call so I’m doing this through a BPM inside a UBAQ (counting the days until we upgrade to a version that has functions). The CallSettings and OnBehalfOfToken headers seem to work well, except when I make the call to GetListOfTransferOrders because according to the disassembly, Epicor looks at the Session.PlantID instead of the CallSettings. So I need a way to change the plant for a user and then change it back. I’m guessing I’m just missing a call to something else to make the plant change stick in the session.

REST v2 gives you more control over company/site by putting it into the call header.

You’ll need to establish and pass a session in the session then will carry the plant information.

This library will handle setting and keeping a session info
https://www.epiusers.help/t/epicor-rest-helper-nuget-updated

Not sure if you are writing in .net or not… If you aren’t the concept still applies, establish a session and send it along with every request, then session mod will work.

1 Like

That works great in most scenarios. The problem I’m running into is the particular call I’m making doesn’t regard the call settings, but the session plant. It’s the only one I’ve found issues with. It’s a unique call, and I’m not sure if this was intended, or will be the case long term. I can work around it by just making a BAQ and calling that instead, but I was hoping for a more organic solution.

That makes sense. I’ll try that. Thanks

Yeah, I think all things Transfer Order have an extra level of security based on the login ID. I could be wrong though.