salesforce2apex
Salesforce Apex Code Generator from Salesforce Workflow
Last updated 10 months ago by tzmfreedom .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install salesforce2apex 
SYNC missed versions from official npm registry.

Salesforce2Apex

Salesforce Apex Code Generator from Workflow Rules

Usage

$ npm install -g salesforce2apex
$ salesforce2apex -o object-name -f /path/to/workflow-metadata.workflow > hoge.trigger
// salesforce2apex -o Foo__c -f /path/to/Foo__c.workflow

input file

<?xml version="1.0" encoding="UTF-8"?>
<Workflow xmlns="http://soap.sforce.com/2006/04/metadata">
  <fieldUpdates>
    <fullName>barbarbar</fullName>
    <field>Bar__c</field>
    <formula>&quot;BBB&quot;</formula>
    <name>barbarbar</name>
    <notifyAssignee>false</notifyAssignee>
    <operation>Formula</operation>
    <protected>false</protected>
    <reevaluateOnChange>true</reevaluateOnChange>
  </fieldUpdates>
  <rules>
    <fullName>TestWorkflow</fullName>
    <actions>
      <name>test</name>
      <type>FieldUpdate</type>
    </actions>
    <active>true</active>
    <criteriaItems>
      <field>Foo__c.Bar__c</field>
      <operation>equals</operation>
      <value>AAA</value>
    </criteriaItems>
    <triggerType>onAllChanges</triggerType>
  </rules>
</Workflow>

output

trigger FooTrigger on Foo__c (before update) {
  if (Trigger.isBefore && Trigger.isUpdate) {
    for (Foo__c record : Trigger.New) {
      if (record.Bar__c == 'AAA') {
          record.Bar__c = 'BBB';
      }
    }
  }
}

Current Tags

  • 0.1.5                                ...           latest (10 months ago)

6 Versions

  • 0.1.5                                ...           10 months ago
  • 0.1.4                                ...           10 months ago
  • 0.1.3                                ...           10 months ago
  • 0.1.2                                ...           10 months ago
  • 0.1.1                                ...           10 months ago
  • 0.1.0                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 6
Last Day 0
Last Week 0
Last Month 0
Dependencies (7)
Dev Dependencies (6)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |