Data Directive Update Table by Query

We have added a required inspection box to the part screen. Now I want to update any PO’s that have that part and set inspection required on the PO.

I’m trying to do that with an In-Transaction Data Directive on PODetail.Update, but am unsure of what to put in the mapping piece.

I have the PODetail and Part table joined on PartNum and company. Then in the part table I’m looking to see if the checkbox is checked.

In the table mapping do I have the relations correct at the top?

We have always used Rcvinspection in PartPlant, but if your data is in Part then you need these fields in your query.
image
Set the relation with Company and PartNum
Then bind automatically should map, company, PartNum and RcvInspectionReq.

Thank you! That worked.

Just a friendly reminder for your future to-do list. When you upgrade to Kinetic 2023.2 or beyond, this feature has been added to base code. We now support inspection managed at the Part & part/site level. You can choose to Use the the value in the partclass, or you can override it and choose to INSPECT or NOT inspect.
image

But will it carry to the PO? That is what we have always had to do ourselves when not using PartClass.

Yes, our core version DOES carry this setting to the PO.

Hi,

I am doing the exact same thing as the thread, but for some reason, it is not working out. Also doing this on DD In Transaction.
When I go to PO Entry and enter the Part Number, the Inspection Required on PoDetail is not checked still.

Really appreciate any help you can provide. Thank you!



Your query is using your ud field, but your mapping is using Epicor’s fields. I would stick with the builtin field because eventually the DD would no longer be needed.

If we still want to use the ud field (won’t be using the new version for another while), should the mapping of ttPoDetail RcvInspecReq be binded with Part_InspecReqUDfield?

Thank you

Yes, changing the binding should fix the issue, but I have been using the PartPlant built in field since the 9 days, so the ud is not needed.

Unfortunately we do not have the PartPlant built in field, we are still using the 10.2 version.


I changed the binding to Part_InsepcReq_UDfield, but the PODetail Inspection Required is still not checked, any idea as to why that is happening?


Thank you

I added their field under drop ship item. But if the UD is not working the builtin probably won’t either. Are company and partnum also bound?

Yes, the Company and PartNum is bounded. I tried binding it to ttPODetail and Part, but both didn’t work.

upload your bpm and I will take a look.

1 Like

Thank you so much!
You are a Godsend :sob:

PartLevelInspReqDD.bpm (27.3 KB)

@PhoebeL Well that did not go well. The bpm loaded with an error because of your ud field and even after I swapped out your field for the one from Epicor it would not validate. I got a index was out of bounds.

Here is the code I use to get the RcvInspectionReq. It should work for either field you want to use.

/* Set Rcv Insp Required */

Erp.Tables.Part Part;
foreach (var ttPODetailRow in (from ttPODetail_Row in ttPODetail
                                     where (ttPODetail_Row.Added() || ttPODetail_Row.Updated())
                                     select ttPODetail_Row))
{
    
    bool rcvInsp = (from Part_Row in Db.Part
                 where ttPODetailRow.Company == Part_Row.Company && ttPODetailRow.PartNum == Part_Row.PartNum
                 select Part_Row.RcvInspectionReq).FirstOrDefault();
    if (rcvInsp != null)
    {
        
            if (rcvInsp == true )
            {
                ttPODetailRow.RcvInspectionReq = true;
            }
             
    }
}
1 Like

lol riip…
Thank you for providing the code, i replaced the Part_Row.RcvInspectionReq with the UD field, but it is still not working on the PO.
Am I dumb or missing something?


Thank you

The code should run synchronously not asynchronously

I did it synchronously and it still didn’t work…


image

The next step will be to see if the code is running and how far it gets. I have starts and stops on most of my routines, so if an error is in the log I know what was running. One before Erp.Tables and one after the last curly brace. I would also add one inside the foreach and in rcvInsp not null and true to see what is happening.

Then in the app server event log you see the messages
image

Ice.Diagnostics.Log.WriteEntry($"Start Set Rcv Insp");
1 Like