OnCheckSalesheaderRules
This event can be used to check order header rules
Example and syntax
procedure OnCheckSalesheaderRules(aWrapper:TSalesheaderWrapper);
begin
  //Required E-mail adress
  if (aWrapper.DebtorAccount <> '') and (aWrapper.Email = '') then
  begin
    if aWrapper.SalesType = 0 then //Quote
      aWrapper.AddRuleWarning('EMAIL','E-mail adress must be entered before quote is converted to order');
    if aWrapper.SalesType = 1 then //Order
      aWrapper.AddRuleViolation('EMAIL','E-mail adress must be entered');    
  end;
end;Last updated
Was this helpful?