# BPM to set field blank on Copy Order

**URL:** <https://www.epiusers.help/t/bpm-to-set-field-blank-on-copy-order/59214>\
**Category:** Epicor ERP 10\
**Tags:** e10\
**Created:** [August 28, 2019, 10:22pm UTC](https://www.epiusers.help/t/bpm-to-set-field-blank-on-copy-order/59214 "2019-08-28T22:22:47Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![kp11](https://www.epiusers.help/letter_avatar_proxy/v4/letter/k/50afbb/32.png) [@kp11](https://www.epiusers.help/u/kp11)\
**Post date:** [August 28, 2019, 10:22pm UTC](https://www.epiusers.help/t/bpm-to-set-field-blank-on-copy-order/59214/1 "2019-08-28T22:22:47Z")

</div>

I am trying to set the OrderRel.Reference field to blank when the order is copied. Anyone know how to do this?

---

<div class="post-metadata">

**Author:** ![jgehling](https://www.epiusers.help/user_avatar/www.epiusers.help/jgehling/32/78990_2.png) [@jgehling](https://www.epiusers.help/u/jgehling)\
**Post date:** [August 28, 2019, 10:32pm UTC](https://www.epiusers.help/t/bpm-to-set-field-blank-on-copy-order/59214/2 "2019-08-28T22:32:59Z")

</div>

Run a trace when performing copy order to find the method to hook into. I believe one of the methods that is called is CheckLtrOfCredit. Is it only copied orders which is essentially a new order, so you could also use a data directive on orderhed where row state is Added.

Edit: actually I think there is a copy order method. Maybe a pre processing method dir on that? I try and use data dirs as a last resort

---

<div class="post-metadata">

**Author:** ![Jason\_Woods](https://www.epiusers.help/user_avatar/www.epiusers.help/jason_woods/32/80101_2.png) [@Jason\_Woods](https://www.epiusers.help/u/Jason_Woods)\
**Post date:** [August 28, 2019, 10:58pm UTC](https://www.epiusers.help/t/bpm-to-set-field-blank-on-copy-order/59214/3 "2019-08-28T22:58:52Z")

</div>

Post processing on CopyOrder should do it. You may need to use some Method widgets though.

---

<div class="post-metadata">

**Author:** ![kp11](https://www.epiusers.help/letter_avatar_proxy/v4/letter/k/50afbb/32.png) [@kp11](https://www.epiusers.help/u/kp11)\
**Post date:** [August 29, 2019, 12:37am UTC](https://www.epiusers.help/t/bpm-to-set-field-blank-on-copy-order/59214/4 "2019-08-29T00:37:09Z")

</div>

I understand tracing and know where to place the BPM itself. I am having trouble understanding Invoking Methods, what they do and what BO I should be calling with them, as well as what the paramaters are. Is there any post on here where I can find this information or can someone give me an example so I can build a better understanding?

---

<div class="post-metadata">

**Author:** ![Jason\_Woods](https://www.epiusers.help/user_avatar/www.epiusers.help/jason_woods/32/80101_2.png) [@Jason\_Woods](https://www.epiusers.help/u/Jason_Woods)\
**Post date:** [August 29, 2019, 1:09pm UTC](https://www.epiusers.help/t/bpm-to-set-field-blank-on-copy-order/59214/5 "2019-08-29T13:09:31Z")

</div>

The trace tells you the methods being called and their parameters.

---

<div class="post-metadata">

**Author:** ![kp11](https://www.epiusers.help/letter_avatar_proxy/v4/letter/k/50afbb/32.png) [@kp11](https://www.epiusers.help/u/kp11)\
**Post date:** [August 30, 2019, 12:03am UTC](https://www.epiusers.help/t/bpm-to-set-field-blank-on-copy-order/59214/6 "2019-08-30T00:03:11Z")

</div>

Ok so here is my trace. Should I be calling all of the BO in this trace from PreCopyOrder to DynamicQueryImpl? It seems like I shouldnt have to call all of those just to set a field on OrderRel. It looks like to me that in the DynamicQueryImpl.GetList its copying the order data there. Would I be somehow setting the field after that?

[copyorder2.xml](https://www.epiusers.help/uploads/short-url/eJudI1STnQO18rtbudwqqvnkppp.xml) (776.4 KB)

Here is a snip of my directive.

 ![Capture](https://epiusers.help/uploads/default/original/3X/e/4/e4de46b3e4dff9c618e61769e2856b6b4f497988.jpeg)

---

<div class="post-metadata">

**Author:** ![Jason\_Woods](https://www.epiusers.help/user_avatar/www.epiusers.help/jason_woods/32/80101_2.png) [@Jason\_Woods](https://www.epiusers.help/u/Jason_Woods)\
**Post date:** [August 30, 2019, 12:08am UTC](https://www.epiusers.help/t/bpm-to-set-field-blank-on-copy-order/59214/7 "2019-08-30T00:08:31Z")

</div>

The Dynamic Query is not standard logic. It may have data you wish to see, but it is not the method you need.  
It looks like you are on the right path. You do NOT want to ignore the SalesOrderTableset as that is the data you need to change. You may need to use code to set the RowMod = “U” (or Fill Table By Query may have this feature). Then run an update.

---

<div class="post-metadata">

**Author:** ![kp11](https://www.epiusers.help/letter_avatar_proxy/v4/letter/k/50afbb/32.png) [@kp11](https://www.epiusers.help/u/kp11)\
**Post date:** [October 14, 2019, 9:04pm UTC](https://www.epiusers.help/t/bpm-to-set-field-blank-on-copy-order/59214/8 "2019-10-14T21:04:06Z")

</div>

I have the bpm set up and displaying the correct data in the message box, but it is not actually applying those values to the field.

Any idea where I am messing up?

First message box showing the new ordernum as well as the current orderrel.reference data.  
 ![Msg1](https://epiusers.help/uploads/default/original/3X/8/c/8c9b04dd639aa234e9f99e642d931dfefd2d9f21.jpeg)

Showing the new ordernum and text being changed to (from the set field widget)  
 ![Msg2](https://epiusers.help/uploads/default/original/3X/0/7/07e3d95e7d981a9b62f33146f2c37940a4c4d7be.jpeg)

BPM Setup!

 ![Getby](https://epiusers.help/uploads/default/original/3X/8/f/8f55f4231bd1db7487dcf6605de0e81e9103fe5e.jpeg)  
 ![SetField](https://epiusers.help/uploads/default/original/3X/f/a/fae984215cfd844376cc629e7bb2ddea88e62c4d.jpeg)  
 ![update](https://epiusers.help/uploads/default/original/3X/2/8/28ded783bdb44b2db46ef413e6de4d4ab9649321.jpeg)

---

<div class="post-metadata">

**Author:** ![Jason\_Woods](https://www.epiusers.help/user_avatar/www.epiusers.help/jason_woods/32/80101_2.png) [@Jason\_Woods](https://www.epiusers.help/u/Jason_Woods)\
**Post date:** [October 15, 2019, 1:55am UTC](https://www.epiusers.help/t/bpm-to-set-field-blank-on-copy-order/59214/9 "2019-10-15T01:55:21Z")

</div>

Could you simply use a data directive there and set the field to blank?

---

<div class="post-metadata">

**Author:** ![kp11](https://www.epiusers.help/letter_avatar_proxy/v4/letter/k/50afbb/32.png) [@kp11](https://www.epiusers.help/u/kp11)\
**Post date:** [October 15, 2019, 5:34pm UTC](https://www.epiusers.help/t/bpm-to-set-field-blank-on-copy-order/59214/10 "2019-10-15T17:34:39Z")

</div>

This would need to be done with the custom code correct?

---

<div class="post-metadata">

**Author:** ![Jason\_Woods](https://www.epiusers.help/user_avatar/www.epiusers.help/jason_woods/32/80101_2.png) [@Jason\_Woods](https://www.epiusers.help/u/Jason_Woods)\
**Post date:** [October 15, 2019, 5:37pm UTC](https://www.epiusers.help/t/bpm-to-set-field-blank-on-copy-order/59214/11 "2019-10-15T17:37:46Z")

</div>

No. Just simply a Set Field.

---

<div class="post-metadata">

**Author:** ![kp11](https://www.epiusers.help/letter_avatar_proxy/v4/letter/k/50afbb/32.png) [@kp11](https://www.epiusers.help/u/kp11)\
**Post date:** [October 15, 2019, 5:54pm UTC](https://www.epiusers.help/t/bpm-to-set-field-blank-on-copy-order/59214/12 "2019-10-15T17:54:44Z")

</div>

Couldn’t be done with a standard directive of course, but it seems to work as an In-Transition.

 ![intransdd1](https://epiusers.help/uploads/default/original/3X/a/5/a539e0e675c1ae7c65234984e7fdfdd2b2db3737.jpeg)

---

<div class="post-metadata">

**Author:** ![Jason\_Woods](https://www.epiusers.help/user_avatar/www.epiusers.help/jason_woods/32/80101_2.png) [@Jason\_Woods](https://www.epiusers.help/u/Jason_Woods)\
**Post date:** [October 15, 2019, 6:08pm UTC](https://www.epiusers.help/t/bpm-to-set-field-blank-on-copy-order/59214/13 "2019-10-15T18:08:35Z")

</div>

Yes. You are correct.
