Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejs
var daysGained = $Database.Get({
    Parameters : {
        TargetSchema : 'HR',
        TargetTable : 'LeaveAllowance'
    },
    Columns : [{
        Name : 'DaysGained',
        Expression : "Sum(DaysGained)"
    }],
    Start : 0,
    MaxLength : 1,
    Where : {
        Criteria : [{
            Name : 'Employee',
            Value : $Initiator.Id
        }]
    }
});

$Xml.SetValue('GeneralInfo/EarnedDays', daysGained.Rows()[0]["DaysGained"]);

// OR

totalLeaves.Each(function () {
    $Xml.SetValue('GeneralInfo/EarnedDays', this.DaysGained);
});
Info

In the example below, offers by suppliers are grouped by the day they made with their count.

Example

Query with Expression - Advanced

...