# BPM Method Directive Incompatible Data Type Error

**URL:** <https://www.epiusers.help/t/bpm-method-directive-incompatible-data-type-error/75295>\
**Category:** Epicor ERP 10\
**Tags:** customization, e10, bpm\
**Created:** [February 5, 2021, 6:26pm UTC](https://www.epiusers.help/t/bpm-method-directive-incompatible-data-type-error/75295 "2021-02-05T18:26:19Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![kfreeman](https://www.epiusers.help/letter_avatar_proxy/v4/letter/k/3be4f8/32.png) [@kfreeman](https://www.epiusers.help/u/kfreeman)\
**Post date:** [February 5, 2021, 6:26pm UTC](https://www.epiusers.help/t/bpm-method-directive-incompatible-data-type-error/75295/1 "2021-02-05T18:26:19Z")

</div>

Hello,

I’m building a step into an existing Method Directive BPM.  
The validation error I received (see attached screenshot) was concerning the incompatibility of comparing a System.Int32 value (DMRHead.DMRNum) with a System.String value (UD06.Key1).

These are primary key values that connect the two tables, and there are no issues anywhere else in the system (BAQs, dashboards, screens, SQL server queries) when joining on these two columns.

How can I work around this issue? There’s no way to join the tables without these values connecting so I’m stumped as to how to go forward. Even if I wrote custom code to try and join the two tables, the data incompatibility issue may arise.

Does anyone have any suggestions on how to get around this issue?

Thanks,  
Karen

 ![BPM Validation error release chk](https://www.epiusers.help/uploads/default/original/3X/6/f/6f62fda570c99f0850415b6288412844225576f3.jpeg)

---

<div class="post-metadata">

**Author:** ![ckrusen](https://www.epiusers.help/user_avatar/www.epiusers.help/ckrusen/32/50584_2.png) [@ckrusen](https://www.epiusers.help/u/ckrusen)\
**Post date:** [February 5, 2021, 6:34pm UTC](https://www.epiusers.help/t/bpm-method-directive-incompatible-data-type-error/75295/2 "2021-02-05T18:34:05Z")

</div>

What is the condition statement?

You probably have to cast the Key1 to an integer before comparing it to DMRNum

---

<div class="post-metadata">

**Author:** ![ckrusen](https://www.epiusers.help/user_avatar/www.epiusers.help/ckrusen/32/50584_2.png) [@ckrusen](https://www.epiusers.help/u/ckrusen)\
**Post date:** [February 5, 2021, 6:46pm UTC](https://www.epiusers.help/t/bpm-method-directive-incompatible-data-type-error/75295/3 "2021-02-05T18:46:58Z")

</div>

What I’ve done that seems to work is to create a variable `intKey1` of type Integer. Then use a Set Argument/Variable widget to set that variable with  
` Convert.ToInt32(ttUD40Row.Key1)`  
Then use that as a table condition in the Condition’s Query.

If you’r starting with the DMRNum and need to see if a matching UD06 record can be found, the your variable would be a string (say `strDMRNum`), with the Set Arg/Var widget as  
`Convert.ToString(DMRHead.DMRNum)`

Then you can use that as criteria to limit the UD06 table records

---

<div class="post-metadata">

**Author:** ![kfreeman](https://www.epiusers.help/letter_avatar_proxy/v4/letter/k/3be4f8/32.png) [@kfreeman](https://www.epiusers.help/u/kfreeman)\
**Post date:** [February 5, 2021, 6:47pm UTC](https://www.epiusers.help/t/bpm-method-directive-incompatible-data-type-error/75295/4 "2021-02-05T18:47:55Z")

</div>

The Condition check is to test for OpenDMRs for the job in the JobEntry screen. If an Open DMR (in the DMRHead table) exists for a job in the UD06 table, then the job’s release is restricted.

The attached screenshot shows the condition being tested by the query.

 ![BPM error release chk](https://www.epiusers.help/uploads/default/original/3X/2/7/27f790b915f4f367d6a2fc6ec6a6cd0753f3623b.jpeg)

Also, how can I cast values if I don’t have them identified yet?

---

<div class="post-metadata">

**Author:** ![ckrusen](https://www.epiusers.help/user_avatar/www.epiusers.help/ckrusen/32/50584_2.png) [@ckrusen](https://www.epiusers.help/u/ckrusen)\
**Post date:** [February 5, 2021, 6:54pm UTC](https://www.epiusers.help/t/bpm-method-directive-incompatible-data-type-error/75295/5 "2021-02-05T18:54:37Z")

</div>

I assume the condition’s query has something like:

![image](https://www.epiusers.help/uploads/default/original/3X/d/3/d36eff2813172bb768b78d9ae27dde1d7d7f7d8c.png)

Instead, remove that relationship and add a table criteria:

 ![image](https://www.epiusers.help/uploads/default/original/3X/c/e/ce0c9c55d67b6600dd21192d1fbe5dd461e6bd75.png)

---

<div class="post-metadata">

**Author:** ![kfreeman](https://www.epiusers.help/letter_avatar_proxy/v4/letter/k/3be4f8/32.png) [@kfreeman](https://www.epiusers.help/u/kfreeman)\
**Post date:** [February 5, 2021, 7:59pm UTC](https://www.epiusers.help/t/bpm-method-directive-incompatible-data-type-error/75295/6 "2021-02-05T19:59:35Z")

</div>

Here are the two table criteria and the join condition:

 ![CheckOpenDMR-DMRHead & UD06 join condition](https://www.epiusers.help/uploads/default/original/3X/f/d/fdc178d179241351965e737da25e68c4ef60f855.jpeg) ![CheckOpenDMR-UD06 criteria](https://www.epiusers.help/uploads/default/original/3X/9/f/9f83a96cff98299cc9f932688e11cab3b598f285.jpeg) ![CheckOpenDMR-DMRHead criteria](https://www.epiusers.help/uploads/default/original/3X/e/1/e18c6e358274a0800a346a116e6205e3f68c0dd6.jpeg)

---

<div class="post-metadata">

**Author:** ![ckrusen](https://www.epiusers.help/user_avatar/www.epiusers.help/ckrusen/32/50584_2.png) [@ckrusen](https://www.epiusers.help/u/ckrusen)\
**Post date:** [February 5, 2021, 9:21pm UTC](https://www.epiusers.help/t/bpm-method-directive-incompatible-data-type-error/75295/7 "2021-02-05T21:21:33Z")

</div>

I think I understand what you’re trying to do now. Let me think about it.

---

<div class="post-metadata">

**Author:** ![CSmith](https://www.epiusers.help/user_avatar/www.epiusers.help/csmith/32/50752_2.png) [@CSmith](https://www.epiusers.help/u/CSmith)\
**Post date:** [February 5, 2021, 10:27pm UTC](https://www.epiusers.help/t/bpm-method-directive-incompatible-data-type-error/75295/8 "2021-02-05T22:27:16Z")

</div>

Wouldn’t you need something like this:

 ![image](https://www.epiusers.help/uploads/default/original/3X/e/2/e27d790ff6de540342eb1f712379b3d0c1778761.png)

---

<div class="post-metadata">

**Author:** ![ckrusen](https://www.epiusers.help/user_avatar/www.epiusers.help/ckrusen/32/50584_2.png) [@ckrusen](https://www.epiusers.help/u/ckrusen)\
**Post date:** [February 6, 2021, 8:43pm UTC](https://www.epiusers.help/t/bpm-method-directive-incompatible-data-type-error/75295/9 "2021-02-06T20:43:34Z")

</div>

The Query Designer in a BPM Condition only alows you to choose Column Names. You cant edit and add the `cast()` part.

I think the following will work

1. Add a Variable of type DMR Processing Tableset:  
 ![image](https://www.epiusers.help/uploads/default/original/3X/9/4/9436806085e221fc4fbc0a745eab38575383248f.png)

2. Add a Fill table by query widget with:  
 ![image](https://www.epiusers.help/uploads/default/original/3X/c/1/c190cb6492b724d760604005e8b71fbf4a69e80d.png)  
The `DMRHead subset` query being:  
 ![image](https://www.epiusers.help/uploads/default/original/3X/7/b/7be0e1495f79b3d090981b99aa299eec69a2b8c7.png)  
With the columns  
 ![image](https://www.epiusers.help/uploads/default/original/3X/d/6/d62da49ac99e713ee49e648f80ab40d1c418a4f9.png)  
the configured mapping:  

Now you have a copy DMRHead, where the PurPoint column actually holds the DMRNum, but as a string.

1. In the condition, make the query:  
 ![image](https://www.epiusers.help/uploads/default/original/3X/f/9/f9bee6b0e6892091c5d5687419dfdbbbfc32032f.png)  
(note that UD06.Key1 is linked to DMRHead.PurPoint)  
And don’t forget to add the table criteria for jobNum to UD06

It saves without error, and I believe it should work. But I’m unable to test it.

---

<div class="post-metadata">

**Author:** ![kfreeman](https://www.epiusers.help/letter_avatar_proxy/v4/letter/k/3be4f8/32.png) [@kfreeman](https://www.epiusers.help/u/kfreeman)\
**Post date:** [February 9, 2021, 7:34pm UTC](https://www.epiusers.help/t/bpm-method-directive-incompatible-data-type-error/75295/10 "2021-02-09T19:34:11Z")

</div>

Thank you so much Calvin! This worked perfectly!  
The only thing I changed was the column I used in the DMRHead table; instead of PurPoint I used DimCode, which was not used in our application.  
Thanks again,  
Karen
