Why do you need this change?
We add a custom value to "Sales Document Type From" for an internal document type that behaves exactly like Quote/Order/Invoice/etc. for lookup purposes. LookupDocNo()'s case statement only calls LookupSalesDoc() for the built-in values, so for our custom type nothing runs and the lookup silently does nothing. LookupSalesDoc() reads only the report's own protected globals (FromDocType, FromSalesHeader, SalesHeader, FromDocNo), so if it were accessible we could call it directly instead of reimplementing its filtering and lookup logic in our own code.
Describe the request
Change LookupSalesDoc from local to protected so a report extension can call it directly for custom document types not in the base case statement.
protected procedure LookupSalesDoc()
begin
OnBeforeLookupSalesDoc(FromSalesHeader, SalesHeader, FromDocType);
...
end;
Alternatives evaluated:
- A new event in LookupDocNo()'s case statement for unhandled document types: would still require us to duplicate LookupSalesDoc()'s entire filter-and-lookup body in our own subscriber, since the event can't hand back a call into the private procedure itself.
- OnBeforeLookupDocNo (already exists, already used by us to intercept before the case runs): confirms our custom type never reaches LookupSalesDoc(), but doesn't expose it.
Internal work item: AB#645070
Why do you need this change?
We add a custom value to "Sales Document Type From" for an internal document type that behaves exactly like Quote/Order/Invoice/etc. for lookup purposes. LookupDocNo()'s case statement only calls LookupSalesDoc() for the built-in values, so for our custom type nothing runs and the lookup silently does nothing. LookupSalesDoc() reads only the report's own protected globals (FromDocType, FromSalesHeader, SalesHeader, FromDocNo), so if it were accessible we could call it directly instead of reimplementing its filtering and lookup logic in our own code.
Describe the request
Change LookupSalesDoc from local to protected so a report extension can call it directly for custom document types not in the base case statement.
Alternatives evaluated:
Internal work item: AB#645070