Set UD field in Order Entry to equal another UD field

Hello,

I have a task to set a UD field in Order Entry (OrderDtl.SubGroup_c) to equal (Part.ShortChar01).

Once a Part is selected at the line level I need the text that populates in Part.ShortChar01 to copy over to OrderDtl.SubGroup_c.

What method would be recommended for this? BPM vs Customization? How would I get started?

And does anyone have an example they are willing to share?

Thanks in advance.

Billy

Easiest way that involves no coding would be a Foreign Key View. I believe there is an example in the ICE Users Guide available on EpicWeb.

Post Processing BPM on ChangePartNumMaster Method should be pretty straight forward.

The expression is

(from x in Db.Part where x.Company == ttOrderDtlRow.Company && x.PartNum == ttOrderDtlRow.PartNum select x.ShortChar01).DefaultIfEmpty("").FirstOrDefault()

Change the fields to meet your needs. Right now it returns ShortChar01 from Part and assigns it to ShortChar01 on the OrderDtl.

It all depends when you want this to happen… If it is as soon as selected, then I second Theodore suggestion, Otherwise I use the BPM…

Pierre

Thanks for the quick feedback. One thing I forgot to mention is that the users want the flexibility to modify the text field that’s being copied over. I’ve tried the Foreign Key View, but the fields are defaulted to DataReadOnly “True” with no options to change to false.

Jose,

I wasn’t able to locate ChangePartNumMaster method in Part, but there was a ChangePartNum. I’m not sure if that’s what you’re referring to, but I went ahead with that method, the problem is it doesn’t have an option to set the ttOrderDtl table.

You are referencing the wrong Business Object, you should use SalesOrder.ChangePartNumMaster

1 Like

My mistake.

Thanks Theodore!

Hey Jose,

This may be a simple brain fart from my end, but using your code, I keep running into the error below.

System.Drawing.Bitmap CS1061 ‘Part’ does not contain a definition for ‘ShortChar01’ and no extension method ‘ShortChar01’ accepting a first argument of type ‘Part’ could be found (are you missing a using directive or an assembly reference?)

Try lowercase Shortchar01 it is case sensitive… it should auto complete for you if you hit Alt Space

I am having the same error and I tried with no success:

(from x in Db.Part where x.Company == ttOrderDtlRow.Company && x.PartNum == ttOrderDtlRow.PartNum select x.ShortChar01).DefaultIfEmpty("").FirstOrDefault()

&

(from x in Db.Part where x.Company == ttOrderDtlRow.Company && x.PartNum == ttOrderDtlRow.PartNum select x.Shortchar01).DefaultIfEmpty("").FirstOrDefault()