The template selector pop-up will show all the active templates which have the same Type as themodule of the record. Clicking the template name will generate a PDF document with date populatedfrom the record and its related records. The Generate Letter functionality can also be actioned from theList View. This allows you to select multiple records and click the 'Generate Letter' button withinthe List View action menu.The process for generating PDFs for Quotes, Invoices and Contracts is described in your respectivesections.Quotes ModuleCreating a QuoteYou can create a Quote by going to the Quotes module and clicking 'Create Quote' from within theactions bar. The first panel allows you to specify details concerning the quote such as the Title, relatedOpportunity, Stage and Payment Terms. The Quote Number field is calculated automatically.USER MANUAL 150
The second panel allows you to specify who the Quote is for by relating an Account and Contact to theQuote. When you select the Account, the Billing Address and Shipping Address are dynamically pulledfrom the Account and populated into the fields on the Quote record.Line Items with GroupsThe third panel allows users to specify the Quote Groups, Line Items and the Currency. A Group is acollection of Line Items with its own Group Total. A Line Item can be a Product Line or a ServiceLine. To add a Quote Group, click Add Group.USER MANUAL 151
Add Group will be displayed if “Enable Line Item groups” is selected in Admin.This will display the Group, allowing you to insert a Group Name and add a Product Line or ServiceLine. It will also display the Group Totals.To add a Product Line, click Add Product Line. This will allow users to quote for Products from theProducts module.To select a Product, you can start typing in the Product or Part Number field which will provide a listof results similar to any relate field. Alternatively click the arrow button next to the Part Number field.This will display a pop-up window allowing you to select from a list of Products.USER MANUAL 152
Once you have selected a Product, the List, Sale Price and Total will populate automatically. You canchange the Quality, add Discounts (Percentage or Amount) and increase the Tax percentage. Thesewill alter the Sale Price, Total Price and Group Total fields. To add a Service Line, click Add ServiceLine. This will allow users to quote for Services.For Service Lines, you must specify the List price. This will populate the Sale Price. Tax and Discountscan be added similarly to the Product Line. AOS will keep a Grand Total for each Group.AOS will also keep a Grand Total for all Groups combined. 153 USER MANUAL
The Shipping field allows you to add a shipping cost. The Shipping Tax field allows you to add tax tothis value. Once the Quote has been compiled, click Save to save the Quote.Line Items without GroupsCreating Quotes without Groups is very similar to creating Quotes with Groups. The only differenceis you do not have to click 'Add Group'. You simply 'Add Product Line' and 'Add Service Line' to thequote. Without Groups you are cannot see the Group Total fields. You will only see the Grand Totalfields.Sending QuotationsTo output a Quote you can select one of following three buttons from the Quote Detail View.USER MANUAL 154
AOS provides users with three methods of sending Quotes: • Print as PDF – Allows you to select a template and download or save a PDF of the Quote. • Email PDF – Allows you to select a template then directs you to the ZGI CRM email client 'Compose' screen. The Quote PDF will be attached to email and the email will be addressed to the related Contact of the Quote. This allows you to fill out the email body. • Email Quotation – This directs you to the ZGI CRM email client 'Compose' screen. The email will be addressed to the related Contact of the Quote. There will be no attachment and the Quote will be displayed within the body of the email.Convert To InvoiceWith AOS you can convert Quotes to Invoices. This can be achieved by clicking the 'Convert toInvoice' button on the Quote Detail View.USER MANUAL 155
This functionality will redirect users to the Edit View of an Invoice record. Fields will be populatedbased on your Quote counterparts and Line Items will be copied over. When you are ready to createthe Invoice, click the Save button. Converting a Quote to an Invoice will set the Invoice Status of thequote to 'Invoiced'.Create ContractAs well as converting to an Invoice, AOS allows users to create a Contract based on a Quote. This canbe done by clicking the 'Create Contract' button on the Quote Detail View.USER MANUAL 156
This will redirect you to the Edit View of a Contract record, pulling through any appropriate fieldsfrom the Quote. This includes any Line Items on the Quote.Invoices ModuleCreating an InvoiceCreating an Invoice record is very similar to creating a Quote record. You can create an Invoice bygoing to the Invoices module and clicking 'Create Invoice' from within the actions bar. The first panelallows you to specify details about the Invoice such as Status and Due Date.USER MANUAL 157
The second panel allows you to specify who the Invoice is for by relating an Account and Contact tothe Invoice. When you select the Account, the Billing Address and Shipping Address are dynamicallypulled from the Account and populated into the fields on the Invoice record.Groups and Line ItemsAOS allows users to add Groups and Line Items to Invoices. This is completed in the exact same wayas Quotes. Please refer to Quotes section for details on how to create Groups and Line Items.Sending InvoicesTo output an Invoice you can select one of following three buttons from the Invoice Detail View.AOS provides users with three methods of sending Invoices: 158 USER MANUAL
• Print as PDF – Allows users to select a template and download or save a PDF of the Invoice. • Email PDF – Allows users to select a template then directs you to the ZGI CRM email client 'Compose' screen. The Invoice PDF will be attached to email and the email will be addressed to the related Contact of the Invoice. This allows user to fill out the email body. • Email Invoice – This directs you to the ZGI CRM email client 'Compose' screen. The email will be addressed to the related Contact of the Invoice. There will be no attachment and the Invoice will be displayed within the body of the email.Contracts ModuleCreating a ContractAOS allows users to create Contracts using the Contracts module.When the Contract is created the Renewal Reminder Date will populate automatically based on theamount of days specified in the AOS Settings in Admin. A Call will be scheduled and assigned to theContract Manger for this date.Groups and Line ItemsUSER MANUAL 159
AOS allows users to add Groups and Line Items for Contracts. This is completed in the exact sameway as Quotes. Please refer to Quotes section for details on how to create Groups and Line Items.USER MANUAL 160
WorkflowTable of Contents • Creating a Workflow Process • Conditions • Actions o Calculate Fields • Process Audit • Tutorials o Customers to Target List o Cases Reminder o Follow Up Web LeadsAdvanced Open Workflow (AOW) is a module for ZGI CRM, allowing users to create customworkflow processes. This module allows users to trigger various system actions based on conditionsfrom any ZGI CRM module.Creating a Workflow ProcessYou can create workflow processes by navigating to the 'Workflow' module within ZGI CRM. Clickthe 'Create Workflow' button within the action bar to start creating the process. The first panel allowsusers to set up the workflow process.USER MANUAL 161
This allows you to specify the following: • Name – The name of the process. • Assigned To - The assigned user of the workflow process. • Workflow Module – A drop down list of all the modules found within the ZGI CRM instance. This is the module the workflow is run against. For example, When an Account is created/edited. • Status – Active or Inactive. Only active processes will run. • Run – Always, On Save or On Scheduler. • Run On – All Records, Modified Records or New Records. • Repeated Runs – If checked, the process will continue to run over and over. Ideally this should only be checked if one of the specified Actions negates (or will lead to the negation) of one of the specified Conditions. • Description – A description of the process.ConditionsAdding ConditionsOnce set up, you can add conditions to a workflow process using the conditions panel. This allowsusers to specify the criteria that should trigger the workflow actions.To add a Condition Line you must click Add ConditionYou must select your Workflow Module on the first panel before adding a Condition Line. 162 USER MANUAL
You can have an unlimited amount of Condition Lines. To add another line click Add Condition againand it will appear. On the line you will have four fields; Field, Operator, Type and Value.Field and OperatorField is a drop down which automatically populates with all the fields found in the WorkFlow Module.The Field selected will determine the options available for Operator and Type. If the field type is nota number or date then the operators available will be 'Equal To' or 'Not Equal To'. For number and datefields you can also choose from additional logical operators; 'Less Than', 'Greater Than', 'Less Than orEqual To' or 'Greater Than or Equal To'.USER MANUAL 163
Condition TypesYou can specify workflow processes to trigger on different condition types. These are as follows: • Value – This is used to directly compare the Field to a value. The value type offered is dynamic to the field type of the Field selected. For example, if the field type is a drop down then the value field type will be the same drop down list. • Field – This is used to action a workflow process when one field is compared to another field in the record. • Multiple – This can be selected if the Field is a drop down/multiselect. This allows users to specify multiple values to action the workflow from. • Date – This allows you to specify the workflow to occur after/before an amount of time from either another date field or 'Now'. For example, when the start date of a call is 'Now + 10 minutes'. This can only be used when the Field is a date field. The amount of time before or after the date can be specified in Minutes, Hours, Days, Weeks or Months.USER MANUAL 164
Removing ConditionsYou can remove Condition Lines by clicking - on the left hand side of the condition.ActionsAdding ActionsActions are defined in the third panel. These specify what events should occur when the conditionshave been met. You can add an Action by clicking the Add Action button.This will cause the Action Line to appear.From the Action Line you can Select Action and give it a Name. The actions available are; 'CreateRecord', 'Modify Record' and 'Send Email'. You can specify an unlimited amount of actions for eachworkflow process.USER MANUAL 165
Create RecordIf you select 'Create Record' you will be prompted to select a Record Type. This is the module typeof the record you are looking to create.Once selected you can add fields or relationships to this record using the Add Field and AddRelationship buttons.When Adding fields the first drop down in the line will populate with all the fields from that module.The second drop down allows you to specify how the value for that field is going to be derived. Formost cases the options are as follows: • Value – This will allow you to input the value directly using the same field type as the field selected. • Field – This will make the field the same value as a field found in the WorkFlow Module. • Date – Only selectable if the field is a date field. This will allow you to specify the value as an amount of time after/before another date field or 'Now'.USER MANUAL 166
Selecting the 'Assigned-To' field also gives you more options. As well as by value and field you canassign a user by: • Round Robin – This will select each user in turn. • Least Busy – This will select you with the least amount of records assigned to you for that module. • Random – This will select a random user.For each of the above options you can choose if you want you to be selected from all users or usersfrom a specific role. If you have the Security Suite module installed you can additionally choose if youwant you to be selected from all users from a particular Security Group or all users from a particularsecurity group with a particular role.When adding relationships you must select the related module from the drop down list then select therecord that the new record should be related to.USER MANUAL 167
You must selected the related module using the arrow button – The auto completion on the text fieldis not currently developed.Modify RecordThis provides the same functionality as 'Create Record' but instead of creating a new record you aremodifying the record which met the conditions of the workflow process. With this action you canmodify any field found within the record or you can add a relationship to another record. This iscompleted in the same way as 'Create Record' except you are not required to specify the Record Type.Send EmailThe 'Send Email' action allows users to create workflow processes which will send an email based ona template to individuals. Using this action there are four different types of recipient. • Email – This will send an email to a specific email address. You must specify the email address and the email template.USER MANUAL 168
• Record Email – This will send an email to the primary email address specified on the record which actioned the workflow process. This can only be used if the record has an email field such as Accounts and Contacts. For this option you only need to specify the template.• User – This will send the email to a specified Users email address. You must specify the recipient user and the template of the email.• Related Field – This will send an email to the primary email address specified on a related modules record. In this case you must specify the related module (From a drop down list) and the email template.USER MANUAL 169
Calculate FieldsIf you select 'Calculate Fields' from the Action dropdown the Calculate Fields user interface will beloaded after a second and looks like the picture below.Calculate Fields - Adding parametersIt is possible to add parameters to the formulas by using the dropdown in the Parameters section of theCalculate Fields’s user interface. The dropdown contains all of the (basic and custom) fields whichbelongs to the module selected in the basic fields section.USER MANUAL 170
To add a parameter, select the field from the dropdown and click Add parameter. After this action, anew line appears in the parameter table with the name of the field and the given identifier.For some fields (dropdowns and multi-selects) an additional dropdown shown up where the user canselect if the raw or the formatted value should be used in Calculated Fields. The raw format means thevalue which is stored in the database and the formatted value means the label for that database value.To remove a parameter from the table, simply click the - in the row of the parameter. Be aware, that ifyou remove a parameter, all of the identifiers are recalculated, so the identifiers could change for fields!The identifier is used to reference this field when the user creates the formula. For example allappearances of the {P0} identifier will be replaced with the Account’s name in the formula. Allparameters are like {Px} where x is the sequential order of the parameter. The amount of the parametersis not limited.Calculate Fields - Adding relation parametersRelation parameters are very similar to the regular parameters, the only difference is that the user firstselects an entity which is in a one-to-one or one-to-many relationship with the actual entity.To add a relation parameter, select the relation first, and then select the field from the connected entityand push the Add relation parameter button. After this action, a new line appears in the relationparameter table with the name of the relationship, the name of the field and the given identifier.USER MANUAL 171
As for parameters for some relation parameter fields (dropdowns and multi-selects) an additionaldropdown shown up where the user can select if the raw or the formatted value should be used inCalculate Fields.To remove a relation parameter from the table, simply click on the - button in the row of the relationparameter. Be aware, that if you remove a relation parameter, all of the identifiers are recalculated, sothe identifiers could change for fields!The identifier is used to reference this field when the user creates the formula. For example allappearances of the {R0} identifier will be replaced with the creator user‘s username in the formula.All relation parameters are like {Rx} where x is the sequential order of the relation parameter. Theamount of the relation parameters is not limited.Calculate Fields - Creating formula for a fieldIn the Formulas part of the user interface the user can add formulas for fields of the actual entity.To add a formula, select a field from the dropdown first and then push the Add formula button. Afterthis action, a new line appears in the formula table with the name of the field and with the place for theformula.To remove a formula from the table, simply click on the - in the row of the formula.USER MANUAL 172
The formula is a textbox where the user can write the formulas. The module evaluates the formula onthe given time (on save, on scheduler run or both) and fills the selected field with the evaluated value.The formula can contain any text (with full UTF-8 support), but only the function parts (functions withparameters between ‘{‘ and ‘}’) are evaluated. For example and with the parameters added in theprevious sections, if we fill the formula like: Account {P0} created by user name {R0}, then thedescription field will have the following value after save: Account My Account created by user nameMyUser (implying the account’s name is My Account and the creator user’s username is MyUser).The Calculate Fields has many built-in functions which allows the user to build complex formulas toachieve various goals. These functions are described in the next section.Calculate Fields - Usable functionsAs it is mentioned above, all of the functions are wrapped between ‘{‘ and ‘}’ signs, and they look like{functionName(parameter1; parameter2; …)}. The count of the parameters are different for thedifferent functions. The module evaluates the functions and changes them with their result in theformula.The functions can be embedded into each other (using a result of a function as a parameter for anotherfunction) like in this example:{power({subtract({divide({add({multiply(10; 2)}; 12)}; 8)}; 1)}; 2)}This function is the formalised look of the following mathematical expression:((((10 * 2) + 12) / 8) – 1)2The functions are divided to six groups. These groups are described in the next section of the document.Logical FunctionsLogical functions are returning true or false in the form of 1 and 0 so checkboxes typed fields can befilled with these functions. They can be also used as the logical condition for the ifThenElse function.USER MANUAL 173
equal {equal(parameter1;parameter2)} Signature parameter1: can be any value of any type parameter2: can be any value of any type Parameters Determines if parameter1 equals with parameter2 1 if the two parameters are equal or 0 if not Description {equal(1; 2)} returns 0 Returns Example call {notEqual(parameter1; parameter2)}notEqual parameter1: can be any value of any type Signature parameter2: can be any value of any type Determines if parameter1 not equals with parameter2 Parameters 0 if the two parameters are equal or 1 if not {notEqual(1; 2)} returns 1 Description Returns {greaterThan(parameter1; parameter2)} Example call parameter1: can be any value of any typegreaterThan parameter2: can be any value of any type Signature Determines if parameter1 greater than parameter2 1 if parameter1 greater than parameter2, 0 if not Parameters Description ReturnsUSER MANUAL 174
Example call {greaterThan(3; 3)} returns 0greaterThanOrEqualSignature {greaterThanOrEqual(parameter1; parameter2)}Parameters parameter1: can be any value of any type parameter2: can be any value of any typeDescription Determines if parameter1 greater than or equalparameter2Returns 1 if parameter1 greater than or equal parameter2, 0 if notExample call {greaterThanOrEqual(3; 3)} returns 1lessThan {lessThan(parameter1; parameter2)} Signature parameter1: can be any value of any type parameter2: can be any value of any type Parameters Determines if parameter1 less than parameter2 1 if parameter1 less than parameter2, 0 if not Description {lessThan(3; 3)} returns 0 Returns Example calllessThanOrEqual {lessThanOrEqual(parameter1; parameter2)} Signature parameter1: can be any value of any type parameter2: can be any value of any type Parameters Determines if parameter1 less than or equal parameter2 DescriptionUSER MANUAL 175
Returns 1 if parameter1 less than or equal parameter2, 0 if not Example call {lessThanOrEqual(3; 3)} returns 1empty {empty(parameter)} Signature parameter: text value Parameters Determines if parameter is empty Description 1 if parameter is empty, 0 if not Returns {empty(any text)} returns 0 Example callnotEmpty {notEmpty(parameter)} Signature parameter: text value Parameters Determines if parameter is not empty Description 1 if parameter is not empty, 0 if empty Returns {notEmpty(any text)} returns 1 Example callnot {not(parameter)} Signature parameter: logical value Parameters Negates the logical value of the parameter Description 1 if parameter is 0, 0 if parameter is 1 Returns {not(0)} returns 1 Example callUSER MANUAL 176
and {and(parameter1; parameter2)} Signature parameter1: logical value parameter2: logical value Parameters Applies the AND logical operator to two logical values 1 if parameter1 and parameter2 is 1, 0 if any parameters are 0 Description {and(1; 0)} returns 0 Returns Example callor {or(parameter1; parameter2)} Signature parameter1: logical value parameter2: logical value Parameters Applies the OR logical operator to two logical values 1 if parameter1 or parameter2 is 1, 0 if both parameters are 0 Description {or(1; 0)} returns 1 Returns Example callText FunctionsText functions are used to manipulate text in various ways. All the functions listed here are fullysupports UTF-8 texts, so special characters should not raise any problems.substring {substring(text; start; length)} SignatureParameters text: text valueUSER MANUAL 177
start: decimal value length [optional parameter]: decimal value Cuts the substring of a text field from start. If the length optional parameter is not set, then it cutsDescription until the end of the string, otherwise cuts the provided length. Indexing of a text’s characters staReturns Substring of the given textExample {substring(This is my text; 5)} returns is my textcall {substring(This is my text; 5; 5)} returns is mylength {length(parameter)} Signature parameter: text value Parameters Count the characters in a text. Description The count of the characters in a text. Returns {length(sample text)} returns 11 Example callreplace {replace(search; replace; subject)} Signature search: text valueParameters replace: text value subject: text valueDescription Replace all occurrences of search to replace in the text subject.Returns subject with replaced values.USER MANUAL 178
Example call {replace(apple; orange; This is an apple tree)} returns This is an orange treeposition {position(subject; search)} SignatureParameters subject: text value search: text valueDescription Find position of first occurrence of search in a subjectReturns Numeric position of search in subject or -1 if search not present in subjectExample call {position(Where is my text?; text)} returns 12lowercase {lowercase(parameter)} Signature parameter: text value Parameters Make text lowercase Description The lowercased text. Returns {lowercase(ThIs iS a sAmPlE tExT)} returns this is a sample text Example calluppercase {uppercase(parameter)} SignatureParameters parameter: text valueDescription Make text uppercaseReturns The uppercased text.Example call {uppercase(ThIs iS a sAmPlE tExT)} returns THIS IS A SAMPLE TEXTUSER MANUAL 179
Mathematical functionsMathematical functions are used to manipulate numbers in various ways. Several mathematicaloperators are implemented as functions in Calculate Fields.add {add(parameter1; parameter2)} Signature parameter1: number value parameter2: number value Parameters Adds parameter1 and parameter2 The sum of parameter1 and parameter2 Description {add(3.12; 4.83)} returns 7.95 Returns Example callsubtract {subtract(parameter1; parameter2)} Signature parameter1: number value parameter2: number value Parameters Subtracts parameter2 from parameter1 The distinction of parameter2 and parameter1 Description {subtract(8; 3)} returns 5 Returns Example callmultiply {multiply(parameter1; parameter2)} Signature parameter1: number value ParametersUSER MANUAL 180
Description parameter2: number value Returns Multiplies parameter1 and parameter2 Example call The product of parameter1 and parameter2divide {multiply(2; 4)} returns 8 Signature {divide(parameter1; parameter2)} Parameters parameter1: number value parameter2: number value Description Divides parameter2 with parameter1 Returns The division of parameter2 and parameter1 Example call {divide(8; 2)} returns 4power Signature {power(parameter1; parameter2)} parameter1: number value Parameters parameter2: number value Raises parameter1 to the power of parameter2 Description parameter1 raised to the power of parameter2 Returns {power(2; 7)} returns 128 Example callsquareRoot {squareRoot(parameter)} Signature 181 USER MANUAL
Parameters parameter: number valueDescription Calculates the square root of parameterReturns The square root of parameterExample call {squareRoot(4)} returns 2absolute {absolute(parameter)} Signature parameter: number value Parameters Calculates the absolute value of parameter Description The absolute value of parameter Returns {absolute(-4)} returns 4 Example callDate functionsThere are several date functions implemented in Calculate Fields, so the user can manipulate dates inmany ways. Most of the functions uses a format parameter, which is used to set the result of thefunctions formatted as the user wants to. The options for these formats are equivalent with the PHPformat parameters:Format Description Examplecharacter returned values Day of the month, 2 digits with leading zerosFor day A textual representation of a day, three letters 01 to 31D Day of the month without leading zeros Mon throughD Sun 1 to 31JUSER MANUAL 182
L A full textual representation of the day of the week Sunday throughN ISO-8601 numeric representation of the day of the week Saturday English ordinal suffix for the day of the month, 2 characters 1 (for Monday)S Numeric representation of the day of the week through 7 (for The day of the year (starting from 0) Sunday)W st, nd, rd or th. Works well withZ jFor week 0 (for Sunday)W through 6 (for Saturday)For month 0 through 365FM ISO-8601 week number of year, weeks starting on Monday 42 (the 42ndM week in theN year)TFor year A full textual representation of a month, such as January or January throughL March DecemberO Numeric representation of a month, with leading zeros 01 through 12USER MANUAL A short textual representation of a month, three letters Jan through Dec Numeric representation of a month, without leading zeros 1 through 12 Number of days in the given month 28 through 31 Whether it’s a leap year 1 if it is a leap year, 0 otherwise ISO-8601 year number. This has the same value as Y, except 1999 or 2003 that if the ISO week number (W) belongs to the previous or next year, that year is used instead 183
Y A full numeric representation of a year, 4 digits 1999 or 2003Y A two digit representation of a year 99 or 03For timeA Lowercase Ante meridiem and Post meridiem am or pmA Uppercase Ante meridiem and Post meridiem AM or PMB Swatch Internet time 000 through 999G 12-hour format of an hour without leading zeros 1 through 12G 24-hour format of an hour without leading zeros 0 through 23H 12-hour format of an hour with leading zeros 01 through 12H 24-hour format of an hour with leading zeros 00 through 23I Minutes with leading zeros 00 to 59S Seconds, with leading zeros 00 through 59For timezoneE Timezone identifier UTC, GMT, Atlantic/AzoresL Whether or not the date is in daylight saving time 1 if Daylight Saving Time, 0 otherwiseO Difference to Greenwich time (GMT) in hours +0200P Difference to Greenwich time (GMT) with colon between hours +02:00 and minutesT Timezone abbreviation EST, MDTZ Timezone offset in seconds. The offset for timezones west of -43200 through UTC is always negative, and for those east of UTC is always 50400 positive.For full date/timeC ISO 8601 date 2004-02- 12T15:19:21+0 0:00USER MANUAL 184
R RFC 2822 formatted date Thu, 21 Dec 2000 16:01:07 +0200U Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT)For all functions without timestamp parameter, we assume that the current date/time is 2016.04.29.15:08:03date {date(format; timestamp)} Signature format: format text timestamp: date/time value Parameters Creates a date in the given format timestamp in the given format Description {date(ymd; 2016-02-11)} returns 160211 Returns Example call {now(format)}now format: format text Signature Creates the actual date/time in the given format Parameters Current date/time in the given format Description {now(Y-m-d H:i:s)} returns 2016-04-29 15:08:03 Returns Example callUSER MANUAL 185
yesterday {yesterday(format)} Signature format: format text Parameters Creates yesterday’s date/time in the given format Description Yesterday’s date/time in the given format Returns {yesterday(Y-m-d H:i:s)} returns 2016-04-28 15:08:03 Example calltomorrow {tomorrow(format)} Signature format: format text Parameters Creates tomorrow’s date/time in the given format Description Tomorrow’s date/time in the given format Returns {tomorrow(Y-m-d H:i:s)} returns 2016-04-30 15:08:03 Example calldatediff {datediff(timestamp1; timestamp2; unit)} Signature timestamp1: date/time value timestamp2: date/time value Parameters unit: years/months/days/hours/minutes/seconds; default: days Subtracts timestamp2 from timestamp1 Description The difference between the two dates returned in unit Returns {datediff(2016-02-01; 2016-04-22; days)} returns 81 Example callUSER MANUAL 186
addYears {addYears(format; timestamp; amount)} Signature format: format text timestamp: date/time value Parameters amount: decimal number Adds amount years to timestamp Description Incremented date in format Returns {addYears(Ymd; 2016-04-22; 1)} returns 20170422 Example calladdMonths {addMonths(format; timestamp; amount)} Signature format: format text timestamp: date/time value Parameters amount: decimal number Adds amount months to timestamp Description Incremented date in format Returns {addMonths(Ymd; 2016-04-22; 1)} returns 20160522 Example calladdDays {addDays(format; timestamp; amount)} Signature format: format text timestamp: date/time value ParametersUSER MANUAL 187
Description amount: decimal numberReturns Adds amount days to timestampExample call Incremented date in format {addDays(Ymd; 2016-04-22; 1)} returns 20160423addHours {addHours(format; timestamp; amount)} Signature format: format textParameters timestamp: date/time value amount: decimal numberDescription Adds amount hours to timestampReturns Incremented date in formatExample call {addHours(Ymd H:i:s; 2016-04-22 23:30; 5)} returns 20160423 04:30:00addMinutes {addMinutes(format; timestamp; amount)} SignatureParameters format: format texttimestamp: date/timevalue amount: decimal numberDescription Adds amount minutes to timestampReturns Incremented date in formatUSER MANUAL 188
Example call {addMinutes(Ymd H:i:s; 2016-04-22 22:58; 5)} returns 20160422 23:03:00addSeconds {addSeconds(format; timestamp; amount)} Signature format: format textParameters timestamp: date/time value amount: decimal numberDescription Adds amount seconds to timestampReturns Incremented date in formatExample call {addSeconds(Ymd H:i:s; 2016-04-22 22:58; 5)} returns 20160422 22:58:05subtractYears {subtractYears(format; timestamp; amount)} Signature format: format text timestamp: date/time value Parameters amount: decimal number Subtracts amount years from timestamp Description Decremented date in format Returns {subtractYears(Ymd; 2016-04-22; 5)} returns 20110422 Example callsubtractMonths {subtractMonths(format; timestamp; amount)} SignatureUSER MANUAL 189
Parameters format: format text timestamp: date/time valueDescription amount: decimal numberReturns Subtracts amount months from timestampExample call Decremented date in format {subtractMonths(Ymd; 2016-04-22; 5)} returns 20151122subtractDays {subtractDays(format; timestamp; amount)} Signature format: format text timestamp: date/time value Parameters amount: decimal number Subtracts amount days from timestamp Description Decremented date in format Returns {subtractDays(Ymd; 2016-04-22; 5)} returns 20160417 Example callsubtractHours {subtractHours(format; timestamp; amount)} Signature format: format textParameters timestamp: date/time value amount: decimal numberDescription Subtracts mount hours from timestampUSER MANUAL 190
Returns Decremented date in formatExample call {subtractHours(Ymd H:i:s; 2016-04-22 12:37; 5)} returns 20160422 07:37:00subtractMinutes Signature {subtractMinutes(format; timestamp; amount)} format: format textParameters timestamp: date/time value amount: decimal numberDescription Subtracts amount minutes from timestampReturns Decremented date in formatExample call {subtractMinutes(Ymd H:i:s; 2016-04-22 12:37; 5)} returns 20160422 12:32:00subtractSeconds {subtractSeconds(format; timestamp; amount)} SignatureParameters format: format texttimestamp: date/timevalue amount: decimal numberDescription Subtracts amount minutes from timestampReturns Decremented date in formatExample call {subtractSeconds(Ymd H:i:s; 2016-04-22 12:37; 5)} returns 20160422 12:36:55USER MANUAL 191
Control FunctionsThere is only one control function implemented in Calculate Fields so far, but this function ensuresthat the user can write very complex formulas with conditions. Since the functions can be embeddedin each other, the user can write junctions with many branches.ifThenElse {ifThenElse(condition; trueBranch; falseBranch)} Signature condition: logical valueParameters trueBranch: any expression falseBranch: any expressionDescription Selects one of the two branches depending on conditionReturns trueBranch if condition is true, falseBranch otherwiseExample call {ifThenElse(\{equal(1; 1)}; 1 equals 1; 1 not equals 1)} returns 1 equals 1CountersThere are several counters implemented in Calculate Fields which can be used in various scenarios.The counters sorted into two groups:1. Global counters: Counters which are incremented every time an affected formula is evaluated2. Daily counters: Counters which resets every day. (Starting from 1)In this chapter we assume that the counters current value is 4, so the incremented value will be 5 withthe given format.GlobalCounter {GlobalCounter(name; numberLength)} SignatureUSER MANUAL 192
Parameters name: any text numberLength: decimal numberDescription Increments and returns the counter for name with lengthnumberLengthReturns Counter with length numberLengthExample call {GlobalCounter(myName; 4)} returns 0005GlobalCounterPerUser Signature {GlobalCounterPerUser(name; numberLength)}Parameters name: any text numberLength: decimal number Increments and returns the counter for name for the user who creates the entity withDescription length numberLengthReturns Counter with length numberLengthExample {GlobalCounterPerUser(myName; 3)} returns 005callGlobalCounterPerModule Signature {GlobalCounterPerModule(name; numberLength)}Parameters name: any text numberLength: decimal number Increments and returns the counter for name for the module of the entity withDescription length numberLengthReturns Counter with length numberLengthUSER MANUAL 193
Example {GlobalCounterPerModule(myName; 2)} returns 05callGlobalCounterPerUserPerModule Signature {GlobalCounterPerUserPerModule(name; numberLength)} name: any textParameters numberLength: decimal number Increments and returns the counter for name for the user who creates the entity andDescription for the module of the entity with length numberLengthReturns Counter with length numberLengthExample {GlobalCounterPerUserPerModule(myName; 1)} returns 5callDailyCounter Signature {DailyCounter(name; numberLength)} name: any textParameters numberLength: decimal numberDescription Increments and returns the counter for name with lengthnumberLengthReturns Counter with length numberLength, or if the counter is not incremented this day then 1 with length numberLengthExample {DailyCounter(myName; 1)} returns 5callUSER MANUAL 194
DailyCounterPerUser {DailyCounterPerUser(name; Signature numberLength)}Parameters name: any textnumberLength: decimal number DescriptionIncrements and returns the counter for name for the user who Returnscreates the entity with length numberLengthCounter with length numberLength, or if the counter is notincremented this day for this user then 1 with Example calllength numberLengthDailyCounterPerModule Signature {DailyCounterPerModule(name; numberLength)} name: any textParameters numberLength: decimal number Increments and returns the counter for name for the module of the entity withDescription length numberLengthReturns Counter with length numberLength, or if the counter is not incremented this day for this module then 1 with length numberLengthExample {DailyCounterPerModule(myName; 1)} returns 5callDailyCounterPerUserPerModule Signature {DailyCounterPerUserPerModule(name; numberLength)}USER MANUAL 195
name: any textParameters numberLength: decimal number Increments and returns the counter for name for the user who creates the entity andDescription for the module of the entity with length numberLengthReturns Counter with length numberLength, or if the counter is not incremented this day for the user who creates the entity and for this module then 1 with length numberLengthExample {DailyCounterPerUserPerModule(myName; 1)} returns 5callExample - Calculate monthly fee for an opportunityUse CaseThe user would like to calculate a monthly fee of an opportunity to a custom field by dividing theamount of the opportunity by the duration.SetupOur opportunities module has a dropdown field called Duration with values: (database value inbrackets) 6 months [6], 1 year [12], 2 years [24]. There is also a currency field called Monthly.WorkflowGo to WorkFlow module and create a new WorkFlow. Set the base options like the following:Name: as you wish WorkFlow Module:OpportunitiesStatus: Active Run: Only on saveRun on: All records Repeated runs: checkedUSER MANUAL 196
We do not create any conditions, since we would like the WorkFlow to run on all opportunities.Now, add an action and select Calculate Fields from the dropdown.Then, add two fields from Opportunities as parameters. First, select Opportunity amount (amount) andadd it as a parameter (it will be {P0}) then select Duration and the raw value option from the data typedropdown and add it as parameter two (it will be {P1}). There is no need to add any relationalparameters for this formula.Now, add a formula for the monthly field and fill the textbox with the following formula:{divide({P0}; {P1})}So the whole action should look like this:USER MANUAL 197
Save the WorkFlow and create a new Opportunity:As you can see, we did not even add the monthly field to the EditView, because we don’t want to forcethe user to make calculations. Save the Opportunity and check the results on the DetailView:AOW Calculated Fields was contributed by diligent technology & business consulting GmbHUSER MANUAL 198
Removing ActionsYou can remove Action Lines by clicking the x on the top right hand side of the Action.Removing Field and Relationship LinesYou can remove Field and Relationship Lines by clicking the - on the left hand side of the Action.Process AuditAdvanced OpenWorkflow allows users to audit your processes. In the Detail View of each WorkFlowrecord there is a sub-panel called 'Processed Flows'.This lists all the workflow processes which have been actioned including details on the record whichactioned the flow, its status and the date it was created.USER MANUAL 199
Search
Read the Text Version
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
- 99
- 100
- 101
- 102
- 103
- 104
- 105
- 106
- 107
- 108
- 109
- 110
- 111
- 112
- 113
- 114
- 115
- 116
- 117
- 118
- 119
- 120
- 121
- 122
- 123
- 124
- 125
- 126
- 127
- 128
- 129
- 130
- 131
- 132
- 133
- 134
- 135
- 136
- 137
- 138
- 139
- 140
- 141
- 142
- 143
- 144
- 145
- 146
- 147
- 148
- 149
- 150
- 151
- 152
- 153
- 154
- 155
- 156
- 157
- 158
- 159
- 160
- 161
- 162
- 163
- 164
- 165
- 166
- 167
- 168
- 169
- 170
- 171
- 172
- 173
- 174
- 175
- 176
- 177
- 178
- 179
- 180
- 181
- 182
- 183
- 184
- 185
- 186
- 187
- 188
- 189
- 190
- 191
- 192
- 193
- 194
- 195
- 196
- 197
- 198
- 199
- 200
- 201
- 202
- 203
- 204
- 205
- 206
- 207
- 208
- 209
- 210
- 211
- 212
- 213
- 214
- 215
- 216
- 217
- 218
- 219
- 220
- 221
- 222
- 223
- 224
- 225
- 226
- 227
- 228
- 229
- 230
- 231
- 232
- 233
- 234
- 235
- 236
- 237
- 238
- 239
- 240
- 241
- 242
- 243
- 244
- 245
- 246
- 247
- 248