I was wondering if it is possible to use a text or a key word from email subject or body to trigger a workflow that updates the date field.

Can this be done only through apex? If so, is it related to the emailhandler?

I couldn't find any guides related to this.

Please help!


So, the answer is basically YES, but indirectly

  • InboundEmailHandler parses the subject or body, looking for some keyword
  • If keyword is found, update some field on an Sobject that..
  • Makes a workflow/process builder triggering criteria true and hence workflow executes

Workflows and Process Flows require a DML operation to be launched

However, Apex can call headless (auto-launched) Visual Flows. Andy Fawcett has a good description here on his blog and there is also the Apex doc on Flow.Interview class (which says the same thing, although in the context of a Visualforce controller).

And, Visual Flows can update the database using params passed to the flow.

Having said all that, given you have to write apex for an inboundEmailHandler, you might consider just doing the update anyway in Apex (with the added benefit of being forced to create a solid regression test)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.