to call record.executemacro does the record have t...
# ask-stanley-ai
b
to call record.executemacro does the record have to be in dynamic mode
c
AI generated answer (using internal Slack threads):
Yes, to call
record.executeMacro
, the record has to be in dynamic mode. This is because the
executeMacro
method is only available on records that are in dynamic mode. In a User Event script, the record provided in the context is not in dynamic mode, hence the error message 'Cannot find function executeMacro in object standard record'. Here is an example of how to use
executeMacro
in dynamic mode:
Copy code
javascript
var record = context.newRecord;
record.selectLine({ sublistId: 'item', line: 0 });
record.setCurrentSublistValue({ sublistId: 'item', fieldId: 'taxcode', value: taxCodeId });
record.commitLine({ sublistId: 'item' });
record.executeMacro({ id: 'calculateTax' });
****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.810482383
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.809729397
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.799690187
Please provide your feedback on this answer.