OnCheckSaleslineDates

This event can be used to check if the item lines dates are OK

Example and syntax

procedure OnCheckSaleslineDates(aParams:TScriptOnCheckSaleslineDatesParams);
begin
  //Production date must be a friday  
  if aParams.NewProductionDate > 0 then
  begin
    //NB: DayOfWeek counts sunday as day 1, so friday is day 6
    if DayOfWeek(aParams.NewProductionDate) <> 6 then 
      aParams.AddError('Production date must be a friday');
  end;    
end;

Last updated

Was this helpful?