2

The question is basically as in the title: Is it possible to create a new WorkflowRule using Metadata API?

I'm using Java, and I want to create a workflow rule for a custom object. I've tried: * Creating a new WorkflowRule object, but couldn't find anything which could attach it to a "parent" * The same with Workflow objects. * CustomObject also doesn't have anything like "setWorkflowRules()"

What am I missing here?

1 Answer 1

2

Workflows are supported by the Metadata API. The Documentation is provided here: https://www.salesforce.com/us/developer/docs/api_meta/

Each Object you have on an Org should have already a matching Workflow:

Workflow files have the suffix .workflow. There is one file per standard or custom object that has workflow. These files are stored in the workflows directory of the corresponding package.

It seems that you have to match fullName to e. g. YourObjectName__c.workflow or Account.workflow

So you need to query the existing Workflow for your object and add the rules, fieldUpdates and tasks there.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .