Hello everyone! I hope you’re having a great day. I’ve personally had better, but that’s where I am hoping you can help.
I have an Updateable dashboard that is customized on the dashboard assembly. Long story short, I am pulling up all open order releases and giving myself a calculated checkbox that I look at during the Update method to identify which records I am updating. For some strange reason, if I don’t explicitly unselect the last row I edited, that row is omitted from the update even though it has a checked check box. I’ve seen it completely omit it and I’ve also seen it include the row but not include the last cell update on the row. I can hack my around that until I only have 1 row in the data set
I am sure it has something to do with the EDV not getting notified or something to that effect… I’ll add my code just in case you want to check it out. Forgive me for not having comments in there yet… basically, I’m creating a new UD100 record and all the UD100A child records associated to it based on this CheckBox being true.
int changeNum = 0;
int countRows = (from ud in Db.UD100
select ud).Count();
if (countRows > 0)
{
changeNum = (int)(from ud in Db.UD100
select ud.Number01).Max();
}
changeNum++;
var firstRow = (from q in ttResults
where q.OrderRel_Company == callContextClient.CurrentCompany
&& q.Calculated_ChangeRelease == true
select q).FirstOrDefault();
if (firstRow != null)
{
string changeType = firstRow.Calculated_ChangeType;
string comments = firstRow.Calculated_Comments;
string changeOrigin = firstRow.Calculated_ChangeOrigin;
Ice.Contracts.UD100SvcContract boUD100 = Ice.Assemblies.ServiceRenderer.GetService<Ice.Contracts.UD100SvcContract>(Db);
Ice.Tablesets.UD100Tableset dsUD100 = new Ice.Tablesets.UD100Tableset();
boUD100.GetaNewUD100(ref dsUD100);
var newUD100 = (from ud in dsUD100.UD100
where ud.RowMod == "A"
select ud).FirstOrDefault();
if (newUD100 != null)
{
newUD100.Key1 = changeNum.ToString();
newUD100.Number01 = changeNum;
newUD100.ShortChar01 = changeType;
newUD100.Character01 = comments;
newUD100.ShortChar02 = "NEW";
newUD100.ShortChar03 = callContextClient.CurrentUserId;
newUD100.ShortChar05 = changeOrigin;
newUD100.Date01 = DateTime.Today;
newUD100.CheckBox01 = true;
boUD100.Update(ref dsUD100);
}
foreach (var eachRow in (from q in ttResults
where q.OrderRel_Company == callContextClient.CurrentCompany
&& q.Calculated_ChangeRelease == true
select q))
{
int orderNum = eachRow.OrderRel_OrderNum;
int orderLine = eachRow.OrderRel_OrderLine;
int orderRelNum = eachRow.OrderRel_OrderRelNum;
DateTime proposedDate = (DateTime)eachRow.Calculated_ProposedDate;
DateTime originalDate = (DateTime)eachRow.OrderRel_ReqDate;
string proposedPart = eachRow.Calculated_ProposedPartNum;
boUD100.GetaNewUD100A(ref dsUD100, changeNum.ToString(), "", "", "", "");
var newUD100A = (from ud in dsUD100.UD100A
where ud.RowMod == "A"
&& ud.ChildKey1 == ""
select ud).FirstOrDefault();
if (newUD100A != null)
{
newUD100A.Key1 = changeNum.ToString();
newUD100A.ChildKey1 = orderNum.ToString();
newUD100A.ChildKey2 = orderLine.ToString();
newUD100A.ChildKey3 = orderRelNum.ToString();
newUD100A.Number01 = changeNum;
newUD100A.Number02 = orderNum;
newUD100A.Number03 = orderLine;
newUD100A.Number04 = orderRelNum;
newUD100A.ShortChar01 = changeType;
newUD100A.Character01 = comments;
newUD100A.Date01 = proposedDate;
newUD100A.ShortChar03 = proposedPart;
newUD100A.CheckBox01 = true;
newUD100A.ShortChar02 = "NEW";
newUD100A.Date03 = originalDate;
boUD100.Update(ref dsUD100);
}
}
}
I can send the dashboard customization as well (it’s a little clumsy because I’ve been trying different things). So what I mean by the rows aren’t coming in, on UD100A, it will be missing the last row I had selected. So it leads me to believe that when the dataset gets to the Method Directive, it does not contain the last row. (I’ve confirmed by Messages that pop up and display the dataset). I see your point. The issue probably isn’t in the BPM but rather the customization.
Forgive me if I missed it, but this Calculated Checkbox you are checking, is it passed down from the BAQ as an updatable field, or is it something you are creating on the fly to check something in the local customization?
Dude I’m with your boss. I am working remotely today because my wife is bedridden with the flu and I suspected I might also be coming down with it… and as the hours tick by, I feel worse and worse. 102 Temp. Body aches. Sucks to suck.
I think I may have stumbled on to something. I am firing the ultraGrid.Update() method in a Before Tool click event on the SaveMenu tool as well as the giant Save button I put in there. It seems to be working now. At least, I can’t replicate my issue. I’m sure the users will poke holes though.
@klincecum I hope you’re feeling better today.
Whatever I thought I fixed last week, it’s back at its tricks again. In today’s instance, I used my “Select All” button to check all the rows in my grid (6 of them). Then I set my fields using my handy Copy To All Selected button. All rows have data entered in them and ready for me to “Update” the BAQ. I fire the Save button and lo and behold, the first row (the one I happened to be selected on) did not make it into the Update dataset. WTF!? Should I try to “unselect” the row before firing the update? Is it because I’m not actually filling out the row myself and using a button click event to populate the row?
Incidentally, my wife and I recently stumbled across the house from that movie while in Winnetka, IL to visit a greenhouse that was closing up shop. No joke, it’s just a random house (albeit in a very nice area) in a suburb of Chicago.
So the idea of this dashboard is supposed to grab all releases on an order to allow a user to select which ones they want to put in a change request for. You select the first column either by clicking each line or by pressing the Select All button. If you have a mass update, you can put the details in on the left and click Copy To Selected. It fills in all the rows with a check box in them with those details. Or you can manually fill in each line if they are different.