Set all From warehouses by BPM in mass issue from MFG screen

Need a help for setting all From warehouses when the From wharehouse changed in first row.
I have tried the BO massissueTomfg -> OnChangeWarehouse method, but it chages only 1 row at a time. i want to change all Warehouses to warehouse which was selected in 1st row. ?
Any suggestion ?

Thanks

Hi Prakash,

I think this code that we use for setting all warehouse pulls during Mass Issue to come from primary bin in warehouse that job is being manufactured in might help you get to the code you need. We do it as a post processing directive on Erp.MassIssueToMfg.BuildMassIssueBrowse

/*KB Warehouse Mass Issue */

//declarations
string WHSECode = string.Empty;
string MtlPartNo = string.Empty;
string ParentPartNo = string.Empty;
string JobPlant = string.Empty;
int OrderRelease = 0;
string PrimaryBin = string.Empty;

//table declarations
Erp.Tables.JobHead JobHead;
Erp.Tables.PartPlant PartPlant;
Erp.Tables.PlantWhse PlantWhse;
Erp.Tables.Warehse Warehse;
Erp.Tables.PartBin PartBin;

// Find first JobHead.JobNum = ttMassIssue.JobNum
foreach (var ttMassIssue_xRow in ttMassIssue)
{
var ttMassIssueRow = ttMassIssue_xRow;
JobHead = (from JobHead_Row in Db.JobHead
where JobHead_Row.Company == Session.CompanyID && JobHead_Row.JobNum == ttMassIssueRow.JobNum
select JobHead_Row).FirstOrDefault();
if (JobHead != null)
{ // Find PartPlant row
MtlPartNo = (ttMassIssueRow.PartNum);
JobPlant = (JobHead.Plant);
ParentPartNo = (JobHead.PartNum); /get the primary bin setup for the parent part/
PartPlant = (from PartPlant_Row in Db.PartPlant
where PartPlant_Row.PartNum == ParentPartNo && PartPlant_Row.Plant == JobPlant
select PartPlant_Row).FirstOrDefault();
if (PartPlant != null)
{
// Get WHSECode
WHSECode = (PartPlant.PrimWhse);
}
}
PlantWhse = (from PlantWhse_Row in Db.PlantWhse
where PlantWhse_Row.Company == Session.CompanyID && PlantWhse_Row.PartNum == MtlPartNo && PlantWhse_Row.WarehouseCode == WHSECode
select PlantWhse_Row).FirstOrDefault(); /get the part plant record primary bin info for the WH, this is stored in plantwhse/
if (PlantWhse != null)
{
// Get PrimBin
PrimaryBin = (PlantWhse.PrimBin);
Warehse = (from Warehse_Row in Db.Warehse
where Warehse_Row.Company == Session.CompanyID && Warehse_Row.WarehouseCode == WHSECode
select Warehse_Row).FirstOrDefault(); /if a primary bin in the warehouse being made to exists on the part/
if (!String.IsNullOrEmpty(PrimaryBin))
{
PartBin = (from PartBin_Row in Db.PartBin
where PartBin_Row.Company == Session.CompanyID && PartBin_Row.PartNum == MtlPartNo && PartBin_Row.BinNum == PrimaryBin
select PartBin_Row).FirstOrDefault(); /assign to pull matls from the primary bin in the associated production WH also assign warehouse and desc fields and StockQty/
if(PartBin != null)
{
ttMassIssueRow.BinNum = PrimaryBin;
ttMassIssueRow.Warehouse = PlantWhse.WarehouseCode;
ttMassIssueRow.WarehouseDescription = Warehse.Description;
ttMassIssueRow.StockQty = PartBin.OnhandQty;
}
}
}
}

HTH Nancy

Thanks @Nancy,
I have just created a BPM on post processing directive on Erp.MassIssueToMfg.BuildMassIssueBrowse as you said,but i have choosen the other way I.e, displayed a BPM Data form Asking for From warehouse. User selects his priority and the selected warehouse is getting selected for all Open issues.
:slight_smile:
Prakash