diff --git a/.vscode/picazin.ruleset.json b/.vscode/picazin.ruleset.json index 8eab92f..78719b6 100644 --- a/.vscode/picazin.ruleset.json +++ b/.vscode/picazin.ruleset.json @@ -2,35 +2,20 @@ "name": "picazin", "description": "picazin rules", "rules": [ - { - "id": "AA0214", - "action": "Hidden", - "justification": "WTF?!?! - The local record should be modified before saving to the database." - }, { "id": "AA0218", "action": "Hidden", "justification": "No efficient - You must write a tooltip in the Tooltip property for all controls of type Action and Field that exist on page objects. See the style guide for more information." }, { - "id": "AW0006", - "action": "Hidden", - "justification": "No need all objects to be searchable." - }, - { - "id": "AS0084", - "action": "Hidden", - "justification": "No AppSource extension" - } , - { - "id": "AS0085", + "id": "AA0072", "action": "Hidden", - "justification": "No AppSource extension" + "justification": "WTF?!?!" }, { - "id": "AA0072", + "id": "AW0006", "action": "Hidden", - "justification": "WTF?!?!" + "justification": "No need all objects to be searchable." }, { "id": "AL0604", diff --git a/.vscode/settings.json b/.vscode/settings.json index 3254652..7f4d495 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,7 +2,7 @@ "al.codeAnalyzers": [ "${CodeCop}", "${UICop}", - "${AppSourceCop}" + "${PerTenantExtensionCop}" ], "al.ruleSetPath": ".vscode/picazin.ruleset.json", "CRS.FileNamePattern": "..al", diff --git a/Translations/Extension Manager.es-ES.g.xlf b/Translations/Extension Manager.es-ES.g.xlf index 79282d7..3437ff5 100644 --- a/Translations/Extension Manager.es-ES.g.xlf +++ b/Translations/Extension Manager.es-ES.g.xlf @@ -371,6 +371,12 @@ Page EXM Extension Header - Control Object Ending ID - Property Caption Nº final + + %1 should have value. + ESP="%1 deberia tener valor." + Page EXM Extension Header - Method OnQueryClosePage - NamedType EmptyIDMsg + %1 deberia tener valor. + Extension Objects ESP="Objetos extensión" diff --git a/Translations/Extension Manager.g.xlf b/Translations/Extension Manager.g.xlf index 5ea7320..1561d79 100644 --- a/Translations/Extension Manager.g.xlf +++ b/Translations/Extension Manager.g.xlf @@ -318,6 +318,11 @@ ESP="Nº final" Page EXM Extension Header - Control Object Ending ID - Property Caption + + %1 should have value. + ESP="%1 deberia tener valor." + Page EXM Extension Header - Method OnQueryClosePage - NamedType EmptyIDMsg + Extension Objects ESP="Objetos extensión" diff --git a/app.json b/app.json index c737ebe..c880187 100644 --- a/app.json +++ b/app.json @@ -2,7 +2,7 @@ "id": "b9954c96-ee6b-44ff-9b0d-3d8146fc034a", "name": "Extension Manager", "publisher": "picazin dev", - "version": "0.2.9.4", + "version": "0.3.0.0", "brief": "Manager for developing extensions.", "description": "Manage your extension data. Development status. Customers, invoicing and all related data.", "privacyStatement": "http://www.picazin.dev", diff --git a/extensionsPermissionSet.xml b/extensionsPermissionSet.xml index e304a04..f47f906 100644 --- a/extensionsPermissionSet.xml +++ b/extensionsPermissionSet.xml @@ -101,6 +101,26 @@ 1 + + 83206 + 0 + 1 + 1 + 1 + 1 + 0 + + + + 83206 + 1 + 0 + 0 + 0 + 0 + 1 + + 83207 0 @@ -142,7 +162,7 @@ - 83206 + 83208 0 1 1 @@ -152,7 +172,7 @@ - 83206 + 83208 1 0 0 @@ -221,6 +241,26 @@ 1 + + 83219 + 8 + 0 + 0 + 0 + 0 + 1 + + + + 83220 + 8 + 0 + 0 + 0 + 0 + 1 + + 83213 8 @@ -322,7 +362,7 @@ - 83207 + 83217 8 0 0 @@ -332,7 +372,7 @@ - 83212 + 83216 8 0 0 @@ -342,7 +382,7 @@ - 83204 + 83218 8 0 0 @@ -352,7 +392,7 @@ - 83206 + 83207 8 0 0 @@ -362,7 +402,7 @@ - 83216 + 83212 8 0 0 @@ -372,7 +412,7 @@ - 83218 + 83204 8 0 0 @@ -382,7 +422,7 @@ - 83217 + 83206 8 0 0 diff --git a/src/codeunit/EXMInstallSetup.Codeunit.al b/src/codeunit/EXMInstallSetup.Codeunit.al index 7e61dce..a3daece 100644 --- a/src/codeunit/EXMInstallSetup.Codeunit.al +++ b/src/codeunit/EXMInstallSetup.Codeunit.al @@ -59,4 +59,9 @@ codeunit 83201 "EXM Install Setup" ExtEnum.ModifyAll("Customer No.", ExtHeader."Customer No."); end; + [EventSubscriber(ObjectType::Codeunit, Codeunit::"Company-Initialize", 'OnCompanyInitialize', '', false, false)] + local procedure CompanyInitialize() + begin + + end; } \ No newline at end of file diff --git a/src/page/EXMExtensionHeader.Page.al b/src/page/EXMExtensionHeader.Page.al index 67bb660..24434c7 100644 --- a/src/page/EXMExtensionHeader.Page.al +++ b/src/page/EXMExtensionHeader.Page.al @@ -107,10 +107,15 @@ page 83201 "EXM Extension Header" end; trigger OnQueryClosePage(CloseAction: Action): Boolean + var + EmptyIDMsg: Label '%1 should have value.', comment = 'ESP="%1 deberia tener valor."'; begin if Code <> '' then begin - TestField("Object Starting ID"); - TestField("Object Ending ID"); + if Rec."Object Starting ID" = 0 then + Message(StrSubstNo(EmptyIDMsg, Rec.FieldCaption("Object Starting ID"))); + + if Rec."Object Ending ID" = 0 then + Message(StrSubstNo(EmptyIDMsg, Rec.FieldCaption("Object Ending ID"))); end; end; } \ No newline at end of file diff --git a/src/table/EXMExtensionHeader.Table.al b/src/table/EXMExtensionHeader.Table.al index b44cb2f..062a9a2 100644 --- a/src/table/EXMExtensionHeader.Table.al +++ b/src/table/EXMExtensionHeader.Table.al @@ -39,11 +39,14 @@ table 83201 "EXM Extension Header" var EXMExtMgt: Codeunit "EXM Extension Management"; begin - if (("Object Starting ID" > "Object Ending ID") and ("Object Ending ID" <> 0)) then - "Object Ending ID" := "Object Starting ID"; + if xRec."Object Starting ID" <> Rec."Object Starting ID" then begin + if (("Object Starting ID" > "Object Ending ID") and ("Object Ending ID" <> 0)) then + "Object Ending ID" := "Object Starting ID"; - EXMExtMgt.AllowedObjectsID("Object Starting ID"); - CheckObjectRange(); + if "Object Starting ID" <> 0 then + EXMExtMgt.AllowedObjectsID("Object Starting ID"); + CheckObjectRange(); + end; end; } field(5; "Object Ending ID"; Integer) @@ -56,11 +59,14 @@ table 83201 "EXM Extension Header" EXMExtMgt: Codeunit "EXM Extension Management"; ObjectRangeErr: Label '%1 must be greater then %2.', comment = 'ESP="%1 debe ser superior a %2."'; begin - if ("Object Ending ID" < "Object Starting ID") then - Error(ObjectRangeErr, FieldCaption("Object Ending ID"), FieldCaption("Object Starting ID")); + if xRec."Object Ending ID" <> Rec."Object Ending ID" then begin + if ("Object Ending ID" < "Object Starting ID") then + Error(ObjectRangeErr, FieldCaption("Object Ending ID"), FieldCaption("Object Starting ID")); - EXMExtMgt.AllowedObjectsID("Object Ending ID"); - CheckObjectRange(); + if "Object Ending ID" <> 0 then + EXMExtMgt.AllowedObjectsID("Object Ending ID"); + CheckObjectRange(); + end; end; } field(6; "Customer No."; Code[20]) @@ -104,7 +110,7 @@ table 83201 "EXM Extension Header" { Caption = 'Dependencies', Comment = 'ESP="Dependencias"'; FieldClass = FlowField; - CalcFormula = Count ("EXM Extension Dependencies" where("Extensión Code" = field(Code))); + CalcFormula = Count("EXM Extension Dependencies" where("Extensión Code" = field(Code))); Editable = false; } @@ -147,84 +153,84 @@ table 83201 "EXM Extension Header" { Caption = 'No. of Tables', Comment = 'ESP="Nº Tablas"'; FieldClass = FlowField; - CalcFormula = count ("EXM Extension Lines" where("Extension Code" = field(Code), "Object Type" = filter(Table))); + CalcFormula = count("EXM Extension Lines" where("Extension Code" = field(Code), "Object Type" = filter(Table))); Editable = false; } field(26; "No. of Reports"; Integer) { Caption = 'No. of Reports', Comment = 'ESP="Nº Informes"'; FieldClass = FlowField; - CalcFormula = count ("EXM Extension Lines" where("Extension Code" = field(Code), "Object Type" = filter(Report))); + CalcFormula = count("EXM Extension Lines" where("Extension Code" = field(Code), "Object Type" = filter(Report))); Editable = false; } field(27; "No. of Codeunits"; Integer) { Caption = 'No. of Codeunits', Comment = 'ESP="Nº Codeunits"'; FieldClass = FlowField; - CalcFormula = count ("EXM Extension Lines" where("Extension Code" = field(Code), "Object Type" = filter(Codeunit))); + CalcFormula = count("EXM Extension Lines" where("Extension Code" = field(Code), "Object Type" = filter(Codeunit))); Editable = false; } field(28; "No. of XMLports"; Integer) { Caption = 'No. of XMLports', Comment = 'ESP="Nº XMLports"'; FieldClass = FlowField; - CalcFormula = count ("EXM Extension Lines" where("Extension Code" = field(Code), "Object Type" = filter(XMLport))); + CalcFormula = count("EXM Extension Lines" where("Extension Code" = field(Code), "Object Type" = filter(XMLport))); Editable = false; } field(29; "No. of Page"; Integer) { Caption = 'No. of Pages', Comment = 'ESP="Nº Pages"'; FieldClass = FlowField; - CalcFormula = count ("EXM Extension Lines" where("Extension Code" = field(Code), "Object Type" = filter(Page))); + CalcFormula = count("EXM Extension Lines" where("Extension Code" = field(Code), "Object Type" = filter(Page))); Editable = false; } field(30; "No. of Querys"; Integer) { Caption = 'No. of Querys', Comment = 'ESP="Nº Querys"'; FieldClass = FlowField; - CalcFormula = count ("EXM Extension Lines" where("Extension Code" = field(Code), "Object Type" = filter(Query))); + CalcFormula = count("EXM Extension Lines" where("Extension Code" = field(Code), "Object Type" = filter(Query))); Editable = false; } field(31; "No. of PageExtensions"; Integer) { Caption = 'No. of PageExtensions', Comment = 'ESP="Nº PageExtensions"'; FieldClass = FlowField; - CalcFormula = count ("EXM Extension Lines" where("Extension Code" = field(Code), "Object Type" = filter("PageExtension"))); + CalcFormula = count("EXM Extension Lines" where("Extension Code" = field(Code), "Object Type" = filter("PageExtension"))); Editable = false; } field(32; "No. of TableExtensions"; Integer) { Caption = 'No. of TableExtensions', Comment = 'ESP="Nº TableExtensions"'; FieldClass = FlowField; - CalcFormula = count ("EXM Extension Lines" where("Extension Code" = field(Code), "Object Type" = filter("TableExtension"))); + CalcFormula = count("EXM Extension Lines" where("Extension Code" = field(Code), "Object Type" = filter("TableExtension"))); Editable = false; } field(33; "No. of Enums"; Integer) { Caption = 'No. of Enums', Comment = 'ESP="Nº Enums"'; FieldClass = FlowField; - CalcFormula = count ("EXM Extension Lines" where("Extension Code" = field(Code), "Object Type" = filter(Enum))); + CalcFormula = count("EXM Extension Lines" where("Extension Code" = field(Code), "Object Type" = filter(Enum))); Editable = false; } field(34; "No. of EnumExtensions"; Integer) { Caption = 'No. of EnumExtensions', Comment = 'ESP="Nº EnumExtensions"'; FieldClass = FlowField; - CalcFormula = count ("EXM Extension Lines" where("Extension Code" = field(Code), "Object Type" = filter(EnumExtension))); + CalcFormula = count("EXM Extension Lines" where("Extension Code" = field(Code), "Object Type" = filter(EnumExtension))); Editable = false; } field(35; "No. of Profiles"; Integer) { Caption = 'No. of Profiles', Comment = 'ESP="Nº Profiles"'; FieldClass = FlowField; - CalcFormula = count ("EXM Extension Lines" where("Extension Code" = field(Code), "Object Type" = filter(Profile))); + CalcFormula = count("EXM Extension Lines" where("Extension Code" = field(Code), "Object Type" = filter(Profile))); Editable = false; } field(36; "No. of ProfileExtensions"; Integer) { Caption = 'No. of ProfileExtensions', Comment = 'ESP="Nº ProfileExtensions"'; FieldClass = FlowField; - CalcFormula = count ("EXM Extension Lines" where("Extension Code" = field(Code), "Object Type" = filter("ProfileExtension"))); + CalcFormula = count("EXM Extension Lines" where("Extension Code" = field(Code), "Object Type" = filter("ProfileExtension"))); Editable = false; } field(50; "GIT Repository URL"; Text[2048]) @@ -338,11 +344,10 @@ table 83201 "EXM Extension Header" ExtSetup: Record "EXM Extension Setup"; NoSeriesMgt: Codeunit NoSeriesManagement; begin - if Code = '' then begin - ExtSetup.Get(); + ExtSetup.Get(); + if Code = '' then if ExtSetup."Extension Nos." <> '' then Code := NoSeriesMgt.GetNextNo(ExtSetup."Extension Nos.", 0D, true); - end; "Object Starting ID" := ExtSetup."Default Object Starting ID"; "Object Ending ID" := ExtSetup."Default Object Ending ID"; diff --git a/src/table/EXMExtensionLines.Table.al b/src/table/EXMExtensionLines.Table.al index c427e75..7a04520 100644 --- a/src/table/EXMExtensionLines.Table.al +++ b/src/table/EXMExtensionLines.Table.al @@ -314,12 +314,15 @@ table 83202 "EXM Extension Lines" If EXMSetup."Disable Auto. Objects ID" then exit; + EXMExtHeader.Get("Extension Code"); + if EXMExtHeader."Object Ending ID" = 0 then + exit; + IsHandled := false; OnBeforeCalculateObjectID(ObjectType, CustNo, ObjectID, IsHandled); if IsHandled then exit(ObjectID); - EXMExtHeader.Get("Extension Code"); EXMExtLine.SetCurrentKey("Customer No.", "Object Type", "Object ID"); EXMExtLine.SetRange("Customer No.", CustNo); EXMExtLine.SetRange("Object Type", ObjectType); @@ -342,11 +345,11 @@ table 83202 "EXM Extension Lines" end else ObjectID := EXMExtHeader."Object Starting ID"; + OnAfterAssignObjectID(ObjectType, CustNo, ObjectID); + if ObjectID > EXMExtHeader."Object Ending ID" then Error(ObjectIdErr, ObjectID, EXMExtHeader."Object Ending ID"); - OnAfterAssignObjectID(ObjectType, CustNo, ObjectID); - exit(ObjectID) end;