Set UD field in Order Entry to equal another UD field

customization
bpm

(Billy Xiong) #1

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


(Theodore Koch) #2

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.


(Jose C Gomez) #3

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.


(Pierre Hogue) #4

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


(Billy Xiong) #5

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.


(Billy Xiong) #6

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.


(Theodore Koch) #7

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


(Billy Xiong) #8

My mistake.

Thanks Theodore!


(Billy Xiong) #9

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?)


(Jose C Gomez) #10

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


(Dave Behrendt) #11

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()