I need to set a value on a purchase order as it’s ...
# suitescript
j
I need to set a value on a purchase order as it’s being created via DropShip. I tried using a UserEvent and a Workflow and neither seems to be triggered when the PO is created via DropShip. I’ve checked that they are deployed correctly and to all contexts. Any ideas on another method? Basically trying to find a workaround for the fact that dropshipped POs are using the vendor currency instead of the currency of the SO, even when that vendor has both currencies enabled.
e
How does DropShip do its creation? My suspicion would be via User Event, if subsequent UEs/WFs aren't triggered.
I guess I was assuming by the capitalization that DropShip is a product, and you didn't just mean orders that were dropshipped
j
I mean orders that are dropshipped
Sorry it’s DropShip in the value for
createpo
on the transactionline on the SO so I’m used to typing it that way.
m
If you're talking about using the
Drop Ship
link on the Items sublist, I know that fires UE scripts because we have at least one running in that context. How are you filtering for the context in your attempts so far?
p
Agree with @MTNathan I think they may only trigger certain entry points (can't remember if it's before/after submit, but I think they work like special work order, where only certain UE entry points work). I'd just log at the top of each entry point and do a return, to see if it's working. If not, definitely something going on there as I'm sure they should trigger
j
It’s only AfterSubmit I think
which is too late
I did log already which is how i know it’s not running on beforeLoad or beforeSubmit
m
I don't see any reason why it shouldn't be running on beforeLoad or beforeSubmit, though you may not be able to use
context.UserEventType.DROPSHIP
to filter for it there (I just noticed that the only place I'm using that is indeed in afterSubmit). In beforeLoad, you should be able to check for a url parameter of
dropship=T
as one potential option.
p
@MTNathan I think it's like that any time there's a 'process' in between, though I'm not sure why. Which is why I was saying it's the same for Special Work Order. So much fun, every day, eh 🙂
j
there’s no URL parameter --- it’s literally creating the POs when we click Approve on the SO.
the UE isn’t running at all in beforeLoad or beforeSubmit (it’s not triggered)
m
Oh, got it, yeah, that seems like it might be the User Event chaining issue then? I thought you were using the 'Drop Ship' link on the item sublist which pulls up a new PO in the UI, but if it's never pulling up in the UI then obviously the url parameters aren't any help.
Maybe you can catch it in the Approve of the SO instead? Not sure if that'll let you do what you need to on the PO, but it's the only other thing I can think of at the moment.