E10 BPM triggering too often

I have a BPM that I want to trigger when a job is released. I put this BPM in the JobEntry.ChangeJobHeadJobReleased BO.Method. I’ve tried this in both Pre and Post Processing and in both the BPM fires both when I check and uncheck the box. The trace data says this:

     <paramDataSet name="ds" useDataSetNbr="0">
       <changedValue tableName="JobHead" rowState="Modified" rowNum="0" colName="JobReleased"><!     [CDATA[True]]></changedValue>
       <changedValue tableName="JobHead" rowState="Modified" rowNum="0" colName="UD_SysRevID"><!     [CDATA[System.Byte[]]]></changedValue>

my BPM starts out this way, and triggers both when I check and uncheck the released checkbox on the Job Entry screen

foreach( var ttJobHead_iterator in (from ttJobHead_Row in ttJobHead
where ttJobHead_Row.JobReleased == true &&
ttJobHead_Row.RowMod == IceRow.ROWSTATE_ADDED ||
ttJobHead_Row.RowMod == IceRow.ROWSTATE_UPDATED
select ttJobHead_Row))
var ttJobHeadRow = ttJobHead_iterator;

how do I get this to only fire when the release checkbox is checked?

I would imagine that a condition would fix this.

The Specified field(JobRelease) has changed from false to true? then if true continue?

Yeah, I needed to move the condition of checking for the JobHead.JobReleased value outside of the foreach statement. Even though I had a condition in my foreach statement that said only do this if JobHead.JobReleased is true it was firing even when it was false. I tested and confirmed this with a messaged box. So after the foreach statement I added an If(JobHead.JobReleased) and that worked. So checking it in the foreach didn’t work, but an if statement afterwards did work.

Another approach would be to put parenthesis around the or condition in the query.