...
Code Block |
---|
|
var table = $Database.Get({
Parameters : {
TargetSchema : 'HR',
TargetTable : 'Groups'
}
});
var list = table.ToDictionary('Name');
var myGroup = list.Ensure("MyGroup", {
Name : 'MyGroup',
Code : '123'
}, {
Id : Script.NewId()
});
list.Save(); |
initProperties argument used as to initialize a new row no matching row found inDataTableThis method inserts or updates rows inDataTable
Example
Code Block |
---|
|
var table = $Database.Get({
Parameters : {
TargetSchema : 'HR',
TargetTable : 'Groups'
}
});
var list = table.ToDictionary('Name');
var myGroup = list.Ensure("MyGroup", {
Name : 'MyGroup',
Code : '123'
}, {
Id : Script.NewId()
});
list.Save(); |
Examples
Code Block |
---|
|
var table = $Database.Get({
Parameters : {
TargetSchema : 'HR',
TargetTable : 'Groups'
}
});
var list = table.ToDictionary('Name');
var myGroup = list.Ensure("MyGroup", {
Name : 'MyGroup',
Code : '123'
}, {
Id : Script.NewId()
});
list.Save(); |