# BPM on Sales Order Question

**URL:** <https://www.epiusers.help/t/bpm-on-sales-order-question/49092>\
**Category:** Epicor ERP 10\
**Created:** [October 24, 2018, 7:50pm UTC](https://www.epiusers.help/t/bpm-on-sales-order-question/49092 "2018-10-24T19:50:15Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![tfenwick11](https://www.epiusers.help/user_avatar/www.epiusers.help/tfenwick11/32/5822_2.png) [@tfenwick11](https://www.epiusers.help/u/tfenwick11)\
**Post date:** [October 24, 2018, 7:50pm UTC](https://www.epiusers.help/t/bpm-on-sales-order-question/49092/1 "2018-10-24T19:50:15Z")

</div>

Referencing your code, I am trying to adopt the same concept. But I have it to where a field in ERP.ORDDTL is updated based upon a field in ERP.PART\_UD. The part that I am stuck on is “ttOrdDtl” seems to not exist as a reference?

I created a method directive on ERP.SalesOrder.ChangePartNum and its pre-processing.

var ORDDtlRow = ( from ttOrdDtl\_row in ttOrdDtl  
where (ttOrdDtl\_row.RowMod == "A" || ttOrdDtl\_row.RowMod == "U")  
select ttOrdDtl\_row).FirstOrDefault();  
Erp.Tables.Part Part;

if (ORDDtlRow != null)  
{  
PublishInfoMessage("ORDDtlRow != null & PartNum=" + ORDDtlRow.PartNum, Ice.Common.BusinessObjectMessageType.Information, Ice.Bpm.InfoMessageDisplayMode.Individual, "ORDDtlRow != null", "Update");

Part = (from Part\_Row in Db.Part  
where (Part\_Row.Company == ORDDtlRow.Company && Part\_Row.PartNum == ORDDtlRow.PartNum)  
select Part\_Row).FirstOrDefault();

if (Part != null)  
{  
PublishInfoMessage("Part != null", Ice.Common.BusinessObjectMessageType.Information, Ice.Bpm.InfoMessageDisplayMode.Individual, "Part != null", "Update");

ORDDtlRow.Character03 = Part.CSNotes\_c.ToString();  
}  
}

![image](https://epiusers.help/uploads/default/original/2X/3/30142e24c89f0dd25d528bf80923ef49a2c8d7ae.png)

---

<div class="post-metadata">

**Author:** ![Chris\_Conn](https://www.epiusers.help/user_avatar/www.epiusers.help/chris_conn/32/93797_2.png) [@Chris\_Conn](https://www.epiusers.help/u/Chris_Conn)\
**Post date:** [October 24, 2018, 8:33pm UTC](https://www.epiusers.help/t/bpm-on-sales-order-question/49092/2 "2018-10-24T20:33:13Z")

</div>

Wouldnt it be ttOrderDtl? You can always type tt then press ctrl-space and see what autocomplete offers up.

---

<div class="post-metadata">

**Author:** ![tfenwick11](https://www.epiusers.help/user_avatar/www.epiusers.help/tfenwick11/32/5822_2.png) [@tfenwick11](https://www.epiusers.help/u/tfenwick11)\
**Post date:** [October 25, 2018, 11:24am UTC](https://www.epiusers.help/t/bpm-on-sales-order-question/49092/3 "2018-10-25T11:24:43Z")

</div>

Thanks @Chris_Conn brain must have been fried end of day LOL.

---

<div class="post-metadata">

**Author:** ![tfenwick11](https://www.epiusers.help/user_avatar/www.epiusers.help/tfenwick11/32/5822_2.png) [@tfenwick11](https://www.epiusers.help/u/tfenwick11)\
**Post date:** [October 25, 2018, 1:46pm UTC](https://www.epiusers.help/t/bpm-on-sales-order-question/49092/4 "2018-10-25T13:46:52Z")

</div>

@Chris_Conn Could you provide some insight as to where I’m going wrong with this BPM? After enabling my BPM and closing out of Epicor and logging back in. Upon entering a new order and creating a new line for a part with the “CSNOTES\_c” field populated for that part. Upon clicking save or tabbing the new line record in. I don’t seem to be receiving either show message notification whether the processed passed/failed.

![image](https://epiusers.help/uploads/default/original/2X/1/1d21dcf5f2adbae7876eea9fb6ee968cbc03a727.png)

![image](https://epiusers.help/uploads/default/original/2X/6/697b4abd6557b1a073c16e636fb3bbeda6306bdf.png)

![image](https://epiusers.help/uploads/default/original/2X/4/48d8283b515a9e055ed65299907906355b1eec3e.png)

![image](https://epiusers.help/uploads/default/original/2X/4/4e86e597d8736a48482b36af88602279440b5a93.png)

![image](https://epiusers.help/uploads/default/original/2X/0/09e7da4f5e4d93b95059dbf5e2243400372207e2.png)

![image](https://epiusers.help/uploads/default/original/2X/5/5f5dd9f86101b5202b6e705ebc63c0f5836be74e.png)

---

<div class="post-metadata">

**Author:** ![josecgomez](https://www.epiusers.help/user_avatar/www.epiusers.help/josecgomez/32/55731_2.png) [@josecgomez](https://www.epiusers.help/u/josecgomez)\
**Post date:** [October 25, 2018, 2:06pm UTC](https://www.epiusers.help/t/bpm-on-sales-order-question/49092/5 "2018-10-25T14:06:35Z")

</div>

Please start new threads when the are not a direct continuation of an existing one.

---

<div class="post-metadata">

**Author:** ![tfenwick11](https://www.epiusers.help/user_avatar/www.epiusers.help/tfenwick11/32/5822_2.png) [@tfenwick11](https://www.epiusers.help/u/tfenwick11)\
**Post date:** [October 25, 2018, 2:07pm UTC](https://www.epiusers.help/t/bpm-on-sales-order-question/49092/6 "2018-10-25T14:07:29Z")

</div>

@josecgomez Roger.

---

<div class="post-metadata">

**Author:** ![Chris\_Conn](https://www.epiusers.help/user_avatar/www.epiusers.help/chris_conn/32/93797_2.png) [@Chris\_Conn](https://www.epiusers.help/u/Chris_Conn)\
**Post date:** [October 25, 2018, 2:16pm UTC](https://www.epiusers.help/t/bpm-on-sales-order-question/49092/7 "2018-10-25T14:16:26Z")

</div>

A few comments -  
You shouldnt have to close clients after BPM changes or enabling.  
If neither message shows, then you either:  
A) Are not actually calling the method, check trace  
B) Getting to the query and crashing (although I would expect a message) - temporarily disconect the FillByQuery (leave it floating) and route straight to the message after it to see if it fires.
