Skip to content

Instantly share code, notes, and snippets.

View martonsagi's full-sized avatar

Márton Sági martonsagi

View GitHub Profile
@martonsagi
martonsagi / AL Language Analyzer Rules.md
Created March 25, 2021 15:00
AL Language Analyzer Rules
ID Title Severity Details
AL0100 Invalid Multiline Comment Error Unterminated multiline comment
AL0101 Invalid Decimal Literal Error Constant value '{0}' is outside the range for a Decimal
AL0102 Invalid Int64 Literal Error Constant value '{0}' is outside the range for a BigInteger
AL0103 Invalid Int32 Literal Error Constant value '{0}' is outside the range for an Integer
AL0104 Syntax Error Error Syntax error, '{0}' expected
AL0105 Identifier Expected K W Error Syntax error, identifier expected; '{1}' is a keyword
AL0106 For Statement To Or Down To Expected Error Syntax error, 'TO' or 'DOWNTO' expected
AL0107 Identifier Expected Error Syntax error, identifier expected
...
/// <summary>
/// Example: JsonStuff1('{ "MyKey": { "ElementValue": "Result" } }', 'MyKey.ElementValue', 'ElementValue');
/// </summary>
/// <param name="SourceObject">JSON as Text</param>
/// <param name="Path">JPath selector</param>
/// <param name="PropertyName">Requested Property name</param>
/// <returns></returns>
local procedure JsonStuff1(SourceObject: Text; Path: Text; PropertyName: Text): Text;
@martonsagi
martonsagi / RecordHelper.al
Created October 24, 2019 11:55
AL RecordHelper
codeunit xx RecordHelper_DSK
{
procedure Open(TableId: Integer)
begin
Open(TableId, false, CompanyName());
end;
procedure Open(Name: Text): Boolean
begin
exit(Open(Name, false, CompanyName()));
@martonsagi
martonsagi / app.html
Last active January 13, 2017 16:04 — forked from jdanyow/app.html
Aurelia Compose view-model.ref
<template>
<require from="./custom-component"></require>
<require from="./body-component"></require>
<require from="./footer-component"></require>
<h1>${message}</h1>
<body-component>
<compose view-model="./custom-component" view-model.ref="customVM"></compose>
@martonsagi
martonsagi / app.html
Last active September 29, 2017 21:18
Aurelia - Load array of Enum values
<template>
<require from="./enum-list"></require>
<require from="./keys-value-converter"></require>
<h2>Single Dropdown - Dynamic</h2>
<label>Type</label>
<select class="form-control" value.bind="selectedType">
<option repeat.for="mainKey of data | keys" value="${mainKey}">${mainKey}</option>
@martonsagi
martonsagi / app.html
Created November 5, 2016 23:34
Aurelia - conditional checkbox binding
<template>
<ul>
<li repeat.for="item of items">
<label><input type="checkbox" checked.bind="item.status === 'EnumValue'" /> Checkbox</label>
</li>
</ul>
</template>
@martonsagi
martonsagi / api.js
Last active October 30, 2018 09:15
Aurelia - Dynamic components with InlineView
export class Api {
loadTemplate(url) {
return new Promise((resolve, reject) => {
this.callRestApi(url)
.then(result => {
resolve({content: result, error: false});
})
.catch(e => {
console.log(`Could not load template`, e);
@martonsagi
martonsagi / app.html
Last active November 3, 2016 07:19
Aurelia Replaceable parts
<template>
<require from="./my-component"></require>
<h4>Default template</h4>
<my-component></my-component>
<hr>
<h4>Custom template</h4>
@martonsagi
martonsagi / app.html
Last active November 1, 2016 10:08
Aurelia NavBar Authentication Example
<template>
<require from="./nav-bar"></require>
<require from="./nav-bar-compose.html"></require>
<require from="./nav-bar-function.html"></require>
<nav-bar-function if.bind="mode === 'function'"
router.bind="router"
logged-in.bind="loggedIn"
toggle-login.call="toggleLogin()">
@martonsagi
martonsagi / app.html
Created October 27, 2016 12:09 — forked from geleto/app.html
Aurelia - change to a bound repeat input element is applied to the VM a second time after the element has been deleted.
<template>
<div repeat.for="msg of messages">
<input type="text" value.bind="msg" input.delegate="onMessageChanged(msg, $index)">
</div>
</template>