jdtrent
(Joe D Trent)
October 29, 2021, 5:58pm
1
Hey,
I know this used to work, I think.
I want to get the original value of a field in job entry update. So I do something like:
That part works. But when I use this code I can’t see the row where RowMod = “”
Note that the “where” line is commented so I should get every row.
foreach(var ttJobHead_xRow in (from row in ttJobHead
//where row.RowMod == String.Empty
select row))
{
this.PublishInfoMessage("RowMod " + ttJobHead_xRow.RowMod, Ice.Common.BusinessObjectMessageType.Information, Ice.Bpm.InfoMessageDisplayMode.Individual, "", "");
}
All I’m getting is RowMod = “U”
If I add in the where statement to retrieve only the unchanged row I don’t get anything.
It does this in 10.2.300 and the 10.2.700 upgrade-in-process instance.
Losing my mind?
Thanks,
Joe
Hmm. I don’t think you’re losing your mind, unless I am too.
Too look at the unchanged row in pre-proc bpms, I usually do something like this:
foreach (var updated_OrderHedRow in ttOrderHed.Where(oh_u => oh_u.Updated()))
{
bool updated_Hold = updated_OrderHedRow.OrderHeld;
bool original_Hold = ttOrderHed.Where(oh_o =>
oh_o.Unchanged()
&& oh_o.Company == updated_OrderHedRow.Company
&& oh_o.SysRowID == updated_OrderHedRow.SysRowID
).Select(oh_o => oh_o.OrderHeld).FirstOrDefault();
and that approach seems to work well when I’ve tried it.
But I don’t know why you’re not seeing 2 rows with your code… @Rich @josecgomez - do you know why??
ckrusen
(Calvin Krusen)
October 30, 2021, 4:24pm
3
Are you sure the JobHead isn’t being updated too? Even if it’s an update to the JobMtl record that fired .Update(), there could have been a change to a field in JobHead. Like when you update an order line and the order header needs to update the order total.
Maybe the JobHead gets “touched” just to update the SysRevID value
gpayne
(Greg Payne)
October 30, 2021, 5:05pm
4
@jdtrent The condition is preventing it from getting to the custom code.
jdtrent
(Joe D Trent)
November 1, 2021, 2:47pm
5
Per Jason’s suggestion, I just read the DB file and got the original value, and it works fine now.
I know I’ve used this before, don’t know why it worked then and not now, but it’s all good.
It was getting to the custom code okay, but just wasn’t seeing the unchanged row.
Thanks, all.
Joe