I created a persistent method using JobEntry BO to delete a demand link for Job Entry by changing the RowMod to D and executing the Update. The JobProd table is deleted however the ProdQty in JobHead keeps the qty. If I delete the demand manually the JobHead.ProdQty changes to zero, has anyone faced that problem or am I missing something?
PS. the only method that is triggered when deleting is the update.
Yes I’m invoking the BO, this is the code (I hard coded the Job Num for testing):
Erp.Contracts.JobEntrySvcContract hJob = Ice.Assemblies.ServiceRenderer.GetService<Erp.Contracts.JobEntrySvcContract>(Db);
Erp.Tablesets.JobEntryTableset jobDataSet = new Erp.Tablesets.JobEntryTableset();
if (hJob != null)
{
jobDataSet = hJob.GetByID("2025");
var jobProdRow = (from row in jobDataSet.JobProd
where row.Company == Session.CompanyID && row.JobNum == "2025"
select row).FirstOrDefault();
if (jobProdRow != null)
{
jobProdRow.RowMod = "D"; // Deleting the make to stock demand link
hJob.Update(ref jobDataSet);
}
It would also be in the JobAssembly table and the Material Labor, Costs etc calculations would be off. Updating the field in the DB wouldn’t fix those things in my experience.
It would be passed through the business logic so wouldn’t that take care of things? Having said that I assumed that deleting the demand link would have done the same.