When I go into Case Entry and make any updates the start date is not getting populated like I want. I may be totally off base with the way I’m trying to do this. Any help would be appreciated.
Yeah this is a better answer than mine. But they’re still mapping the field to the actual ds table, I would think it would still update the field with a wrong answer then?
I think that’s good, try changing your ERP.HDCase to the ds.HDCase table with the same join and see if it sets then.
My next step troubleshooting that would be using the dev tools and Ctrl+Shift+V after I’d made the change but before hitting save to verify the HDCase dataview had changes and the change wasn’t going to one of the other dataviews.
I feel like the general consensus is not to use Data Directives, but I would use an In-Transaction Data Directive here. You just have to make sure you’re updating the ‘Update’ row (RowMod == “U”). I don’t think it’s possible to not have rows in a data directive, unlike what’s happening in your error above.
I put a message in and it looks like it doesn’t like me calling dsHDCase in the helpdesk.update in the method directive. But when I debug it is showing that it’s using dsHDCase
I haven’t had any success getting “Fill Table by Query” to work within a Method Directive. However, I’m open to corrections if anyone has managed to make it work.
Additionally, ds.HDCase does not retain UD fields in the update method. I verified this by checking under custom code maybe that is why Fill Table by Query doesn’t seem to be working under method?
That being said, you might want to try what @CaudilC suggested—moving the logic to a Data Directive. If that doesn’t work, custom code should be a reliable alternative. I tested this approach within HDCase In-Trans Data Directive, and it appears to be working as expected.
var y = ttHDCase
.FirstOrDefault(r => r.RowMod == "A" || r.RowMod == "U");
if (y.yourfield_c!= null)
{
var z = Db.ShipHead
.FirstOrDefault(s => s.Company == y.Company && s.PackNum == y.PackNum);
if (z != null)
{
y.yourfield_c = z.ShipDate;
}
}