\

Functions

wf_date()

wf_date(mixed $value, mixed $interval, string $format) : string

Format and modify a given date

Examples:

$germanDateNextDay = wf_date($dateField, '+1 day', 'd.m.Y')

Parameters

mixed $value

The date you want to modify (YYYY-MM-DD [HH:II:SS]) Time is optional

mixed $interval

Empty or every Date/Time Interval: Syntax see here: http://php.net/manual/en/datetime.formats.relative.php

string $format

Format you want to return (Placeholder: http://de1.php.net/manual/en/function.date.php)

Returns

string —

The formated and modified date

wf_dbquery()

wf_dbquery(mixed $query) : array

Execute a MySQL Query and return the result of the query

Examples:

$queryData = wf_dbquery("SELECT * FROM vtiger_crmentity LIMIT 1");

Parameters

mixed $query

THe MySQL you want to execute

Returns

array

wf_formatcurrency()

wf_formatcurrency(mixed $value)

format a given value as currency for the current user

Example:

return wf_formatcurrency(12000.5);

// Related to the User Settings "12.000,50", '12000.50'

Parameters

mixed $value

The number you want to format

wf_get_entity()

wf_get_entity(mixed $entity_id, bool $module_name) : array

load an array of all fields from a record.

Examples:

$recordData = wf_get_entity($crmid);

$recordData = wf_get_entity($account_id->Accounts->id);

Parameters

mixed $entity_id

CRMID of the Record you want to load

bool $module_name

If you know, the module name (default=Will be loaded from database)

Returns

array —

with all values of the record

wf_log()

wf_log(mixed $value)

Log a string to the statistic log to view later

Parameters

mixed $value

The Object you want to log

wf_recordurl()

wf_recordurl(mixed $crmid) : string

return the URL to a record in your vtigerCRM system

Parameters

mixed $crmid

The CRMID of the record

Returns

string —

The URL

wf_salutation()

wf_salutation(mixed $value, bool $language) : mixed

Translate the salutation field into your language

Parameters

mixed $value

The selected value in the Record

bool $language

The language you want to return

Returns

mixed —

The translated language

wf_save_record()

wf_save_record()

After you modify a record with wf_setfield, you need to save the record manually

wf_setfield()

wf_setfield(mixed $field, mixed $value)

Set a value in the current record

Parameters

mixed $field

The field you want to set

mixed $value

The value you want to set