Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#260 Add Support for Arrays on Page Extensions #261

Merged
merged 2 commits into from
Dec 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/NAVObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ class NAVPageField {
private _suffix: string;

public static fieldRegEx(): RegExp {
return /.*(field\( *"?([ a-zA-Z0-9._/&%\/()-]+)"? *; *([" a-zA-Z0-9._/&%\/()-]+) *\))/g;
return /.*(field\( *"?([ a-zA-Z0-9._/&%\/()-]+)"? *; *([" a-zA-Z0-9._/&%\/()-]+(\[([1-9]\d*)\])?) *\))/g;
}

get nameFixed(): string {
Expand Down
4 changes: 2 additions & 2 deletions src/test/suite/NAVObject.PrefexAndSuffix.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ suite("NAVObject ObjectNamePrefix Tests", () => {
let navObject = new NAVObject(navTestObject.ObjectText, testSettings, navTestObject.ObjectFileName)

assert.strictEqual(navObject.pageGroups.length, 2);
assert.strictEqual(navObject.pageFields.length, 3);
assert.strictEqual(navObject.pageFields.length, 5);
navObject.pageFields.forEach(field => {
assert.strictEqual(field.nameFixed.startsWith(testSettings[Settings.ObjectNamePrefix]), true)
})
Expand All @@ -128,7 +128,7 @@ suite("NAVObject ObjectNamePrefix Tests", () => {
let navObject = new NAVObject(navTestObject.ObjectText, testSettings, navTestObject.ObjectFileName)

assert.strictEqual(navObject.pageGroups.length, 2);
assert.strictEqual(navObject.pageFields.length, 3);
assert.strictEqual(navObject.pageFields.length, 5);
navObject.pageFields.forEach(field => {
assert.strictEqual(field.nameFixed.endsWith(testSettings[Settings.ObjectNameSuffix]), true)
})
Expand Down
28 changes: 28 additions & 0 deletions src/test/suite/NAVTestObjectLibrary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,34 @@ export function getPageExtensionWrongFileNameWithActions(): NAVTestObject {
{
ApplicationArea = All;
}
field(ShortcutDimCode3; ShortcutDimCode[3])
{
ApplicationArea = Dimensions;
CaptionClass = '1,2,3';
TableRelation = "Dimension Value".Code WHERE("Global Dimension No." = CONST(3),
"Dimension Value Type" = CONST(Standard),
Blocked = CONST(false));
Visible = DimVisible3;

trigger OnValidate()
begin
ValidateShortcutDimension(3);
end;
}
field(ShortcutDimCode4; ShortcutDimCode[4])
{
ApplicationArea = Dimensions;
CaptionClass = '1,2,4';
TableRelation = "Dimension Value".Code WHERE("Global Dimension No." = CONST(4),
"Dimension Value Type" = CONST(Standard),
Blocked = CONST(false));
Visible = DimVisible4;

trigger OnValidate()
begin
ValidateShortcutDimension(4);
end;
}
}
}
}
Expand Down