# BPM Help - problem interpreting checkboxes

**URL:** <https://www.epiusers.help/t/bpm-help-problem-interpreting-checkboxes/42119>\
**Category:** Vista/Vantage 8\
**Created:** [January 9, 2018, 4:38pm UTC](https://www.epiusers.help/t/bpm-help-problem-interpreting-checkboxes/42119 "2018-01-09T16:38:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jhenslee](https://www.epiusers.help/user_avatar/www.epiusers.help/jhenslee/32/805_2.png) [@jhenslee](https://www.epiusers.help/u/jhenslee)\
**Post date:** [January 9, 2018, 4:38pm UTC](https://www.epiusers.help/t/bpm-help-problem-interpreting-checkboxes/42119/1 "2018-01-09T16:38:07Z")

</div>

I’m working on a BPM in Vantage 8 that is “supposed” to check on update of any ECOMTL record to see if the part number on the BOM is marked in the Part Master as Inactive = True. Only thing is it doesn’t work. It’s like it’s ignoring the ‘if’ statement where I check the Part.Inactive status field = true.

# Code:

/\* Define Variables \*/  
def var vc-Warning as char no-undo.  
def var myText as char no-undo.

/\* Search for current record being added or updated in the table \*/  
FOR EACH ttECOMtl WHERE (ttECOMtl.rowmod = “A” OR ttECOMtl.rowmod = “U”) NO-Lock:  
IF AVAIL ttECOMtl THEN DO:  
myText = ‘Stop 1 Found ttECOMtl Record Added or Updated’.  
{lib/PublishInfoMsg.i &InfoMsg = myText &InfoSeverity = {&MESSAGE\_INFO}}

```
/* Find where meets condition */
	for each Part WHERE Part.Company = ttECOMtl.Company AND 
											Part.PartNum = ttECOMtl.PartNum No-LOCK.

		/* If found proceed */
		IF AVAIL Part THEN Do:
					myText = 'Stop 2 Found the Part'.
					{lib/PublishInfoMsg.i &InfoMsg = myText &InfoSeverity = {&MESSAGE_INFO}}.

                                            /* Check the Parts Inactive Status; if TRUE then Error */
					if Part.Inactive = TRUE then do:
							myText = 'Stop 3 Found the Part and the Part is Inactive (True)'.
							{lib/PublishInfoMsg.i &InfoMsg = myText &InfoSeverity = {&MESSAGE_INFO}}

							vc-Warning = 'Error! The Part entered is Inactive - Invalid for Engineering Workbench BOM Selection'.
							{lib/PublishEx.i &ExType = {&MESSAGE_ERR} &ExMsg = vc-Warning}
					end. /* End if available Part */

		end. /* If Avail Part */

	end. /* For each part */

END. /* End outter IF ttECOMTL */

```

END. /\* FOR EACH \*/

---

<div class="post-metadata">

**Author:** ![jhenslee](https://www.epiusers.help/user_avatar/www.epiusers.help/jhenslee/32/805_2.png) [@jhenslee](https://www.epiusers.help/u/jhenslee)\
**Post date:** [January 9, 2018, 4:50pm UTC](https://www.epiusers.help/t/bpm-help-problem-interpreting-checkboxes/42119/2 "2018-01-09T16:50:25Z")

</div>

Never mind - figured it out. Just my silly coding mistake. Should be reading the part record with the MtlPartNumber and not the PartNum field.
