Create your own Flow

You can use Package Components to create Flows tailored to your Workflows and Setup. The following includes examples, Apex Actions, and Apex Classes that can be utilized to design these Flows.

Some example Flows

These are a few example flows that you can refer to while creating your own custom flows.

Syncing Customers to Zenskar

  1. Get records from the Account object.
  1. Map account details to the ZenskarCustomer object.

📘

Note: There are custom fields available in package, you show them on layout and use that in flows. Check Layout Section in Account Object in SF after package install

  1. Add fields of Transformed Data to Zenskar Sync Customer Apex Action.
  1. Update Zenskar Customer ID to Related Object so Updates can be synced.

Note: You can use provided custom field for storing Zenskar Customer ID

Syncing Contracts

  1. Retrieve all Opportunity Line Items for the triggering Opportunity.
  1. Get Related Account for Triggering Opportunity.
  1. Loop over Opportunity Line Item and Get PriceBookEntry for each Opportunity Line Item. Add Pricebookentry’s Link ID(Zenskar) to a Collection of String (ReferenceIDs List).
  1. Convert the Salesforce Opportunity to a ZenskarContract object.
  1. Add Zenskar Sync Contract Apex Action and Use Data from Transformer(Convert SF to Zenskar Contract).
  1. Update the Opportunity with the ZenskarContractId.
  1. Sync with Zenskar
  • Close the Opportunity as ‘Won’ to automatically create and sync data to Zenskar.

For managing Pricebooks and Products, see Manage Price Books.

Package components

Apex Actions

These actions are provided in our Salesforce package to sync data from Salesforce to Zenskar.

Zenskar Customer sync

Creates or updates a customer on Zenskar. This action is required to create a contract.

Inputs

FieldDescription
CustomerExternalIDID of the customer in your system
CustomerNameName of the customer (required)
CustomerEmailEmail of the customer
BillingAddressCustomer's billing address
ShippingAddressCustomer's shipping address
CustomerPhoneNumberCustomer's phone number
IsAutoChargeEnabledEnable auto-charge on Zenskar
IsCommunicationEnabledEnable communication on Zenskar
TagsCustomer tags
ZenskarCustomerIdExisting Zenskar Customer ID (for updates)

Output

FieldDescription
ZenskarCustomerIdID of the customer on Zenskar

Zenskar Contract Sync

Creates or updates a contract on Zenskar.

Inputs

FieldDescription
ContractNameContract name (required)
CustomerIdCustomer ID (required)
ContractIdCan be null for a new contract
ContractStartDateStart date (required)
ContractEndDateCan be null for a perpetual contract
TagsOptional Zenskar tags
RenewalPolicyDefaults to "Do not Renew"
pricingListList of pricing IDs
ReferenceIdListAlternative to pricingList
StatusDefaults to "Active"

Output

FieldDescription
ZenskarContractIdID of the contract on Zenskar

Zenskar Get Contract

Fetches a contract from Zenskar.

Input

FieldDescription
ContractIDValid Zenskar Contract ID

Output

FieldDescription
ZenskarContractZenskar contract object

Zenskar Get Customer

Fetches a customer from Zenskar.

Input

FieldDescription
CustomerIDValid Zenskar Customer ID

Output

FieldDescription
ZenskarCustomerZenskar customer object

Zenskar Create Product

Creates or updates a product on Zenskar.

Inputs

FieldDescription
ZenskarProductIdProduct ID for updates
NameProduct name
SKUProduct SKU
DescriptionProduct description
IsActiveSet product status to active

Output

FieldDescription
ZenskarProductIdID of the created/updated product

Zenskar Get Pricing

Fetches pricing from Zenskar.

Input

FieldDescription
ReferenceIDPricing reference ID
PricingIdPricing ID
ProductIdProduct ID

Output

FieldDescription
ZenskarPricingZenskar pricing object
ProductIDID of the associated product
PricePrice amount for per-unit or flat fee pricing

Zenskar Create Pricing

Creates per-unit pricing on Zenskar.

Inputs

FieldDescription
PricingObjectContains pricing details
PerUnitPricingDetailsContains per-unit amount details
ZenskarProductIdProduct ID for the pricing

Output

FieldDescription
Same as inputEnriched data with additional information

Apex classes

You can use Apex classes to store data.

ZenskarAddress

public class ZenskarAddress {
    public String line1;
    public String line2;
    public String line3;
    public String city;
    public String state;
    public String zipcode;
    public String country;
}

ZenskarBillingPeriod

public class ZenskarBillingPeriod {
    public String every;  // 1, 2, 3, etc.
    public String cadence;  // Day, Week, Month, Year
    public String offset;  // prepaid/postpaid
}

ZenskarContract

public class ZenskarContract {
    public String contractName;
    public String customerId;
    public DateTime startDate;
    public DateTime endDate;
    public List<String> link;
    public List<ZenskarPricingAndProductId> pricingandProductId;
    public List<ZenskarTags> tags;
    public String status;  // draft, active, expired
    public String renewalPolicy;
}

ZenskarCustomer

public class ZenskarCustomer {
    public String externalID;
    public String customerName;
    public String customerEmail;
    public ZenskarAddress customerBillingAddress;
    public ZenskarAddress customerShippingAddress;
    public String customerPhoneNumber;
    public Boolean customerAutoChargeEnabled;
    public Boolean customerCommunicationEnabled;
    public List<String> tags;
}

ZenskarDiscountFeature

public class ZenskarDiscountFeature {
    public String unit;  // percentage of discount
}

ZenskarPerUnitPricing

public class ZenskarPerUnitPricing {
  public Decimal unitAmount;
}

ZenskarPricing

public class ZenskarPricing {
    public String zenskarPricingId;
    public String Name;
    public String Description;
    public Boolean isRecurring;
    public String linkID;
    public ZenskarBillingPeriod billingPeriod;
    public ZenskarQuantity quantity;
    public String pricingType;  // per_unit, flat_fee
    public List<ZenskarDiscountFeature> discounts;
    public String oppLineItemId;
}

ZenskarPricingAndProductId

public class ZenskarPricingAndProductId {
    public String productID;
    public String pricingID;
    public String oppLineItemId;
}

ZenskarProduct

public class ZenskarProduct {
    public String zenskarProductId;
    public String name;
    public String sku;
    public String description;
}

ZenskarQuantity

public class ZenskarQuantity {
    public Decimal quantity;
    public String unit;
}

ZenskarTags

public class ZenskarTags {
    public String label;
    public String value;
}

 

For more on Apex classes, see Apex Developer Guide.


Custom Fields Summary

Account

  • AutoCharge Invoice (Zenskar)
  • CustomerID (Zenskar)
  • External ID (Zenskar)

Opportunity

  • Contract End Date (Zenskar)
  • Contract Renew Policy (Zenskar)

Product

  • ProductID (Zenskar)

PriceBookEntry

  • LinkID (Zenskar)

For details on creating custom fields, refer to Salesforce Custom Fields.