From dc2b2576586e46db3a8beb9807c25aeab77d3621 Mon Sep 17 00:00:00 2001 From: Steffen Balslev Date: Tue, 19 Dec 2023 12:05:21 +0100 Subject: [PATCH] Update snippets --- snippets/al.json | 20 ++++ snippets/entitlement.json | 15 +++ snippets/interface.json | 12 ++ snippets/page.json | 173 ++++++++++++++++++++++++++- snippets/permissionset.json | 15 +++ snippets/permissionsetextension.json | 14 +++ snippets/profile.json | 15 ++- snippets/report.json | 41 +++++-- snippets/reportextension.json | 29 +++++ snippets/table.json | 23 +++- snippets/tableextension.json | 19 ++- snippets/tenantwebservice.xml.json | 19 --- 12 files changed, 355 insertions(+), 40 deletions(-) create mode 100644 snippets/entitlement.json create mode 100644 snippets/interface.json create mode 100644 snippets/permissionset.json create mode 100644 snippets/permissionsetextension.json create mode 100644 snippets/reportextension.json delete mode 100644 snippets/tenantwebservice.xml.json diff --git a/snippets/al.json b/snippets/al.json index 57e8d7b..e082700 100644 --- a/snippets/al.json +++ b/snippets/al.json @@ -154,6 +154,26 @@ ], "description": "Snippet: Business Event" }, + "Snippet: Internal Event": { + "prefix": "teventinternal", + "body": [ + "[InternalEvent(${1:IncludeSender})]", + "local procedure ${0:MyProcedure}()", + "begin", + "end;" + ], + "description": "Snippet: Internal Event" + }, + "Snippet: External Business Event": { + "prefix": "teventexternal", + "body": [ + "[ExternalBusinessEvent(${1:Name}, ${2:DisplayName}, ${3:Description}, ${4:Category}, ${5:Version})]", + "local procedure ${0:MyProcedure}()", + "begin", + "end;" + ], + "description": "Snippet: External Business Event" + }, "Snippet: Caption ML": { "prefix": "tcaptionml", "body": [ diff --git a/snippets/entitlement.json b/snippets/entitlement.json new file mode 100644 index 0000000..94a7a0d --- /dev/null +++ b/snippets/entitlement.json @@ -0,0 +1,15 @@ +{ + "Snippet: Entitlement": { + "prefix": "tentitlement", + "body": [ + "entitlement \"${1:MyEntitlement}\"", + "{", + "\tType = ${2|Application,ApplicationScope,ConcurrentUserServicePlan,FlatRateServicePlan,Implicit,PerUserServicePlan,Role,Group|};", + "\tRoleType =${3|Delegated,Local|};", + "\tId = '${4:MyId}';", + "\tObjectEntitlements = \"${0:MyListofObjects}\";", + "}" + ], + "description": "Snippet: Entitlement" + } +} \ No newline at end of file diff --git a/snippets/interface.json b/snippets/interface.json new file mode 100644 index 0000000..64983e2 --- /dev/null +++ b/snippets/interface.json @@ -0,0 +1,12 @@ +{ + "Snippet: Interface": { + "prefix": "tinterface", + "body": [ + "interface ${1:MyInterface}", + "{", + "\tprocedure ${0:MyProcedure}();", + "}" + ], + "description": "Snippet: Interface" + } +} \ No newline at end of file diff --git a/snippets/page.json b/snippets/page.json index 07b7d98..847ff15 100644 --- a/snippets/page.json +++ b/snippets/page.json @@ -57,6 +57,16 @@ ], "description": "Snippet: Page Field" }, + "Snippet: Group": { + "prefix": "tgroup", + "body": [ + "group(${1:GroupName})", + "{", + "\t$0", + "}" + ], + "description": "Snippet: Page Group" + }, "Snippet: Action": { "prefix": "taction", "body": [ @@ -72,6 +82,55 @@ ], "description": "Snippet: Page Action" }, + "Snippet: Selection-Aware Action": { + "prefix": "tactionselectionaware", + "body": [ + "action(${1:ActionName})", + "{", + "\tScope = ${2|PageFilter,RepeaterRow,RepeaterSelection|};", + "\t", + "\ttrigger OnAction()", + "\tbegin", + "\t\t$0", + "\tend;", + "}" + ], + "description": "Snippet: Selection-Aware Action" + }, + "Snippet: Action Ref": { + "prefix": "tactionref", + "body": [ + "actionref(${1:ActionRefName}; ${2:ActionName})", + "{", + "\t$0", + "}" + ], + "description": "Snippet: Page Action Ref" + }, + "Snippet: Custom Action": { + "prefix": "tcustomaction", + "body": [ + "customaction(${1:CustomActionName})", + "{", + "\tApplicationArea = ${2|All,Basic,Suite,Advanced|};", + "\t$0", + "}" + ], + "description": "Snippet: Page Custom Action" + }, + "Snippet: System Action": { + "prefix": "tsystemaction", + "body": [ + "systemaction(${1|Generate,Attach,Cancel,Ok,Regenerate|})", + "{", + "\ttrigger OnAction()", + "\tbegin", + "\t\t$0", + "\tend;", + "}" + ], + "description": "Snippet: Page Custom Action" + }, "Snippet: User Control": { "prefix": "tusercontrol", "body": [ @@ -87,12 +146,25 @@ ], "description": "Snippet: Page User Control" }, - "Snippet: View": { + "Snippet: View Shared Layout": { + "prefix": "tview", + "body": [ + "view(${1:ViewName})", + "{", + "\tCaption = '${2:ViewCaption}';", + "\tFilters = where(${3:TableFieldName} = filter(${0:FilterValue}));", + "}" + ], + "description": "Snippet: Page View without layout changes" + }, + "Snippet: View Detached Layout": { "prefix": "tview", "body": [ "view(${1:ViewName})", "{", "\tCaption = '${2:ViewCaption}';", + "\tFilters = where(${3:TableFieldName} = filter(${4:FilterValue}));", + "\tSharedLayout = false;", "\t", "\tlayout", "\t{", @@ -100,19 +172,20 @@ "\t}", "}" ], - "description": "Snippet: Page View" + "description": "Snippet: Page View with layout changes" }, "Snippet: Part": { "prefix": "tpart", "body": [ "part(${1:PartName}; ${2:PartSource})", "{", + "\tApplicationArea = ${3|All,Basic,Suite,Advanced|};", "\t${0}", "}" ], "description": "Snippet: Page Part" }, - "Page of type list": { + "Page of type List": { "prefix": "tpage", "body": [ "page ${1:Id} ${2:PageName}", @@ -149,7 +222,7 @@ "\t\t\t{", "\t\t\t\tApplicationArea = ${3};", "\t\t\t\t", - "\t\t\t\ttrigger OnAction();", + "\t\t\t\ttrigger OnAction()", "\t\t\t\tbegin", "\t\t\t\t\t$0", "\t\t\t\tend;", @@ -192,5 +265,97 @@ "}" ], "description": "Snippet: Page of type API" + }, + "Page of type Role Center": { + "prefix": "tpage", + "body": [ + "page ${1:Id} ${2:RoleCenterName}", + "{", + "\tPageType = RoleCenter;", + "\t", + "\tlayout", + "\t{", + "\t\tarea(RoleCenter)", + "\t\t{", + "\t\t\t$0", + "\t\t}", + "\t}", + "\t", + "\tactions", + "\t{", + "\t\tarea(Creation)", + "\t\t{", + "\t\t\taction(${3:ActionBarAction})", + "\t\t\t{", + "\t\t\t\tRunObject = ${4|Page,Report,XmlPort,Codeunit|} ${5:ObjectName};", + "\t\t\t}", + "\t\t}", + "\t\tarea(Sections)", + "\t\t{", + "\t\t\tgroup(${6:SectionsGroupName})", + "\t\t\t{", + "\t\t\t\taction(${7:SectionsAction})", + "\t\t\t\t{", + "\t\t\t\t\tRunObject = ${8|Page,Report,XmlPort,Codeunit|} ${9:ObjectName};", + "\t\t\t\t}", + "\t\t\t}", + "\t\t}", + "\t\tarea(Embedding)", + "\t\t{", + "\t\t\taction(${10:EmbeddingAction})", + "\t\t\t{", + "\t\t\t\tRunObject = ${11|Page,Report,XmlPort,Codeunit|} ${12:ObjectName};", + "\t\t\t}", + "\t\t}", + "\t}", + "}" + ], + "description": "Snippet: Page of type Role Center" + }, + "Page of type PromptDialog": { + "prefix": "tpage", + "body": [ + "page ${1:Id} ${2:PageName}", + "{", + "\tPageType = PromptDialog;", + "\tCaption = '{3:Draft with Copilot}';", + "\tPromptMode = ${4|Prompt,Generate,Content|};", + "\tExtensible = false;", + "\tSourceTable = ${5:TableName};", + "\tSourceTableTemporary = true;", + "\t", + "\tlayout", + "\t{", + "\t\tarea(Prompt)", + "\t\t{", + "\t\t\t$6", + "\t\t}", + "\t\tarea(PromptOptions)", + "\t\t{", + "\t\t\t$7", + "\t\t}", + "\t\tarea(Content)", + "\t\t{", + "\t\t\t$8", + "\t\t}", + "\t}", + "\t", + "\tactions", + "\t{", + "\t\tarea(SystemActions)", + "\t\t{", + "\t\t\tsystemaction(${9|Generate,Attach,Cancel,Ok,Regenerate|})", + "\t\t\t{", + "\t\t\t\ttrigger OnAction()", + "\t\t\t\tbegin", + "\t\t\t\t\t$0", + "\t\t\t\tend;", + "\t\t\t}", + "\t\t}", + "\t}", + "\t", + "}" + ], + "description": "Snippet: Page of type Prompt Dialog" } } \ No newline at end of file diff --git a/snippets/permissionset.json b/snippets/permissionset.json new file mode 100644 index 0000000..7305169 --- /dev/null +++ b/snippets/permissionset.json @@ -0,0 +1,15 @@ +{ + "Snippet: PermissionSet": { + "prefix": "tpermissionset", + "body": [ + "permissionset ${1:Id} ${2:MyPermissionSet}", + "{", + "\tAssignable = ${3|true,false|};", + "\tIncludedPermissionSets = ${4:SomePermissionSet};", + "\tPermissions = ", + "\t\t${5:ObjectType} ${6:ObjectName} = ${7:ObjectPermissions};", + "}" + ], + "description": "Snippet: Permission Set" + } +} \ No newline at end of file diff --git a/snippets/permissionsetextension.json b/snippets/permissionsetextension.json new file mode 100644 index 0000000..cf8325e --- /dev/null +++ b/snippets/permissionsetextension.json @@ -0,0 +1,14 @@ +{ + "Snippet: PermissionSetExtension": { + "prefix": "tpermissionsetextension", + "body": [ + "permissionsetextension ${1:Id} ${2:MyPermissionSetExt} extends ${3:MyTargetPermissionSet}", + "{", + "\tIncludedPermissionSets = ${4:SomePermissionSet};", + "\tPermissions = ", + "\t\t${5:ObjectType} ${6:ObjectName} = ${7:ObjectPermissions};", + "}" + ], + "description": "Snippet: Permission set extension" + } +} \ No newline at end of file diff --git a/snippets/profile.json b/snippets/profile.json index de9406b..4a78a57 100644 --- a/snippets/profile.json +++ b/snippets/profile.json @@ -4,11 +4,24 @@ "body": [ "profile ${1:MyProfile} ", "{", - "\tDescription = ${2:'Profile Display Name'};", + "\tDescription = '${2:Profile Display Name}';", "\tRoleCenter = ${3:RoleCenter};", "\tCustomizations = ${0:Customizations};", "}" ], "description": "Snippet: Profile" + }, + "Snippet: Profile (4.0)": { + "prefix": "tprofile", + "body": [ + "profile ${1:MyProfile} ", + "{", + "\tCaption = '${2:Profile Display Name}';", + "\tRoleCenter = ${3:RoleCenter};", + "\tProfileDescription = '${4:Profile Description}';", + "\tCustomizations = ${0:Customizations};", + "}" + ], + "description": "Snippet: Profile" } } \ No newline at end of file diff --git a/snippets/report.json b/snippets/report.json index 31bd8d7..f6160cf 100644 --- a/snippets/report.json +++ b/snippets/report.json @@ -4,8 +4,9 @@ "body": [ "report ${1:Id} ${2:MyReport}", "{", - "\tUsageCategory = ${3|Administration,Documents,History,Lists,None,ReportsAndAnalysis,Tasks|};", + "\tUsageCategory = ${3|ReportsAndAnalysis,Administration,Documents,History,Lists,None,Tasks|};", "\tApplicationArea = ${4|All,Basic,Suite,Advanced|};", + "\tDefaultRenderingLayout = ${17:LayoutName};", "\t", "\tdataset", "\t{", @@ -20,16 +21,18 @@ "\t", "\trequestpage", "\t{", + "\t\tAboutTitle = '${10:Teaching tip title}';", + "\t\tAboutText = '${11:Teaching tip content}';", "\t\tlayout", "\t\t{", "\t\t\tarea(Content)", "\t\t\t{", - "\t\t\t\tgroup(${10:GroupName})", + "\t\t\t\tgroup(${12:GroupName})", "\t\t\t\t{", - "\t\t\t\t\tfield(${12:Name}; ${11:SourceExpression})", + "\t\t\t\t\tfield(${14:Name}; ${13:SourceExpression})", "\t\t\t\t\t{", "\t\t\t\t\t\tApplicationArea = ${4};", - "\t\t\t\t\t\t${13}", + "\t\t\t\t\t\t${15}", "\t\t\t\t\t}", "\t\t\t\t}", "\t\t\t}", @@ -37,19 +40,28 @@ "\t", "\t\tactions", "\t\t{", - "\t\t\tarea(${14:processing})", + "\t\t\tarea(${16:processing})", "\t\t\t{", - "\t\t\t\taction(${15:ActionName})", + "\t\t\t\taction(${17:ActionName})", "\t\t\t\t{", "\t\t\t\t\tApplicationArea = ${4};", - "\t\t\t\t\t${16}", + "\t\t\t\t\t${18}", "\t\t\t\t}", "\t\t\t}", "\t\t}", "\t}", "\t", + "\trendering", + "\t{", + "\t\tlayout(${19:LayoutName})", + "\t\t{", + "\t\t\tType = ${20:Excel};", + "\t\t\tLayoutFile = '${21:mySpreadsheet.xlsx}';", + "\t\t}", + "\t}", + "\t", "\tvar", - "\t\t${17:myInt}: ${0:Integer};", + "\t\t${22:myInt}: ${0:Integer};", "}" ], "description": "Snippet: Report" @@ -65,7 +77,7 @@ "\t}", "}" ], - "description": "Snippet: Data Item" + "description": "Snippet: Report Data Item" }, "Snippet: Column": { "prefix": "tcolumn", @@ -76,5 +88,16 @@ "}" ], "description": "Snippet: Column" + }, + "Snippet: Report Layout": { + "prefix": "treportlayout", + "body": [ + "layout(${0:LayoutName})", + "{", + "\tType = ${1:Excel};", + "\tLayoutFile = '${2:mySpreadsheet.xlsx}';", + "}" + ], + "description": "Snippet: Report Layout" } } \ No newline at end of file diff --git a/snippets/reportextension.json b/snippets/reportextension.json new file mode 100644 index 0000000..8c0f373 --- /dev/null +++ b/snippets/reportextension.json @@ -0,0 +1,29 @@ +{ + "Snippet: Report Extension": { + "prefix": "treportext", + "body": [ + "reportextension ${1:Id} ${2:MyExtension} extends ${3:MyTargetReport}", + "{", + "\tdataset", + "\t{", + "\t\t${4:// Add changes to dataitems and columns here}", + "\t}", + "\t", + "\trequestpage", + "\t{", + "\t\t${5:// Add changes to the requestpage here}", + "\t}", + "\t", + "\trendering", + "\t{", + "\t\tlayout(${6:LayoutName})", + "\t\t{", + "\t\t\tType = ${7:RDLC};", + "\t\t\tLayoutFile = '${8:mylayout.rdl}';", + "\t\t}", + "\t}", + "}" + ], + "description": "Snippet: Report Extension" + } +} \ No newline at end of file diff --git a/snippets/table.json b/snippets/table.json index 8c81edb..48f628d 100644 --- a/snippets/table.json +++ b/snippets/table.json @@ -17,28 +17,33 @@ "\t", "\tkeys", "\t{", - "\t\tkey(${8:PK}; ${4:MyField})", + "\t\tkey(${8:Key1}; ${4:MyField})", "\t\t{", "\t\t\tClustered = ${9|true,false|};", "\t\t}", "\t}", "\t", + "\tfieldgroups", + "\t{", + "\t\t${10:// Add changes to field groups here}", + "\t}", + "\t", "\tvar", - "\t\t${10:myInt}: ${11:Integer};", + "\t\t${11:myInt}: ${12:Integer};", "\t", "\ttrigger OnInsert()", "\tbegin", - "\t\t$12", + "\t\t$13", "\tend;", "\t", "\ttrigger OnModify()", "\tbegin", - "\t\t$13", + "\t\t$14", "\tend;", "\t", "\ttrigger OnDelete()", "\tbegin", - "\t\t$14", + "\t\t$15", "\tend;", "\t", "\ttrigger OnRename()", @@ -56,7 +61,6 @@ "field(${1:id}; ${2:MyField}; ${3|Blob,BigInteger,Boolean,Code[50],Date,DateFormula,Decimal,Duration,Integer,Guid,Media,MediaSet,Option,RecordID,TableFilter,Text[50],Time|})", "{", "\tDataClassification = ${4|ToBeClassified,CustomerContent,EndUserIdentifiableInformation,AccountData,EndUserPseudonymousIdentifiers,OrganizationIdentifiableInformation,SystemMetadata|};", - "\t${5:FieldPropertyName} = ${0:FieldPropertyValue};", "}" ], "description": "Snippet: Table Field" @@ -103,5 +107,12 @@ "}" ], "description": "Snippet: Table Key" + }, + "Snippet: Table Field Group": { + "prefix": "tfieldgroup", + "body": [ + "fieldgroup(${1|DropDown,Brick|}; ${0:MyField}){}" + ], + "description": "Snippet: Table Field Group" } } \ No newline at end of file diff --git a/snippets/tableextension.json b/snippets/tableextension.json index 8aad35c..829e016 100644 --- a/snippets/tableextension.json +++ b/snippets/tableextension.json @@ -9,10 +9,27 @@ "\t\t${4:// Add changes to table fields here}", "\t}", "\t", + "\tkeys", + "\t{", + "\t\t${5:// Add changes to keys here}", + "\t}", + "\t", + "\tfieldgroups", + "\t{", + "\t\t${6:// Add changes to field groups here}", + "\t}", + "\t", "\tvar", - "\t\t${5:myInt}: ${0:Integer};", + "\t\t${7:myInt}: ${0:Integer};", "}" ], "description": "Snippet: Table Extension" + }, + "Snippet: Table Extesion FieldGroup AddLast": { + "prefix": "tfieldgroupaddlast", + "body": [ + "addlast(${1|DropDown,Brick|}; ${0:MyField}){}" + ], + "description": "Snippet: Table Extesion FieldGroup AddLast" } } \ No newline at end of file diff --git a/snippets/tenantwebservice.xml.json b/snippets/tenantwebservice.xml.json deleted file mode 100644 index 1db8e0c..0000000 --- a/snippets/tenantwebservice.xml.json +++ /dev/null @@ -1,19 +0,0 @@ -{ -"Snippet: Tenant Web Service XML": { - "prefix": "twebservice", - "body": [ - "", - "", - "\t", - "\t\t", - "\t\t\t${1|CodeUnit,Page,Query|}", - "\t\t\t${2:ServiceName}", - "\t\t\t${3:ObjectID}", - "\t\t\t${4|true,false|}", - "\t\t", - "\t", - "" - ], - "description": "Tenant Web Service" - } -} \ No newline at end of file