I am stuck with this simple thing, My suitelet has...
# suitescript
t
I am stuck with this simple thing, My suitelet has multiple custom sublists, I added mark/ unmark all buttons , I was trying to pass a sublistId as parameter so I can apply the mark to specific sublist. If I hardcode the sublist id in CS it works, while this dynamic thing results undefined when I log sublistId in the console. The function passes value when you put that on a user event bL, I am thinking it’s just weird for sublists only. Not sure,
Copy code
sublist.addButton({
      id: 'markall',
      label: 'Mark All',
      functionName: `markAllTasks(${sublistId})`
    });
    sublist.addButton({
      id: 'unmarkall',
      label: 'Unmark All',
      functionName: 'unmarkAllTasks(' + sublistId + ')'
    });
a
you need the quotes in the function when its finished doing the string conversion... `functionName: `markAllTasks("${sublistId}")``
functionName: 'unmarkAllTasks("' + sublistId + '");
this 1
t
Thank you, Anthony, I missed and did wrong escaping.
👍 1