Application Studio - Part_GetByID Problems

Hello all
I’m unsuccessfully attempting to grab a few UD fields from the Part table and put them onto the Sales Order kinetic screen under Line Details.
I believe the problem lies within my trigger.

My current set up is an Event After Update_KeyFields_ViewName (I’ve tried several different ones) that triggers an event-next of BO_Part_GetByID
This event is just the rest call on the part table, and uses OrderDtl.PartNum as the method parameter.
This works with an existing sales order, but any time I click the plus button to create a new order, I receive an error becacuse the partNum parameter doesn’t exist.

What is the correct way to go about this so I have data for existing sales order, and it updates when a new one is created?

Right now, it sounds like your event is running before OrderDtl.PartNum is populated, so it throws an error.

Perhaps set your trigger to occur when the value of OrderDtl.PartNum changes.

So… DataTable > Column Changed > OrderDtl > PartNum

1 Like

I changed my trigger to what you suggested, it worked when I created a new sales order line but did not run when I opened a sales order with an existing line.

Okay, different approach… go back to your earlier trigger, but add a condition before the event-next.

Condition:
'{OrderDtl.PartNum}' !== '' && '{OrderDtl.PartNum}' !== 'undefined'

If true… perform your event-next.

That way, if your OrderDtl.PartNum is blank (no value), it won’t attempt to perform the rest call (which was giving you the error).

3 Likes

That worked! I tried that before but must’ve had a syntax issue.
Now I should be able to set up an event on the data table, and another on my previous trigger so it covers new and existing sales order lines.

Thank you for the help!

2 Likes