Knowledge Center

Knowledge Center > Commerce > Zuora for Salesforce Development Resources > Order Builder > Order Builder Reference > zUtil Class

zUtil Class

Table of contents

The zUtil class is a collection of common utility methods in Order Builder.

zUtil Class Methods

The zUtil class includes the following global methods.

Method Signature Description
zUtil () Constructs an instance of zUtil class.
static Decimal getDeltaMonths
(Date newStartDate, Date oldStartDate,
Date endDate)
Returns the number of months between getMonths(newStartDate, endDate) and getMonths(oldStartDate, endDate).
static Decimal getMonths 
(Date startDate, Date endDate)
Returns the number of months between the startDate and the endDate.
static String getZuoraDate 
(Date pDate)

Returns the value of pDate as a string in the format, "yyyy-MM-ddTHH:mm:ssZ" where "Z" is the offset of the user's time zone.

For example, if the Salesforce user has a time zone offset of +8, zUtil.getZuoraDate(Date.newInstance(2015, 1, 1)) will return "2015-01-01T00:00:00+08.00".

static String getZuoraDate 
(Datetime pDateTime)
Returns the value of pDateTime as a string in the format, "yyyy-MM-ddTHH:mm:ssZ" where "Z" is the offset of the user's time zone.
static String getZuoraDateOnly
​(Date pDate)
Returns the value of pDate as a string in the format, "yyyy-MM-dd".

static String getZuoraDateOnly

(Datetime pDateTime)

Returns the value of pDateTime as a a string in the format, "yyyy-MM-dd".
static String hidePassword 
(String soapString)

Masks a plain-text password.

Any sub-string that matches "<password>.{0,}</password>" is replaced with "<password>******</password>".

static Boolean isMultiCurrency 
()
Returns true if the organization is a multi-currency organization.
static Boolean isNumber 
(String value)
Returns true if the value is an integer or a float.
Last modified
14:12, 2 Jun 2016

Tags

Classifications

(not set)