# Need C# help on BPM Method code

**URL:** <https://www.epiusers.help/t/need-c-help-on-bpm-method-code/104638>\
**Category:** Kinetic ERP\
**Created:** [June 30, 2023, 5:30pm UTC](https://www.epiusers.help/t/need-c-help-on-bpm-method-code/104638 "2023-06-30T17:30:51Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![visionaire](https://www.epiusers.help/user_avatar/www.epiusers.help/visionaire/32/43770_2.png) [@visionaire](https://www.epiusers.help/u/visionaire)\
**Post date:** [June 30, 2023, 5:30pm UTC](https://www.epiusers.help/t/need-c-help-on-bpm-method-code/104638/1 "2023-06-30T17:30:51Z")

</div>

Admittedly not a C# programmer, but other languages like SQL etc.  
Everything I find on here and enter even the most basic command fails in the C# editor syntax.  
Could it be because we are Cloud Based Kinetic 2023.1?

I am trying to do a field comparison on two different tables in the BPM Method “Erp.BO.PO.ChangeDetailPartNum” which fires when you enter a new Part Number on a PO Line. _(I have verified this is the correct Method via Tracing and testing)_

Maybe even the wrong place to do this?

I want to compare the Numeric field **Vendor\_UD.QAClassNum\_c** to the **Part.UserInteger2** field to see if they match for the dsPODetailRow.PartNum field when it is entered, then I can take action from there.

I believe the correct “Condition” to use is: ‘The custom code condition is valid’ and enter some C# code there OR ‘The specified expression is valid’, both of which allow C# code.

The Expression Editor does not have the tables for Vendor or Part in the list, but I am sure you can check fields in other tables as I have seen here via a SELECT statement much like SQL.

Anything I put in Expression Editor, even from code examples in this forum fail. Do we need curly braces in this editor? all regular C# commands seem to fail as well.

Using the fields within the Epression Editor also fail, as an example: int partqa dsPODetailRow.PartNum;

Fails with “Expression should contain only one statement”. No matter how I change things, still errors out.

Would love to see an example of code from someone on Cloud that I could glean some syntax from.  
Even just how to assign a variable to a field would be helpful.

Thanks in advance.  
George

---

<div class="post-metadata">

**Author:** ![SimsTrak](https://www.epiusers.help/user_avatar/www.epiusers.help/simstrak/32/33313_2.png) [@SimsTrak](https://www.epiusers.help/u/SimsTrak)\
**Post date:** [June 30, 2023, 5:35pm UTC](https://www.epiusers.help/t/need-c-help-on-bpm-method-code/104638/2 "2023-06-30T17:35:39Z")

</div>

You should be able to do this without custom code, by using the condition widget with the “number of rows in the designed query is more or equal to 1”. Build the query, link to the part table and the vendor table and have a condition in the query where Vendor.QAClassNum = Part.UserInteger2. If they’re equal, it will return one row and the condition will be true. If they’re not equal, then it will return zero rows and the condition will be false.

---

<div class="post-metadata">

**Author:** ![visionaire](https://www.epiusers.help/user_avatar/www.epiusers.help/visionaire/32/43770_2.png) [@visionaire](https://www.epiusers.help/u/visionaire)\
**Post date:** [June 30, 2023, 5:37pm UTC](https://www.epiusers.help/t/need-c-help-on-bpm-method-code/104638/3 "2023-06-30T17:37:16Z")

</div>

Seems using ‘Synchronously Execute Custom Code’ action, I see where I can add the Variable names and type. Still need to link them or populate from Vendor\_UD and Part Tables. working on it…

---

<div class="post-metadata">

**Author:** ![visionaire](https://www.epiusers.help/user_avatar/www.epiusers.help/visionaire/32/43770_2.png) [@visionaire](https://www.epiusers.help/u/visionaire)\
**Post date:** [June 30, 2023, 5:46pm UTC](https://www.epiusers.help/t/need-c-help-on-bpm-method-code/104638/4 "2023-06-30T17:46:12Z")

</div>

On that method, the “Number of rows in the Designed query is more or equal to 1” is not available as a choice condition. That is why I was using the “The specified expression is valid” or “The custom code condition is valid” conditions on the Condition widget. If I could do it with a BAQ that would be great as well. Still poking around…

---

<div class="post-metadata">

**Author:** ![klincecum](https://www.epiusers.help/user_avatar/www.epiusers.help/klincecum/32/100137_2.png) [@klincecum](https://www.epiusers.help/u/klincecum)\
**Post date:** [June 30, 2023, 5:52pm UTC](https://www.epiusers.help/t/need-c-help-on-bpm-method-code/104638/5 "2023-06-30T17:52:53Z")

</div>

> [@visionaire](#):
>
> Could it be because we are Cloud Based Kinetic 2023.1?

No

That is valid thing and the expression editor can be hard to use as it is pretty limiting.

🤔

---

<div class="post-metadata">

**Author:** ![klincecum](https://www.epiusers.help/user_avatar/www.epiusers.help/klincecum/32/100137_2.png) [@klincecum](https://www.epiusers.help/u/klincecum)\
**Post date:** [June 30, 2023, 5:57pm UTC](https://www.epiusers.help/t/need-c-help-on-bpm-method-code/104638/6 "2023-06-30T17:57:23Z")

</div>

> [@visionaire](#):
>
> On that method, the “Number of rows in the Designed query is more or equal to 1” is not available as a choice condition.

It is:

 ![visionaire1](https://www.epiusers.help/uploads/default/original/3X/5/2/520f7b2947100c1e6517a88e56c5f72eb0ff7b17.jpeg)

---

<div class="post-metadata">

**Author:** ![visionaire](https://www.epiusers.help/user_avatar/www.epiusers.help/visionaire/32/43770_2.png) [@visionaire](https://www.epiusers.help/u/visionaire)\
**Post date:** [June 30, 2023, 6:04pm UTC](https://www.epiusers.help/t/need-c-help-on-bpm-method-code/104638/7 "2023-06-30T18:04:48Z")

</div>

![image](https://www.epiusers.help/uploads/default/original/3X/b/9/b9cecbe6a15eb56cd838cfdb6f86478234e79bae.png)  
Kinetic…  
Yes, I opened it in Classic and that choice is there…ughhh  
Thanks for the screenshot, it tipped me that you are using the Classic shell, and I was using Kinetic.  
I will continue testing…

---

<div class="post-metadata">

**Author:** ![klincecum](https://www.epiusers.help/user_avatar/www.epiusers.help/klincecum/32/100137_2.png) [@klincecum](https://www.epiusers.help/u/klincecum)\
**Post date:** [June 30, 2023, 6:05pm UTC](https://www.epiusers.help/t/need-c-help-on-bpm-method-code/104638/8 "2023-06-30T18:05:44Z")

</div>

> [@visionaire](#):
>
> and I was using Kinetic.  
> I will continue testing…

Yeah that thing is not finished, by far. Testing only in Kinetic Method Directive Maintenance.

---

<div class="post-metadata">

**Author:** ![SimsTrak](https://www.epiusers.help/user_avatar/www.epiusers.help/simstrak/32/33313_2.png) [@SimsTrak](https://www.epiusers.help/u/SimsTrak)\
**Post date:** [June 30, 2023, 6:18pm UTC](https://www.epiusers.help/t/need-c-help-on-bpm-method-code/104638/9 "2023-06-30T18:18:16Z")

</div>

Typical of most software companies. When they come out with new technology, like the Kinetic UX, it’s very bleeding edge and buggy. In my opinion, Epicor focuses on the user forms (job entry, shipment entry, etc) before they spend as much time on the IT functions (report styles, directives, etc). That’s a good move on their end. The user facing forms are getting much better, still some issues but they’ve come a long way.

Hopefully the system admin forms won’t be too far behind. For now, I run a lot of those types of programs in classic view.

---

<div class="post-metadata">

**Author:** ![visionaire](https://www.epiusers.help/user_avatar/www.epiusers.help/visionaire/32/43770_2.png) [@visionaire](https://www.epiusers.help/u/visionaire)\
**Post date:** [July 5, 2023, 2:24pm UTC](https://www.epiusers.help/t/need-c-help-on-bpm-method-code/104638/10 "2023-07-05T14:24:50Z")

</div>

All good and working now. “Poor Man’s” vendor rating system.  
BPM and Query work fine, but will continue exploring C# and programming things going forward.  
Appreciate all comments and help.  
George
