OnGetProductSourceAltParams
Example and syntax
procedure OnGetProductSourceAltParams(aSalesline:TSalesLineWrapper; const aParams:TScriptOnGetProductSourceAltParams);
var
vMaterialOption : TVariantItemWrapper;
begin
if (aSalesline.Code='PT A') then
begin
vMaterialOption := aSalesline.Variants.GetMainItem(MaterialVar, levOne);
if assigned(vMaterialOption) and (vMaterialOption.SelCode = 'OAK') then
aParams.RemoveProductionLocation('LOC B'); //cannot produce this product in oak
end;
if (aSalesline.Code='PT B') then
begin
if aSalesline.HasCornerCuts then
aParams.RemoveSupplier('A1001'); //Cannot produce this product with cornercuts
end;
end;Last updated