We’re trying to call an erp-rest method after the sales order detail page loads. I need to hide/show a button based on the content of a text box that appears on the details page.
For testing, we added a button that triggers the erp-rest call that that works perfectly. Now, we need a way to call the erp-rest call when the detail page has finished rendering.
We’ve tried a few events and we haven’t yet found the one we need. Does anyone know what event we can connect to?
That makes two of us!
What events have you tried to tie this to? Try adding a dialog-show to the AfterGetByID event on the Sales Order Detail form. When you do it asks if you want to insert before or after the event. Insert After. Does that work?
It’s super helpful to let people here know the business problem you’re trying to solve (vs. the technical problem), and I think you’ll get better feedback.
Sorry. We are looking the part in the Part textbox and if that part is of a particular family then we want to hide a button that we use to pull up part diagrams.
You may need to perform this after several events…
You might have to have it trigger after “RowChanged_sysPages” event as that is the event that fires when you first click on Line Details from the Order Head page.
You may also have to trigger it based on RowChanged events pertaining to the line item, as a user can scroll through line items on an order and you would need to have this event fire each time. So, I would think after OrderDtlRowChanged?
I’m assuming you’d also want it to fire after a part is entered/changed on an Order Line… so after the ColumnChanged_OrderDtlPartNum?
Set one up and see if it works… but then start testing and navigating around the order as a user would and see how they might get back to that line item and the event doesn’t fire. There are a lot of paths to the OrderDtl page.
I’m not sure if I’m thinking of it the same way you are, but I used a rule on this one. Since the OrderDtl dataview will be on the row you have selected you could use similar logic to look for non matching category and hide the button.
I did it for MES, used disable instead of hiding, and a BAQ to identify if there was an attached URL that I use in the button to open:
Not sure how this would work since I have to take the part number and look it up in the database to determine to which family it belongs. But, I guess I could determine what the family is before presenting the part number and just hold that value in a dataview column that is not displayed - then I could use the data rule.
I am bbuzzard’s coworker, trying to solve this problem. What we are trying to do is show a Button in the Line Detail screen that only appears when the order line’s PartNum is a certain Product Type.
First, we added a Part View to the Line Detail screen so we can load the Part information using Rest call when the user opens the Order Line Detail screen, or switch to a different line number. Once the part info is loaded into the Part View, based on the Part’s product type, we either hide the button, or show the button.
We setup a parent child relationship with OrderDtl as the parent and Part view as child, but the part view did not load automatically. Maybe there is a way to trigger the child view to load when OrderDtl view is loaded or changed to a different order line?
We tried After AfterOrderDtlPartNumChanged event to load the Part view using Rest call. but it seems this event does not get triggered.
We tried After OrderDtlRowChanged. But it only gets triggered when the user is switch between different order lines. It doesn’t seem to fire when the user opens the Order Detail screen the first time.
We tried After RowChanged_sysPages event. It works when the user first opens the Order Detail screen, but it also fires when the user is opening other screens such as tax detail screen and job screen for the order.
My question is:
Is there a way to load the child part view automatically, if the OrderDtl view is filled, or has changed?
If not, in the After RowChanged_sysPages event, is there a way to detect which screen the user is on?