problem wifth script #1430
-
I attempting to modify the attribute changed function of tasks to include another label call Reference_Number. Currently I am not having any luck copying what is set for the label Location and duplicating it for the new Label. What I am I missing in my code. `if (!["task", "location", "tag", "todoDate", "doneDate","Reference_Number"].includes(api.originEntity.name)) { const tagRootNote = api.getNoteWithLabel('taskTagRoot'); if (!tagRootNote || !doneRootNote || !todoRootNote) { const note = api.originEntity.getNote(); const attributes = note.getAttributes(); const todoDate = note.getLabelValue('todoDate'); api.toggleNoteInParent(isTaskDone, note.noteId, doneRootNote.noteId); const location = note.getLabelValue('location'); reconcileAssignments(note, locationRootNote, location ? [location] : [], 'taskLocationNote', isTaskDone); const Reference_Number = note.getLabelValue('Reference_Number'); reconcileAssignments(note, Reference_NumberRootNote, Reference_Number ? [Reference_Number] : [], 'taskReference_NumberNote', isTaskDone); const tags = attributes.filter(attr => attr.type === 'label' && attr.name === 'tag').map(attr => attr.value); reconcileAssignments(note, tagRootNote, tags, 'taskTagNote', isTaskDone); note.toggleLabel(isTaskDone, "cssClass", "done"); const doneTargetNoteId = isTaskDone ? api.getDateNote(doneDate).noteId : null; note.toggleLabel(!isTaskDone, "cssClass", "todo"); const todoTargetNoteId = (!isTaskDone && todoDate) ? api.getDateNote(todoDate).noteId : null; Thanks for any help. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Nevermind I figured out what I Forgot to do. I forgot to relate the task to a note to start the tree. |
Beta Was this translation helpful? Give feedback.
Nevermind I figured out what I Forgot to do. I forgot to relate the task to a note to start the tree.