ALAppExtensions
ALAppExtensions copied to clipboard
[Event Request] Table 37 "Sales Line", Function InitType; OnInitTypeOnBeforeAssignType
Hello, we need to influence the assignment of record type. Thank you in advance.
procedure InitType()
var
// - new
IsHandled: Boolean;
// + new
begin
if "Document No." <> '' then begin
if not SalesHeader.Get("Document Type", "Document No.") then
exit;
if (SalesHeader.Status = SalesHeader.Status::Released) and
(xRec.Type in [xRec.Type::Item, xRec.Type::"Fixed Asset"])
then
Type := Type::" "
// - change
// else
else begin
IsHandled := false;
OnInitTypeOnBeforeAssignType(Rec, xRec, IsHandled);
if not IsHandled then
// + change
Type := xRec.Type;
end;
end;
OnAfterInitType(Rec, xRec, SalesHeader);
end;
[IntegrationEvent(false, false)]
local procedure OnInitTypeOnBeforeAssignType(var SalesLine: Record "Sales Line"; var xSalesLine: Record "Sales Line"; var IsHandled: Boolean)
begin
end;
Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.