Quantcast
Channel: DEVONtechnologies Community - Latest posts
Viewing all articles
Browse latest Browse all 16217

Smart Rule is not processed on importing

$
0
0

I have managed to run the rule On Import by moving the evaluation of the custom metadata Status from the rule into the JavaScript:

function performsmartrule(records) {
  const app = Application("DEVONthink 3");
  app.includeStandardAdditions = true;

  /* Loop over the records selected by the smart rule */
  records.forEach(r => {
    if (app.getCustomMetaData({ for: "status1", from: r }) == "ready to be renamed") {
      app.logMessage("rename document");
      renameDocument(r)
      app.addCustomMetaData("renamed", { for: "status1", from: r })
    }
  })
}

Thank you for your help.


Viewing all articles
Browse latest Browse all 16217

Trending Articles