RE: Any method to require item B to Purchase if Item A showed up in Planning Worksheet
You could use another item no. at the item card. F.ex Common Item no. if you don't do inter company transactions where you need that.
Then subscribe to an event in the create PO from Req. worksheet process and and start to check if the items common item no. also is on the req. worksheet or not. If so add it either to the req. worksheet or directly on the PO.
That saves you for doing much extensions on the item table and you can use one simple codeunit to handle it all.
Maybe you can use one of these event subscribers?
[EventSubscriber(ObjectType::Codeunit, Codeunit::AddOnIntegrManagement, 'OnAfterTransferFromReqLineToPurchLine', '', false, false)]
local procedure OnAfterTransferFromReqLineToPurchLine(var PurchOrderLine: Record "Purchase Line"; var ReqLine: Record "Requisition Line");
begin
end;
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Req. Wksh.-Make Order", 'OnAfterInsertPurchOrderLine', '', false, false)]
local procedure OnAfterInsertPurchOrderLine(var PurchOrderLine: Record "Purchase Line"; var NextLineNo: Integer; var RequisitionLine: Record "Requisition Line"; var PurchOrderHeader: Record "Purchase Header");
begin
end;