Skip to content

Commit

Permalink
Refactor GetTableCaption and GetTableName procedures to use AllObjWit… (
Browse files Browse the repository at this point in the history
  • Loading branch information
Bertverbeek4PS authored Jan 17, 2025
2 parents e8f5a16 + ae936e5 commit c66d952
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions businessCentral/app/src/Util.Codeunit.al
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ codeunit 82564 "ADLSE Util"

procedure GetTableCaption(TableID: Integer): Text
var
RecordRef: RecordRef;
AllObjWithCaption: Record AllObjWithCaption;
begin
RecordRef.Open(TableID);
exit(RecordRef.Caption());
if AllObjWithCaption.Get(AllObjWithCaption."Object Type"::Table, TableID) then
exit(AllObjWithCaption."Object Caption");
end;

procedure GetDataLakeCompliantTableName(TableID: Integer) TableName: Text
Expand All @@ -155,10 +155,10 @@ codeunit 82564 "ADLSE Util"

procedure GetTableName(TableID: Integer) TableName: Text
var
RecordRef: RecordRef;
AllObjWithCaption: Record AllObjWithCaption;
begin
RecordRef.Open(TableID);
TableName := RecordRef.Name;
if AllObjWithCaption.Get(AllObjWithCaption."Object Type"::Table, TableID) then
TableName := AllObjWithCaption."Object Name";
end;

procedure GetDataLakeCompliantName(Name: Text) Result: Text
Expand Down Expand Up @@ -382,7 +382,7 @@ codeunit 82564 "ADLSE Util"
var
TableMetadata: Record "Table Metadata";
begin
if TableMetadata.get(TableID)then
if TableMetadata.get(TableID) then
exit(TableMetadata.DataPerCompany);
end;

Expand Down

0 comments on commit c66d952

Please sign in to comment.