-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
33 lines (29 loc) · 999 Bytes
/
script.js
File metadata and controls
33 lines (29 loc) · 999 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Create a note
function process_function_NoteCreate(task, value, callback = null){
var targetTable = task.targetTable;
var targetId = task.targetId;
// Check if the task has a target
if(typeof task.target !== 'undefined'){
if(typeof task.target.targetTable !== 'undefined'){
targetTable = task.target.targetTable;
}
if(typeof task.target.targetId !== 'undefined'){
targetId = task.target.targetId;
}
}
// Open the Create Note Modal
builder.Widget('notes',{render: false,targetTable: targetTable,targetId: targetId}).create(function(response){
// Execute Callback
if(typeof callback === "function"){
callback(task, response);
}
});
};
function process_meta_NoteCreate(key = null){
const metadata = {
label: "Create a Note",
description: "Create a Note from a Task",
type: "none",
};
return metadata[key] ? metadata[key] : metadata;
}