I created a UD field in the Part Table for our required certs. I want it to show up on the PO Detail line when a part is entered. I created a BAQ to get the Part Number, Description, and the UD field. Then I created a DataView in the Purchase Order app in Application Studio with a parent/child relationship on the Part Number. I added a text box to the Line Details screen and then bound it to the UD Field. However, when i add a line to the PO the data doesn’t populate in the UD Field. I’m not sure what I’m doing wrong. I am on Kinetic 2023.2.
In your version, on the customization, you can add a Foreign Key View.
Tools > Data Tools
Click “New Custom View”
Give a View Name (I would use PartView)
Select PODetail from the Parent View Name
Select Column Name of PartNum
Click Add
Click OK
I’m working in Application Studio in the webUI.
Kathie
Can you see data in your BAQ DataView via the debugger in your browser?
Got it. You version is 10.1.600.29 on your profile.
I guess BPM would be an easy way to achieve this unless I am missing something!?
Sorry about that. I just upgraded to Kinetic in March and didn’t think to change my profile here. It’s updated now.
Thanks!
No, there is no data in the BAQ DataView in the debugger. Guess that’s the problem. It’s tied to the part number on the PO Detail, but the table is not loaded so it has no records. Do I need to tie it to a form load event or something like that?
I guess it depends on how you want to view the information. A few different ways to “skin the cat” I think. And I’m typing out loud as I think through this, so hopefully its not incoherent (and others can correct me if I’m wrong in my thinking).
Are you running your BAQ against a single PartNum? In that case, you won’t have a PartNum to run it against until a line is created. So you would want to perhaps tie an event after ColumnChanging_PODetail_PartNum.
At that point, PODetail.PartNum is populated with a value, so you can use that to run your BAQ against.
This would then populated your BAQ Dataview and you would see the field value you’re looking for (in theory) on the form. But the dataview would only contain one row corresponding to your partnum.
So, if you then click over to a different line item (which has a different partnum), you would also need an event there to refresh your BAQ again following any rowChanged event.
Alternatively, yes, you could run your BAQ after an onload event, run it wide open (not using a specific partnum against the BAQ) and it would populate many rows in your dataview. In that case all rows would be there to easily reference based on various PODetail.PartNum (s) across multiple lines. So, that’s perhaps a better approach as long as running the full BAQ wide open doesn’t have a performance impact.
ANOTHER alternative… you could possibly forgo the BAQ & BAQ dataview and add the native Part dataview into PO Entry. The Part Dataview should already include your new UD column. But, here again, you still need to create an event to populate that dataview. You would just use a rest-erp instead of an erp-baq event widget. I did something similar in the below post. I wanted to get Requisition information (the name of the person requisitioning) visible on the PORelease Detail. So, the steps would be similar.
Thank you David. I did try to add the Part dataview to PO Entry at one time but I wasn’t able to get it to work. I will work through what you’ve sent me and hopefully, I can get it this time. I appreciate your help and time.
I just wanted to report back in. I was able to use the information in David’s other post to get this field populated, so thank you David. It is working great except for one minor thing. If the purchasing agent clicks on the line Details tab before adding the part number to the line, I get an error that the parameter partNum is not found in the input object. Since my buyers very rarely enter a PO manually, this is not really an issue, but for my own sake, I’d like to know why. The event is set to fire on the text box for my UD field, so I’m not sure why it would fire when clicking on the details button to add a line item. Any ideas?
The last post in the chain I added up above may help… I had a similar issue where I would get an error and @hmwillett provided the below, which worked for me.
In my case, I added a condition looking for a PORel.ReqNum. If ReqNum = 0, then I just set my Requisitioner’s name to “” (empty). This got rid of the error I was getting.
If the ReqNum wasn’t zero, then it would run my REST call and pull in my data.
So, I would look for something similar. Add a condition in your event prior to your REST call that performs a check. If PODetail.PartNum = " "… do nothing, else, perform your call.
Thanks David. I’ll check it.
I have a condition in my event that comes after the REST call to make sure the record has a requirement in that field. Should this happen before the REST call instead of after?
Its a timing issue. You need your event to fire AFTER a PartNum exists on a line so there is something to pass with your rest call.
Right now, your event is currently firing onInit of TransView.ReqCerts… I’m not sure when that is happening… but it could be when the Line Details page opens.
If I create a new PO and click on Line/Details, I see these events fire.
Your textbox must be being “initiated” when that form loads. So it does a rest call and fails, causing the error.
If I add a new Line and add a PartNum, the last event that fires is:
columnChanged_PODetail_PartNum
If I toggle between existing lines, the events that fire are rowChange events… I don’t see an event in common to tie your event “after”.
You MIGHT need to make your current custom event have no trigger.
Then create a new event that fires after columnChanged_PODetail_PartNum and calls your existing event with an event-next (to handle the problem scenario).
Then create another new event that fires after the rowChange event (to handle toggling through PO Lines) which again would call your original event with an event-next. That way your rest call would occur every time the user navigates to a different line.
That make sense if you think about the fact that every time a different part number is on the screen, it has to pull in different Part information.
I may be getting a little lost in the weeds.
I was thinking it might it was a timing issue, too. Thank you for confirming. I’ll keep working at it.
Any luck?
Yes, I did get it to work. Thanks again for the help!