Você está na página 1de 350

How

to mission.do

Edited by Violet Meyer

How to mission.do
1 Chapter 1: Introduction to mission.do 1.1 1.2 1.3 1.4 1.5 1.6 1.7 2 Overview Getting Started The mission.do User Interface Editing and Creating Pages, Views and Application Records Editing Objects mission.do Setup mission.do Applications 9 11 12 16 19 21 22

Chapter 2: Basic Concepts 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 Chapter Overview Objects Creating a New Object Object Properties Fields Basic Field Types Advanced Field Types Portal Field Types System Field Types 24 25 26 28 32 35 40 46 47 49 51 52 54 56 58

2.10 Advanced Field Properties 2.11 Adding Fields to Pages, Views and Reports 2.12 Field Actions 2.13 Advanced Field Topics 2.14 Relationships 2.15 Lookup Fields

2.16 Related View 2.17 Tabs and Menus 2.18 Portals 2.19 The mission.do Calendar 3 Chapter 3: Views and Searches 3.1 3.2 3.3 3.4 4 Chapter Overview Views Creating and Editing Views Search

61 62 66 67

71 72 76 84

Chapter 4: Pages, Page Editor and Grid Control 4.1 4.2 4.3 4.4 4.5 4.6 Chapter Overview Understanding mission.do UI Components Page Types and Components Page Editor Grid Control Data Validation 90 91 93 96 104 105

Chapter 5: Reports, Charts, and Gauges 5.1 5.2 5.3 5.4 Chapter Overview Reports Charts Gauges 107 108 113 115

Chapter 6: Server-Side Code: Templates and Mission Control Formulas 6.1 6.2 Chapter Overview Templates and Formulas Overview 118 119

6.3 6.4 6.5 6.6 6.7 6.8 6.9

Creating Templates in the Page Editor Template Fields and Integration Links Record Name Template Syntax for Template Tokens Loops Through Related Records Example of a Template Field Mail Templates

120 122 123 124 127 129 130 131 134 138 139

6.10 Document Templates 6.11 Formulas 6.12 Example of Date Usage in Formulas 6.13 Group Functions 7 Chapter 7: Client-Side Code: HTML Event Handlers 7.1 7.2 7.3 7.4 7.5 8 Chapter Overview HTML Event Handlers Copying a Fields Value to Other Fields Changing the Appearance of Fields Setting Default Values

143 144 146 147 148

Chapter 8: Additional Application Tools 8.1 8.2 8.3 8.4 8.5 8.6 8.7 8.8 Chapter Overview Auditing Communication Logs Printing and PDF Generation Cloning Records and New Record Templates New Record Templates Converting Records Attaching Related Records to a Newly Created Converted Record 150 151 153 154 155 156 157 159

8.9

Finding Duplicates

160 161

8.10 Locking Records 9 Chapter 9: Importing and Exporting 9.1 9.2 9.3 9.4 9.5 9.6 10 Chapter Overview Importing Data Updating and Deleting Records from a Spreadsheet Creating an Object from a Spreadsheet Data Format for Importing Exporting from Views and Reports

163 164 168 169 171 172

Chapter 10: Workflow and Triggers 10.1 Chapter Overview 10.2 Workflow Concepts: Processes, Statuses and Actions 10.3 Common Action Properties 10.4 Triggers 174 175 180 182

11

Chapter 11: Security and Access Control 11.1 Chapter Overview 11.2 mission.do Security Overview 11.3 Passwords, Authentication and Logins 11.4 Private Attribute 11.5 User Roles and Permissions 11.6 Access Control Examples 11.7 Location/Department/Function Permissions 195 196 198 200 201 205 207

12

Chapter 12: Portals and Hosted Files 12.1 Chapter Overview 211

12.2 What is a mission.do Portal? 12.3 Managing Portals 12.4 Creating Portal Pages 12.5 Portals and Security 12.6 Planning and Building Portals 12.7 Creating a Portal with Authentication 12.8 Portal Page Properties 12.9 Using URLs to Portal Pages 12.10 Hosted Files 12.11 Using Hosted Files 13 Chapter 13: Additional Application Tools: Advanced 13.1 Chapter Overview 13.2 Multi-Currency Support 13.3 Approvals 13.4 Surveys and Quizzes 13.5 Google Apps Integration 13.6 Facebook Integration 14 Chapter 14: Setup and Administration 14.1 Chapter Overview 14.2 Personal Setup 14.3 Administration Setup 15 Chapter 15: Integration and mission.do APIs: SOAP, REST, RSS and JDBC 15.1 Chapter Overview 15.2 SOAP API 15.3 REST API

212 213 215 217 218 220 223 224 225 227

230 231 234 237 242 246

248 249 252

263 264 288

15.4 RSS 15.5 JDBC Driver 16 Chapter 16: Publishing and Distributing Applications 16.1 Chapter Overview 16.2 Application as a Container for Objects and Other Components 16.3 Installing and Publishing Applications 17 Chapter 17: Wrapping Up and Glossary 17.1 Chapter Overview 17.2 Summary of mission.do 17.3 Glossary of Terms 18 Appendix A: Creating mission.do Applications from Microsoft Access Database 18.1 Instructions 19

309 311

313 314 321

327 328 329

339

Appendix B: Migrating Applications from Salesforce.com and the Force.com Platform 19.1 Instructions 343

20

Appendix C: External Database Tables as mission.do Objects 20.1 Instructions 346

Chapter 1: Introduction to mission.do

How to mission.do - 8

Overview
Chapter Overview

This chapter introduces the mission.do platform and walks you through setting up an account and logging in. We review the user interface and all of its core components, providing a basic understanding of how to navigate within mission.do and mission.do built solutions. We also introduce the concept of customizing solutions by changing page layouts and views, as well as the underlying object definitions themselves. The Calendar and Setup area are introduced and an overview of the Application Directory is provided. It explains the following critical concepts in detail: Platform as a Service; the structure and infrastructure of mission.do; an overview of the mission.do UI (header and sidebar); and the Recycle Bin
mission.do Platform Overview

Welcome to mission.do, a new way to find, create, customize and share web-based business applications. mission.do was designed from the ground up as a web-based applications platform. mission.do can be accessed by any number of users in your organization from a standard web browser; anytime, anywhere. Using mission.do, you can quickly and easily discover, develop and deploy online mission.do Applications for managing a variety of business functions throughout your company. There is no hardware or software to buy or install. There are no technical requirements, other than an Internet connection and an up-to-date web browser. All of your mission.do Applications run online in one integrated environment, sharing a common security model, data model and user interface. Once installed, you can customize any mission.do application to meet your specific business needs using easy-to-learn drag & drop and point & click tools. After you become familiar with mission.do, you can use these same tools to build your own custom Applications from scratch, all without leaving your browser.
Platform as a Service

mission.do Applications are created and customized using Object Oriented concepts, without most of the traditional programming that goes with them. We call this Object Oriented Success because the focus is on getting your business to the end result of successful working applications as quickly as possible, with minimal technical know-how. Object definitions are the basic building blocks of mission.do Applications. By creating Objects

How to mission.do - 9

and relationships between and among them you will be on your way to building sophisticated web-based business Applications quickly without the need to write a lot of code. We will go into more detail about Objects later in this chapter and throughout the guide.
Object Oriented Success

mission.do Applications are created and customized using Object Oriented concepts, without most of the traditional programming that goes with them. We call this Object Oriented Success because the focus is on getting your business to the end result of successful working applications as quickly as possible, with minimal technical know-how. Object definitions are the basic building blocks of mission.do Applications. By creating Objects and relationships between and among them you will be on your way to building sophisticated web-based business Applications quickly without the need to write a lot of code. We will go into more detail about Objects later in this chapter and throughout the book.
Supported Browsers

All you need to use mission.do is an up-to-date web browser with JavaScript and Cookies enabled. You can access mission.do at http://www.mission.do using a Windows, Linux, or Macintosh (Mac) computer. We recommend one of the following browsers: Internet Explorer 7.0+ Firefox 3.0+ Google Chrome 7.0+ Safari 3.0+
HTTPS, Secure Socket Layer (SSL)

mission.do protects your web browsing session with HTTPS and SSL. Depending on the browser you are using, you will see a lock icon in the address or the status bar that verifies you are accessing the mission.do service via HTTPS. With HTTPS, Secure Socket Layer (SSL) technology protects your information using both server authentication and data encryption, ensuring that your data is safe, secure and available only to registered Users in your account.

How to mission.do - 10

Getting Started
The fastest way to get started with mission.do is to log in and become familiar with the user interface. After you have an understanding of the interface, we suggest moving on to installing and experimenting with one or more pre-built Applications from the Application Directory. To use mission.do, you will need to sign up for an account. Visit http://www.mission.do and follow the steps to create your account. The first person that signs up for mission.do becomes an Administrator. During the sign up process, this user provides information about your organization that is stored in your account. Administrators can create new users, install Applications from the Application Directory, customize Applications for your specific business needs and create entirely new Applications based on your requirements. Any User with the Administrator role has full access to all of these features, as well as all data in your mission.do account. Administrative users can also purchase additional user licenses, upgrade to another Edition and add more capacity for Records, Applications, Storage, etc. As mentioned above, if you are the first person in your company or team to sign up for mission.do, you will be a mission.do Administrator. If someone else in your group needs access, any mission.do Administrator can create an account.
Logging In

Once your account has been created, you will receive an email containing your user name and a temporary password. When you log in the first time, you will be prompted to change your password. We also recommend that you change your password periodically to ensure maximum protection of your account. Based on the way your Administrator has configured security settings, your password may be required to meet certain criteria. To login to mission.do, go to: http://www.mission.do and click the Login link.

How to mission.do - 11

The mission.do User Interface


Using the mission.do web-based user interface, you can search, navigate and enter data in various ways. Typically, you start by selecting the Application you want to work with from the Sidebar on the left (described in more detail below) and then choose one of the Applications tabs to add, edit, or view information.
Main User Interface Screen

When you log in to mission.do the main mission.do user interface screen is displayed, as shown in the screen shot above.

Sidebar

The Sidebar is displayed on the left side of the screen and contains several sections: Apps: Displays each mission.do Application installed in your account and allows you to switch among them. Each toggle is fully expandable, allowing you to drill down directly into any page within an Application. The New App link allows you to quickly create a new Application in your account. The Find Apps link opens the Application Directory where you can find, test drive and install pre-built Applications into your account. Create: Provides a drop-down box showing all the records available for creation in your accounts current Applications, allowing you to quickly create a new data record of any type. Calendar: Provides convenient access to your mission.do Calendar where you can view, manage and create Tasks and Events in Month, Week and Day views.

How to mission.do - 12

Recent Items: Displays a list of data records you have recently viewed, allowing quick access for editing. A link to the record is shown along with the Object type in parentheses. Click on the link to open the record. Users Online: Displays a list of fellow Users in your mission.do account with current active sessions and status in parenthesis: Active: activity within the last 5 minutes Idle: activity less than 30 minutes ago Away: last activity more than 30 minutes ago

How to mission.do - 13

Recycle Bin: Provides a link to the Recycle Bin for your account where you can review, restore and purge previously deleted data. Records will remain in the Recycle Bin for 30 days before they are permanently deleted. : Deleted records will be permanently purged after 30 days. Prior to this you can restore deleted records from the Recycle Bin, however, some information such as uploaded files cannot be restored.

Accessing Application Content

You can access your Applications records using Tabs, Pages and Objects, as described in the following sections.
Navigation Bar and Tabs

To the right of the Sidebar on the main mission.do UI screen, a navigation bar shows the title of the current Application, with its Tabs underneath. Each Tab contains one to several menu items that point to different Pages within that Tab. The + Tab is only shown to Administrators and provides a quick way to create a new Tab or Object.

The active Tab shows an arrow next to the name, for Administrators only. Click this arrow to display links to access the Object definition and Tab properties.

Search

mission.do allows you to perform extensive searches for records across your Applications. At the top of the main mission.do UI screen, you will see a blank box for entry of keywords, a drop-down box for selection of Objects, a Search button and a link for Search Tips. You can use
How to mission.do - 14

these to search through all of your mission.do by keyword, or you can narrow the search to records of a particular Object type. The mission.do search engine searches structured data (e.g., Object records) and unstructured data (e.g., file attachments). In addition to this global search engine, each Object allows you to run specific queries to do more fine-grained, field-specific searches throughout your data. Using these search queries is defined in more detail in subsequent chapters.

The mission.do Calendar

mission.do provides a comprehensive, integrated Calendar function. Click on any link in the Calendar sidebar component to display the mission.do Calendar, where you can navigate Event and Task Object records in Day, Week and Month views. In addition to regular list Views, records in Objects containing the Event or Task attribute will appear in the Calendar automatically (Object attributes are discussed in more detail later in subsequent chapters). Users can filter the Calendar in real-time to show all records, or only records of a particular type.

How to mission.do - 15

Editing and Creating Pages, Views and Application Records


The top right of corner of the main mission.do UI screen contains three icons: Edit this Page, Print and PDF. The Edit this Page icon allows Administrators to make changes to the current page using the real-time WYSIWYG (what you see is what you get) Page Editor. The Print icon displays a printable version of the current page without sidebars, headers, footers, or active links. The PDF icon creates a PDF document of the printable version of the current Page. When you click on an Application link in the Sidebar, the main mission.do UI screen displays a view Page with that Applications most recent records, by default. Pages can contain a number of components and Administrators can control which components each Page contains, as well as the layout of components within each Page and the specific configuration of each component. For example, the screen shot below shows a Page containing a View component for navigation of Organization records:

Administrators can create and edit Views for any Object as needed. In this example, clicking on an Organization record takes you to a View Page for that particular record, where you can see field data associated with that record, along with Related Views showing information about any Object records related to that record.

How to mission.do - 16

To edit a record, click the Edit button. To create a new record, click the New XX link under the appropriate Tab, or use the New XX link on the Sidebar. These actions will display an Edit Page or a New Page screen, allowing input as shown below:

Administrators can customize the layout and content of any Page by clicking the Edit this Page link in the navigation bar to invoke the mission.do Page Editor. You can drag and drop components to move them around the Page, edit component properties and create new components on the fly.

How to mission.do - 17

See Chapter 4. Pages, the Page Editor and Grid Control for more on the Page Editor.

How to mission.do - 18

Editing Objects
In addition to customizing the mission.do UI, you can directly edit underlying Object definitions including properties, attributes, fields, relationships and a long list of components. To edit an Object, click the arrow next to the Object name on its Tab (e.g., Organization), click the Object Definition link and then click the Edit button. This displays the mission.do Setup area, where you can edit the items that make up the Object, as illustrated in the screenshot below: For example, you can create and manage Charts that are Object components that allow you to generate real-time animated dashboards of Object record data on the fly. Administrators can create and modify Charts for any Objects as needed.

There are many other Object components such as Gauges, Reports, Email and Document Templates, Workflow Statuses and Actions, Triggers, Conversion Maps, etc. There are also many Object features such as Importing, Exporting, Searching, Tagging, Cloning, Merging, Sending

How to mission.do - 19

Email, Subscribing to Views via RSS and more. These Object components, features and their customization steps are described in more detail in subsequent chapters.

How to mission.do - 20

mission.do Setup
You can configure personal and account settings, as well as access administrative functions including User and Role management from the main mission.do Setup area. Click the Setup link in the upper right corner, then click one of the blue Setup links to work with a desired setup area: Personal Setup Applications Setup Administration Setup

See Chapter 14. Setup and Administration for more details.

How to mission.do - 21

mission.do Applications
Before diving into the details of mission.do Application components (such as Objects and Pages), we advise that you log into your mission.do account, become familiar with the user interface and then install one or more Applications from the Application Directory. Play around with the different components to get your feet wet. mission.do Applications consist of a set of configurable components combined together to form a working Application. The core components of an Application are Objects, Tabs and Portals. Similarly, each of these core components consists of its own sets of configurable sub-components. The process of creating an Application in mission.do involves defining core components and then building them out by adding and configuring their sub-components. We will discuss each core component and their sub-components in subsequent chapters.
Updating Applications

In addition to allowing you to install Applications, the Application Directory allows you to check back regularly for new versions and updates to Applications you have already installed. If updates exist, you will see an Install Updates button that allows you to upgrade to the latest published version of that Application. Some Applications are marked as Managed, meaning that the publisher retains full control of the Applications structure; you cannot customize any of its components. Only the publisher can customize managed Applications.

How to mission.do - 22

Chapter 2: Basic Concepts

How to mission.do - 23

Chapter Overview
This chapter introduces and describes the basic concepts of the mission.do platform by summarizing and explaining the purpose of the following core components: Objects: The core component of mission.do Applications, along with their properties and attributes. Fields: The core component of Object definitions, along with each of the different Field types available when defining Objects. Relationships: Used to connect Object definitions together to form more sophisticated Applications. Tabs and Menus: The core navigation components of mission.do Applications. Portals: The access mechanism into your mission.do Application for customers and other external entities (described in more detail in Chapter 12. Portals). Applications: The grouping together of Objects, Tabs and Portals, along with how to create them. Calendar: A useful way to view and work with Task and Event data throughout a mission.do account.

How to mission.do - 24

Objects
Objects, often called Object definitions, are the basic building blocks of mission.do Applications. You can define Objects to represent any kind of business data: Organizations, Contacts, Requests, Grant Cycles, and so forth.
Object Concepts

An Object definition is a template for what the actual, in-use implemented instances of that Object should look like. An Object definition is similar in concept to a cookie cutter or mold that defines the overall shape and contours of the end product: Records. Object records are actual instances of Object definitions. For example, if you have defined an object called Organization, each Object record would represent an actual organization in your company. Object records are rows of data in your mission.do database. You can create as many Object records as you need, up to the record limit in your account. To see what the record limit in your account is click the Support link in the upper-right corner of the main mission.do UI screen and then click the Subscription Info link in the Support drop-down menu.

How to mission.do - 25

Creating a New Object


mission.do provides two paths to creating a new object. The first is to click the tab from within any Application that displays the (+) following screen with three initial options:
Creating a New Object

Select the desired option and click Create. Creating Tabs is defined in more detail in Section 4.1 Tabs. The second path to creating a new Object is to click the Setup link, click the Applications Setup link in the Setup drop-down menu and then click the Objects link. These actions display a list of all Objects in your account, from which you can customize them or click New Object to start the process of creating a new Object definition:

Clicking the Create button on the Create screen above, or clicking the New Object link on the Setup screen above, displays the New Object form:

How to mission.do - 26

The New Object form contains blank Fields for setting the Objects properties, attributes, permissions, roles and other items as described in more detail below. Required Field names are in red.

How to mission.do - 27

Object Properties
Objects have a number of properties, from basic to advanced, that define the Objects record characteristics and basic behavior.
Properties

Deployment Status: A flag that activates the Object for use. Uncheck this box to make the Object unavailable for users and keep it in the system. Objects must be un-deployed (box unchecked) prior to being deleted. Singular Name: The name used when referring to single instances of this Object, e.g., Project. Plural Name: The name used when referring to multiple instances of this Object, e.g., Projects. Record Name: The Field label used to identify records of this Object type, typically the singular name, e.g., Project. Record Name Template: The name used to identify individual records of this Object type. Merge Fields can be used to generate names based on one or more Field values. Integration Name: A globally unique code used to identify this Object when it is used in relationships, formulas, integration, API access and Application publishing. mission.do will create a default integration name, based on the Object singular name, when you create a new Object. If you plan to publish the Object as part of an Application, we recommend adding a prefix to the integration name such as ABC__ where ABC is an abbreviation of your company name, so that it remains unique. Default Process: If you give the Object a Workflow attribute (see Object Attributes below), this Field is displayed after you save the Object and edit it the first time. It specifies which Workflow process should be assigned to new records by default if no process is explicitly specified. The first Status in that process will be assigned to new records by default if no status is explicitly specified. Description: A brief description of this Object definition.
Optional Advanced Properties

Audit Trail: Enables a full historical activity log that can be used to track all changes and updates to each record. This log is useful for HIPPA and SOX compliance, or any other need for historical activity tracking. Flagging: Allows users to mark records with a flag icon for future reference and follow-up. Viewed/Unviewed Tracking: Shows unviewed records in bold that allow you to visually differentiate records that have been viewed from those that haven't. Show "Tag" Button: Check this option if you want to add search tags to this objects records.

How to mission.do - 28

Dependent: Creates this Object as dependent, meaning that its records typically relate to a parent Objects records. For example, you could define a Quote Line Item Object as dependent, because it only makes sense in the context of a parent Quote Object.
Object Attributes

Object attributes, such as Task, Event, Document and Workflow, control specific Object behavior and contain a default set of Fields. Some examples: Records in Objects with the Task and/or Event attribute show up in the mission.do Calendar view. Objects with the Document attribute represent a file attachment and the files contents are indexed in the full text search engine. With the Workflow attribute, special Object features are enabled for managing workflow processes, statuses and actions allowing you to model many kinds of business processes. When creating a Customer Object, you can select the "Location" attribute when Customers have location information. When creating a Customer Contact, you can select the "Contact" attribute when Customer Contacts have associated contact information, allowing you to send Contact email.

Objects also have several optional and advance attributes. You can enable any number of these for any Object definition, allowing you to manipulate Object behavior in more specific ways. When you add an attribute to an existing Object, mission.do adds a new group of Fields to the Object to support the attribute. While you cannot delete these Fields, you can modify most of their properties (e.g., you cannot modify a Fields integration name). These new Fields are added to the objects View, Create and Edit pages in a new section. Similarly, when you remove an attribute from an object, misison.do will delete these Fields as a group.
Attributes

Contact: Objects with the Contact attribute represent people or organizations that have associated contact information. You can send email contact records and export them in the standard vCard format. The following Fields are added when this attribute is enabled: First Name, Middle Name, Last Name, Job Title, Phone, Mobile Phone, Fax, Email Address and Contact Owner. Location: Objects with the Location attribute represent people, places or organizations with associated location and street address information. The following Fields are added when this attribute is enabled: Street Address 1, Street Address 2, City, State/Province, ZIP/Postal Code and Country. When this attribute is selected you can choose to add Google Maps component to view pages (see Chapter 13 for details). Event: Objects with the Event attribute represent scheduled activities or meetings that have

How to mission.do - 29

an associated start time, duration and group of participants. You can display, create and manage Event records in the mission.do Calendar view and export them in the standard iCalendar format. The following Fields are added when this attribute is enabled: Event Subject, Start Date/Time, Duration, All Day, Private, Description, Location, Assigned To and Pop-up Reminder. Task: Objects with the Task attribute represent deadlines, follow-ups, or to-dos that have a due date and one or more associated assigned users. You can display, create and manage Task records in the mission.do Calendar view and export them in the standard iCalendar format. The following Fields are added when this attributed is enabled: Task Subject, Due Date, Priority, Private, Description and Assigned To. Document: Objects with the Document attribute represent a file attachment. mission.do indexes attached files in standard Word, Excel, PDF, or plain text formats for full text search. The following Fields are added when this attributed is enabled: Document File and Description. Organization: Objects with the Organization attribute have additional lookup Fields for associating records with a Location, Department and Function in your organization.
Advanced Attributes

Workflow: Objects with the Workflow attribute can be routed through an automated or manual workflow process defined by a set of workflow statuses and actions. The following Fields are added when this attributed is enabled: Workflow Process, Workflow Status and Workflow Actions (list of available actions). See Chapter 10. Workflow and Triggers, for more details. Portal Visitor: Objects with the Portal Visitor attribute represent registered users of one or more Portals. You can use Portal Visitor Objects to require portal authentication and enable the creation of rich interactive portals that expose specific capabilities of your mission.do Applications to external users. The following Fields are added when this attributed is enabled: Login Name, Password and Is Active. See Chapter 12. Portals, for more details. Approval: Use this attribute to mark Objects subjected to approval process. See Chapter 13. Additional Application Tools: Advanced for more details. Survey: Objects with the Survey attribute enable a "Questions Library" for that Object, allowing you to create any number of questions that can then be attached to any record to form a questionnaire. You can rank each question's answer to assign an overall score to survey responses. See Chapter 13. Additional Application Tools: Advanced for more details. Survey Taker: Objects with the Survey Taker attribute represent responses to surveys. See Chapter 13. Additional Application Tools: Advanced for more details. Queue: Use this attribute to mark Objects to form a queue. Users can pick up records from queue for further processing. See Chapter 13. Additional ApplicationTools: Advanced for more details. Multi-Currency: Provides support for conversion of money amounts in foreign currencies into your bookkeeping currency.

How to mission.do - 30

Managing Objects

There are three ways to begin the process to create a new Object Definition: Click the tab in the Applications menu row. Click the New Object link in the Objects list Page or on an Applications View Page. Click the New Object via Spreadsheet link in the Objects list Page.

Once created, you can access an Object and its components from the Object View Page by clicking on the desired Object from the Objects list. To delete an Object, you must first un-deploy it by editing the Object and un-checking the Deployed setting. Note that deleting an Object will:
RSS

Delete all Object records. Delete all of that Objects components (fields, Pages, templates, etc.). Delete all menus associated with the Object. Delete all relationships with other Objects. Delete the entire Object Definition.

You can use the RSS button on the Object View Page to enable RSS feeds on that Object. See Chapter 15. Integration and mission.do APIs: SOAP, REST and RSS for more information on setting up RSS feeds for Objects.

How to mission.do - 31

Fields
In addition to properties and attributes, Objects contain a number of configurable components, such as Fields, Relationships, Pages, Views, etc., each of which is discussed in more detail below. Objects also have Permissions that allow you to define specific access control settings at the User and Role levels. Objects also have a complete administrative audit trail, allowing you to see the who, what and when of any change that occurred to an Object definition or its components, at any time. When you click on an Objects link in the Object list (Setup > Application Setup > Objects), the Setup screen displays a bar with quick links to all of its components at the top of the Objects definition Page. Use these links to go directly to the desired component.

Introducing Fields

Fields are the basic building block of Object definitions. Objects can have up to 500 associated Fields. Fields are used in Pages, Views, Charts and other Object components to display and input Object data. Fields determine what kind of data is stored with each Object record. If you think of an Object definition like a spreadsheet or a database table, a Field would be a column and each row would be an Object record. When viewing any Object definition, you can see that there are several Fields created automatically that cannot be deleted. Click on any Field to view its details. Click the "Edit" link to edit Field properties that determine global Field behavior.
Adding New Fields

To add a Field, click the "New Field" button that displays a list of the available Field types. Choose the most appropriate Field type based on the kind of data you want to store in that Field. For example, for an Amount Awarded Field, you might select Currency; for a Description Field, you might select Text Area. Click the "Next" button to define the Field's properties. The most basic property is the Field's label that is used as an identifier in all Pages, Views, Reports and any other places the Field
How to mission.do - 32

appears in your Application. Some attributes are common to all fields: Field Label (mandatory) is displayed on the left from the field on View, Edit, New Record etc. pages. View Header (optional) is used in headers of Views and Reports. If not specified, Field Label is used.

Each Field has a varying number of additional properties based on its type. For example, Currency Fields have a size and a Currency Format property that allows you to select the type of currency to use. Text Areas have a default height and width, as well as a property specifying whether or not to use a rich text editor. Each Field has a set of advanced Field properties. Different advanced properties are available depending on the type of the Field. For example, all text-based Fields can be indexed as part of the full text search engine, but image Fields cannot. Most Fields can be audited so you can keep a historical log of when a Field has changed its value, but text area Fields cannot be audited. After you have defined Field properties, you will also need to ensure each Field has a unique integration name that Mission Control automatically assigns in most cases. The integration name is used to reference this Field via merge Fields, as well as the Mission Control APIs.

The Field-Level help function allows you to define help text for the Field that will appear in a popup bubble when the user clicks on the help icon next to the Field.

How to mission.do - 33

The last step in creating a Field is deciding which Pages and Views the Field on which to include the Field by default. Mission Control displays a list of Application Pages on the left, a list of Portal Pages in the center and a list of Views on the right. Check all that apply.

How to mission.do - 34

Basic Field Types


The sections below explain the different Field types.
Text

With the Text Field type, users can enter any combination of characters. You can optionally define the following properties: Default size of HTML Input Field shown in forms (you can override this default as a Page-level property using the Page Editor). The maximum allowed length (number of characters). Check if this Field allows multiple values for supported languages (for customer zones with more than one language assigned, see Chapter 14. Setup and Administration for more information on multilingual usage). An input mask to enforce certain kinds of input based on a pre-defined format (example: ###-##-#### ) Check if you want to apply input mask on-the-fly when text field loses focus during editing. Text to be used as the default value for new records.
Text Area

With the Text Area Field type, Users can enter multiple lines of text. You can optionally define the following properties: A maximum length of input (number of characters) to accept. Default height and width of HTML text area (you can override this default as a Page-level property using the Page Editor). Enable a Rich Text Editor so users can enter text as formatted HTML.
Checkbox

With the Checkbox Field type, users can select a Checked (true) or Unchecked (false) value. When creating a Checkbox Field, you specify whether you want to the Field to be checked or unchecked by default.
Currency

With the Currency Field type, users can enter a dollar or other currency amount. You can optionally define the following properties: Currency Format (this setting will only affect formatting of the Field; missio.do currently

How to mission.do - 35

does not support multi-currency calculations). Default value for new records. Minimum allowed value for this Field. Maximum allowed value for this Field. When you create a new Currency Field for Objects that support the multi-currency attribute, you can optionally create a counterpart Base Currency Field that will transfer the foreign currency amount into the currency of your bookkeeping.
Base Currency

This Field is only available for Objects that support the multi-currency attribute. The Base Currency Field is a dependent Field that transfers the foreign currency amount specified in the selected Currency Field (see above) into the currency of your bookkeeping. You can create this Field as a counterpart for new a Currency Field. To create a Base Currency Field from scratch specify the following: Currency Field which holds the original amount in foreign currency. Base Currency to transfer to (typically currency of your bookkeeping).
Date

With the Date Field type, users can enter a date or pick a date from a calendar popup. You can optionally define the following properties: Date format as full text or standard abbreviation. Whether you want to use the current date, or the current date plus or minus several days, as the default creation date for new records. Whether you want to use the current date, or the current date plus or minus several days, as the default update date for changed records.
Date/Time

With the Date/Time Field, users can enter a date and a time, or pick a date from a calendar popup. When the user selects a date from the calendar popup, mission.do enters that date and the current time into the Date/Time Field. When you create a date/time Field, you can specify whether you want to format the value as full text or as an abbreviation and whether you want the Field to be automatically populated in specified situations.
Time

With the Time Field type, users can enter the time (hours and minutes). This Field does not provide any type-specific settings.

How to mission.do - 36

Decimal

With the Decimal Field type, users can enter any number with decimals. You can optionally define the following properties: Number of decimal places to display to the right of the decimal point. Number to be used as the default value for new records. Minimum and maximum allowed values.
Email

With the Email Field type, users can enter an email address that is server-side validated to ensure it is in a valid email format. You can optionally define a maximum length for the email address.
Phone Number

With the Phone Number Field type, users can enter a phone number which will be automatically formatted according to specified input mask, like ###-###-#### If input text is longer that number of # symbols in format remaining characters are not formatted.
Password

With the Password Field type, users can enter and securely store passwords for authentication of Portal Visitors or for any other purpose, such as integration with third-party systems. You can optionally define the following properties: Minimum length (number of characters) password may have. Check if password must contain both letters and digits. Check if you want password to show actual value on View Pages and in Email Templates. If not, passwords actual value will be masked. However passwords value is always accessible through formulas and API.
Integer

With the Integer Field type, users can enter any number (without decimals). This Field offers the same settings (min value, max value, default value) as other numeric input Fields.
Percent

With the Percent Field type, users can enter a percentage (number including decimals) and a % sign is automatically added. You can optionally define a maximum number of decimal places.

How to mission.do - 37

Picklist

With the Picklist Field type, users can select a value from a list you define. Several other Field types (multi-select picklists, radio buttons and group of checkboxes) have a similar configuration. First, define a list of values, one value per line, for the picklist. Each value represents a selectable item. If you want a particular value to be selected by default for new records, prefix it with {D}. Optionally, at the end of each line, add an integration code for that value (no longer than 10 characters). Formulas and APIs can use this integration code to safely access unique picklist values (e.g., for data import and export). You can also choose whether to display values sorted alphabetically or in the order entered (default). In some situations you may want picklists belonging to different Objects to have the same set of values, so mission.do allows you to share picklists among Objects with the Shared As property. You can either choose Share as New or use one of the existing shared picklists in your account. In the latter case, the content of the Values box is replaced with existing values from the selected shared picklist.

Picklist (Multi-Select)

With the Picklist (Multi-Select) Field type, users can select any number of values from a list of values you define. You define Multi-select picklists in the same way as single-select picklists, with two additional optional capabilities: You can mark more than one value as a default value with the {D} prefix. You can choose a height (in rows) to determine the number of values visible at any given time. If more than one value is visible the user can use the CTRL key plus their mouse to select multiple items.

How to mission.do - 38

Radio Buttons

With the Radio Button Field type, users can select a single choice from a group of radio buttons. You define Radio Buttons in the same manner as picklists, with an additional layout setting: Alignment that determines whether to align the Radio Buttons vertically or horizontally.
Group of Checkboxes

With the Group of Checkboxes Field type, users can select any number of checkboxes in a group. You define in the same manner as Multi-Select Picklist Fields are defined with an additional layout setting: Alignment that determines whether to align the Group of Checkboxes vertically or horizontally.
URL

With the URL Field type, Users can enter any website address and the URL is displayed as an HTML link. The content of that link will be displayed in a new browser window.

How to mission.do - 39

Advanced Field Types


More advanced mission.do Field types are defined in the sections below.
Auto-Number

The Auto-Number Field type is an automatically generated sequential number or code that uses a display format you define. This number is incremented for each new record created. An Auto-number format may also include year, month and day. When you create an auto-number Field you can specify: A display format (mandatory) defined by a template. Syntax and examples are presented inline while creating the Field. A starting number (mandatory) for the sequence number portion. An option allowing you to assign auto-numbers to all existing Object records once this Field is created or updated.
File Upload

The File Upload Field type allows users to upload a file attachment that is stored in this Field. The file will be opened in a new browser window when clicked by the user. You can specify a maximum size for files, from 128KB up to 2MB. In addition, the Advanced Field Properties section allows you to Index this Field as part of the text search engine, which automatically indexes files uploaded into this Field.
Image Upload

The Image Upload Field type allows users to upload an image file attachment that is stored in this Field. You can specify a maximum size for images, from 128KB up to 2MB. The image will be displayed on any Page the Field is included in as an HTML <IMG> tag. When you define an Image Field, you select a maximum file size to accept. You can define optional parameters: Images display width in pixels. Images display height in pixels. Text to show when the mouse hovers over the image.

How to mission.do - 40

Shared Image

With the Field type Shared Image, you can upload an image to be shared as a merge Field in Pages, Templates and Formulas (including portal Pages). Shared images are also stored and distributed with published Applications. You configure this Field the same way as Image Upload Fields, except that you must upload an actual image file to be shared (128K max) in GIF, JPG, or PNG format.
Formula

A Formula Field type allows you to create a non-editable Field that is automatically populated from a formula expression defined by you. Formula Fields are automatically updated when any of the Fields used in the expression change value. Formula Field expressions are defined in JavaScript and executed on the server-side at run-time to compute a dynamic output that is either displayed on the screen, or used by other mission.do business logic components. Formulas can be simple or sophisticated, depending on your level of JavaScript familiarity. When you define a formula Field you select: The return type (either Decimal, Currency, Integer, String, Boolean, or Date). The currency format (for currency return type only). The number of decimal places (for Decimal return type only). An optional checkbox for hiding the display label for this Field on UI Pages. Most importantly, you define a JavaScript expression using merge Fields from the current Object record and related records, to return a dynamically computed value. This value does not need to be numeric; you can return any Strings as well. These Strings can range consist of plain text, rich HTML, or JavaScript code that will be executed on the clients browser. For more information about formulas, including an extensive set of examples, see Chapter 6. Server-side Code: Templates, Formulas and the mission.do Query API. There are several things to keep in mind when creating formulas: All merge Fields are replaced with the exact contents of the corresponding Fields value before the formula logic is executed. For example, a text Field with merge Field {!myTextField} with value Hello World will be used as is without the quotes around it. Always remember to use quotes around any value where you would normally need them in your JavaScript. When working with Dates in formulas, you must keep the following rules in mind: 1. To use a Date Field in a formula, you must create a JavaScript Date instance by providing the merge Field as a parameter such as:

How to mission.do - 41

1. 1. 2.

var myDate = new Date("{!myDateField}"); Be sure to include quotes around your date merge Field. If you select Date as the return type of a Formula, you must return the full value of the JavaScript getTime() method as follows:

1. return myDate.getTime(); When working with Images and Shared Images in formulas you must wrap them in quotes to avoid errors. For example, the following formula returns a different starred image (representing a star rating from 1 to 5) based on a Picklist value:

if ({!rating}==106469) return "{!star1}"; else if ({!rating}==106470) return "{!star2}"; else if ({!rating}==106471) return "{!star3}"; else if ({!rating}==106472) return "{!star4}"; else if ({!rating}==106473) return "{!star5}"; else return "{!star0}"; In this example {!star0} through {!star5} are Shared Images and {!rating} is a Picklist. Wherever you use a Shared Image, be sure to wrap it in quotes.
Roll Up Summary

A convenient way to build Formula field that that displays the sum, count, minimum, or maximum value of all records related to the current record. To create Roll-Up Summary Field you select: Related Object Numerical field in that object What to compute: Sum of selected field for all related records Count or related records with not-null selected field Minimum value of selected field for all related records Maximum value of selected field for all related records

How to mission.do - 42

Template

A Template Field type is a non-editable Field that is automatically populated from a template expression you define. When you define a template Field, you can use merge Fields and HTML markup from the current Object record and any related records.
Document Template

A Document Template Field type is a picklist that allows users to assign a document template to use for a specific Object record. You can assign a default value to this Field and have it assigned to all existing records. This Field renders a link to generate a document on the fly based on the selected document template using the records data. You can also use it in combination with a Create Template Document Trigger (see Chapter 10. Workflow and Triggers for more information on Triggers). When used as token in email templates, the Document Template Field will generate an email attachment with the file generated from the document template for the current record. In View mode Document Template presents a link. When clicked, this link opens parsed document template (populated with records data) in pop-up window. You can specify size of that window in pixels (650 x 600 by default). For HTML templates only you can choose to render them as PDF rather than HTML.
Email Template

The Email Template Field type is a picklist that allows users to assign an email template to use with a specific Object record, similar to Document Template Field type. You can assign a default value to this Field and have this default value assigned to all existing records. This Field renders a link to preview the email template using the records data. You can also use it in combination with a Send Email trigger and Send Email workflow action (see Chapter 10. Workflow and Triggers for more information on triggers and actions).
Related Field

The Related Field type enables access to the value of a Field from a related Object. Related Fields allow you to display and use Fields from related Objects. Before you can use a Field from another Object, you must establish an N-to-1 or 1-to-1 Relationship from the current Object to the related Object (Relationships are discussed later in this chapter). When creating a related Field, select the appropriate related Object and then select the desired Field as shown above. Related Fields are always read-only in Pages (i.e. related Fields cannot be editable in Pages of another Object definition).
How to mission.do - 43

Integration Link

An Integration Link Field type is a custom link, typically used to pass mission.do data to external systems, your intranet, or other web-based Applications by using merge Fields to insert the value of one or more Fields as parameters in the URL. Integration link Fields display as links and they open in a new browser window when clicked. Integration link Fields work similar to URL Fields, but they allow the use of merge Fields to dynamically construct a URL based on data in the current Object record, versus URL Fields which simply store a hard-coded URL. See Chapter 6. Server-side Code: Templates, Formulas and the mission.do Query API for more information about mission.do templates and formulas.
Dependent Picklist

The Dependent Picklist Field type is a special type of single-select picklist that displays different available values depending on the current selection in another (main) picklist. This main picklist must be selected before creating a dependent picklist. For each value of the main picklist, you can enter a comma-separated list of available values as shown above. A typical example of a dependent picklist is a list of States or Provinces that depends on the selection of a Country picklist. Once the selection in the Country picklist changes, mission.do will automatically update the available list of states.

How to mission.do - 44

Version Number

The Version number Field type specifically tracks record-level versions (versus auto-number Fields which are more useful for Object level versioning). Version number Fields assign an integer value to a record when it is created and you can configure them to increment that number whenever the record is updated or cloned.

How to mission.do - 45

Portal Field Types


The following Field types are typically only used in external-facing Portals. See Chapter 12. Portals for more information about Portals.
Captcha Image

The Captcha Image Field type requires that the user type letters and digits displayed in a distorted image to ensure that the user is in fact a human, rather than a computer. Form submission will not work if the entry is not correct. For example, the figure below shows how a Captcha Image might appear in a Portal Page. See Chapter 12. Portals for more information on Portals.

Hidden Input

The Hidden Input Field type allows you to capture any URL parameter, such as a campaign id or source, from the original URL the visitor used to reach your Portal. You also have an option to capture HTTP cookie instead of URL parameter.
IP Address

The IP Address Field type provides a convenient way to capture, store and resolve the IP address of Portal visitors. This Field is particularly useful in Portals that require authentication and allow self-registration (see Chapter 12 Portals for more information). This Field will also resolve to display the country code of the IP address, allowing you to receive real information about the source of each of your requests.

How to mission.do - 46

System Field Types


The sections below describe mission.do System Fields.
Comments

The iCal Field type is a text area which can be added to Status Change and other pages. Unlike regular text areas Comments field stores value in Comments table: every time new value is entered new comment record is created. Comments field can be used in templates and formulas. In this case its value is text of the last created comment.
iCal

The iCal Field type is a read-only Field, automatically generated when you select an Event or Task attribute. It will render a link that you can use to synchronize your event or task with Microsoft Outlook or other programs using export in iCal format. When used as token in email templates, the iCal Field will generate an email attachment with a file in iCal format.
vCard

The vCard Field type is a read-only Field, automatically generated when you select the Contact attribute. It will render a link that you can use to synchronize your contact with Microsoft Outlook or other programs using export in vCard format. When used as token in email templates, the vCard Field will generate email attachment with a file in vCard format.
Organization Data

Tree Fields of this type (Location, Department and Function) are automatically created when you select the Organization attribute for an Object. These Fields keep track on location of your record relative to LDF trees. See Chapter 11. Security and Access Control for more details about LDF permissions. If you check Use user's Function value as default for new records for this Field type, LDF attribute from user will be copied by default to newly created record.

How to mission.do - 47

LDF Filter

This Field type is used to visualize LDF permissions for a particular record and user.

How to mission.do - 48

Advanced Field Properties


In addition to basic Field properties that vary based on the type of the Field, mission.do provides several advanced Field properties that determine various Field characteristics. Not all of these properties are available for all Field types; for example, Image Upload and Formula Fields cannot be indexed as part of the full text search engine. Index this Field as part of the text search engine. This setting is available on text, numeric and date Fields, as well as on file uploads. By enabling this property, this Field will be indexed and added to the global search engine whenever a record is created and updated. Users will then be able to perform global and Object-specific searches on this Field (Field-specific searches in filters, etc, do not require this property to be enabled). Track all changes to this Field in each record's Audit Trail for a complete historical log. See Chapter 8. Additional Application Tools for more info on auditing. Enabling this property automatically adds a record-level audit trail entry whenever the Field is updated, showing the value of the Field before and after the update, as well as the user that performed the update and the date and time the update occurred. Store values in an encrypted format. This setting is available on text Fields (passwords are always encrypted). Values are stored encrypted in the database for added security and to meet compliance requirements. This Field is required in all forms. This is a global setting specifying whether this Field is always required in form Pages (such as New and Edit). If this property is enabled, it is not possible to make this Field non-required at the Page level using the Page Editor. This Field can be used in filter expressions. If checked (usually the case), this Field can participate in filtering of views and reports. This Field can be used as a column in views and reports. If checked (usually the case), this Field can be used as a column in views and reports. This Field can be used as a merge Field in templates and formulas. If checked (usually the case), this Fields integration name can be used as a merge Field in templates and formulas. Do not allow duplicate values in this Field. This setting is available only for text-based (including auto-number) Fields. If set, it enforces uniqueness of this Fields value across all records of that Object type.

How to mission.do - 49

Integration Name

Each Field has a unique Integration Name that is used to reference the Field via merge Fields, in formulas and templates and through the mission.do APIs. This name must be unique across all Fields in the Object definition. When you create a new Field, mission.do automatically assigns an Integration Name derived from that Fields display label; you can rename it at any time. A Fields Integration Name must conform to certain restrictions: Cannot be more than 20 characters long. Must start with a letter. Cannot include space or pound sing # characters. Must be unique (case-insensitive) across other Field integration names in the same Object. Must not be one of the reserved system integration names listed below:

start date, due date, act, id, id2, ids, srcid, destid, objdefid, cloneid, returned, view, actionid, relid, relatedid, gridid, gridrows, griddeleted, country, state, priority, commtype, category, isactive, Fieldname, tag You can change the Integration Name of any Field you have created. However, integration names for System and automatically created Fields cannot be changed.
Field-Level Help

Field-level help allows you to enable popup-style help for any of your Fields. You can enable this behavior on an Application-specific basis as follows: On the Application Edit screen, set the Enable Field-level help for this Application property (see the Application section below for more information about editing Applications). Enter help text in the Field-Level Help box. On your Objects Pages you will see small ? icon next to the Field. Click this icon to display the help text.

How to mission.do - 50

Adding Fields to Pages, Views and Reports


Any time you create a new Field, mission.do asks which Pages and Views on which to add the Field. You can add or remove Fields from any of your Objects Pages by using the Page Editor to edit each Page. You can also create Fields from within the Page Editor. See Chapter 4. Pages, the Page Editor and Grid Control for details about editing Pages with the Page Editor. You can also edit Views and Reports to add, move, or remove Fields. See Chapter 3. Views and Search for details about Views and Reports.
Important Limitations: Number of Fields per Object

Keep in mind that there is a limit to the total number of Fields you can add to any given Object. The total number of Fields (including those created automatically for you via Object attributes and those created manually) for any given Object definition cannot exceed 500, with the following limitations: Maximum of 200 string Fields (includes text, email, time, URL and auto-number Fields, excluding encrypted Fields). Maximum of 150 integer Fields (includes checkboxes, lookup Fields and single-select picklists). Maximum of 50 decimal Fields (includes currency, decimal and percent Fields). Maximum of 50 large text Fields (includes text areas, file uploads, image uploads, multi- selection picklists, radio buttons, group of checkboxes and encrypted text Fields). Maximum of 50 date and date/time Fields

Calculated Fields (formulas, templates, related Fields and shared images) are excluded from these limits. You cannot bypass these limitations. If you reach any of these limitations, we recommend revisiting your Applicationss design. For example, when building an Object to represent a Time sheet, you may initially consider creating Fields for each day of the month. Instead, consider creating a related Object for Time sheet Line Items that can be used to store data for each day of the month.

How to mission.do - 51

Field Actions
When viewing the list of Fields on an Object definition you can see several links in the Action column. Each Field exposes an Edit link that allows you to make changes to that Fields definition. Other actions are discussed in this section.
Clone: Cloning Fields

You can clone any Field except System-level Fields (such as ID) and other Fields created automatically by the system. When cloning a Field, mission.do gives you the option of adding the cloned Field to a different Object definition.
Del: Deleting Fields

You can delete any Field except for system-level Fields (such as ID) and other Fields created automatically by the system. NOTE: Fields created by Object attributes and relationships will be deleted automatically if the attribute is removed or the relationship is deleted. When you confirm that a Field should be deleted, the system will: Delete the Field definition from the Object definition. Delete all of that Fields data for all existing records. Remove the Field from all Pages, views and reports. The system will not modify your formulas, templates, integration links and API calls containing a reference to the deleted Field. It is your responsibility as the Application developer to ensure a deleted Field is no longer used.
Replace: Replace a Picklist Value

If you need to change the value of a picklist, you should not directly edit that value by editing the picklist Field because mission.do assumes that you want to delete the old value and create a new one (not necessarily in the old ones place). In this case, values assigned to existing records will be lost if they used the old value. In order to preserve these assigned values you need to use the Replace action, rather than editing the picklist Field. Select the value to replace and enter the new value. This will replace the old value in all existing records with the new value you define.

How to mission.do - 52

Convert: Converting Fields

In the course of Application development, you may want to change the type of a Field you have already created. Some Fields do allow you to change the Field type at any point in the future, as listed below: Text Fields can be converted into Email, Picklist, Radio Buttons, Text Area, or URL Fields. Currency Fields can be converted to Decimal or Integer Fields. Date Fields can be converted to Date/Time Fields. Date/Time Fields can be converted to Date Fields. Decimal Fields can be converted to Currency, Percent, Integer, or Text Fields. Email Fields can be converted to Text or Text Area Fields. Integer Fields can be converted to Currency, Decimal, Percent, or Text Fields. Percent Fields can be converted to Decimal, Integer, or Text Fields. Picklist Fields can be converted into Multi-Select Picklist, Radio Buttons, or Group of Checkboxes Fields. Multi-select Picklist Fields can be converted into Group of Checkboxes Fields. Radio Buttons Fields can be converted into Picklist, Multi-Select Picklist, or Group of Checkboxes Fields. Group of Checkboxes Fields can be converted into Multi-Select Picklist Fields. URL Fields can be converted to Text Area or Text Fields. Auto-Number Fields can be converted to Text Area or Text Fields.

When a text Field is converted into a Picklist or Radio Buttons Field, mission.do will: Analyze the value of the text Field for each record of that Object type. Create values for all unique values found in the text Field. Replace original text values with pointers to the newly created values.

How to mission.do - 53

Advanced Field Topics


Permissions: Field-Level Permissions

You can restrict access to a particular Field to certain user roles by hiding it completely (uncheck the View box) or disallow editing of the Fields value (check the Read Only box). If set, these restrictions will be applied on top of all other mission.do permissions described in Chapter 11. Security and Access Control.
Validation: Field-level Validation

On most Field types you can define your own server-side validation logic by writing custom JavaScript that makes use of record-level Field values, as well as related Field values, to return a custom error messages if your required conditions are not met. To define custom validation, enter your JavaScript expression in the text area. After your users submit data to the server, this expression will be evaluated. If that evaluation yields a string value, that value will be considered an error message and the user will be returned back to the data entry Page with the error message displayed (all form data will be preserved). For example, the following validation ensures that the value of an amount charged Field is no more than 100 less than the value of a total due Field: if ({!total_due}>{!amount_charged}+100) { return "The amount charged is too small. Please make sure the amount charged is no more than 100 less than the total due."; } In some situations when a record is edited, you may want to access the value of a Field before it was updated by the user, as well as the value after it was updated. To do this, use the #before suffix in the merge Field. For example: if ({!balance#before}-{!balance}<100) { return "The balance change is too large. Please make sure the new balance is no more than 100 less than the initial balance."; } When the user is saving data (for new or existing record) and fields validation formula is evaluated into error message the saving process cannot continue: the user is redirected back to new/edit page and red error message is displayed. This behavior changes if you select an option "Treat this Validation Rule as a Warning. In this

How to mission.do - 54

case at runtime the user can check Ignore Warning box and proceed with saving despite of the warning.

Events: Field-level JavaScript Event Handlers

Field-level events allow you to define custom JavaScript code that executes when a DOM event is invoked. You can attach JavaScript to any of the following DOM events for a Field: onchange, onclick, onfocus, onblur, onmousedown, onmouseup, onmouseover and onmouseout. By calling JavaScript functions defined in your Pages or in hosted JavaScript code libraries, you can use Field-level events to create a variety of dynamic Page behavior. In addition, you can use the mission.do AJAX API to add a further level of dynamism to your Pages. For more information about client-side scripting in mission.do, see Chapter 7. Client-side Code: HTML Event-Handling and the mission.do AJAX API.

How to mission.do - 55

Relationships
In order to build sophisticated business Applications, you will need a way to establish relationships between Objects. For example, in Grants an Organization object would have a relationship with Requests, Contacts, Grant Cycles, etc. mission.do allows you to create any number of relationships between any Objects, including multiple many-to-many and hierarchical relationships.
Adding New Relationships

The Object Details screen contains a section called Relationships, under the Fields section. To add a relationship, click the "New Relationship" link to display a list of Object definitions. Choose the Object with which you wish to establish a relationship. Do not worry about creating multiple relationships among the same Objects; mission.do will handle this for you. You can also create a relationship between an Object and itself; this is referred to as a hierarchical relationship . When defining a new relationship, you must define relationship properties, cardinality, orphan records control and cloning control settings. Relationship properties require you to assign singular and plural names for each side of the relationship, as well as a unique integration name. For example, if you are creating a relationship between Quote and User Objects, you might use Owner and Owners to represent the user side of the relationship. Relationship cardinality determines whether records of each type can have one or more than one related record. You can select 1-1, 1-many, many-1, or many-many.

Orphan Record Control

Orphan records control allows you to specify whether or not related records get deleted when the parent record is deleted. For example, if a user deletes a Quote, we may also want to delete all of the related Quote Line Item records. But the opposite case is not true; if a user deletes a Quote Line Item, we do not want to delete the related Quote record. mission.do allows you to

How to mission.do - 56

control this kind of behavior for each relationship.

Cloning Control

Cloning control allows you to specify whether or not related records get cloned when the parent record is cloned. For example, if a user clones a Request, we might also want to clone all of the related Applicant records. But the opposite case is not true; if a user clones an Applicant Record, we do not want to clone the related Request record. mission.do allows you to control this kind of behavior for each relationship.

How to mission.do - 57

Lookup Fields
When creating a new relationship mission.do will also create: Lookup Fields for each Object and add them to selected Pages. Related View components for each Object and add them to selected Pages. Grid Control components in user-selected Pages. Lookup Fields are used to select one or more related Object records when editing or creating a new record. Fields of this type cannot be created manually; Lookup Fields are created automatically when a relationship is created.
Page Level Lookup Fields Properties

By default, Lookup Fields allow users to pick one or more records by displaying a Selector Page in a popup window. However, often times it is faster and more convenient to allow users to select records using a picklist or multi-select picklist. mission.do allows you to change whether a Lookup Field displays as a popup selector or a picklist/multi-select picklist, via a Page level property.

To change this setting for any Lookup Field on any given Page, follow these steps: Edit the Page with the Page Editor. Locate and select the Lookup Field. In the Properties box, choose one of the following: 1) Selector as the Fields style if you

How to mission.do - 58

want users to select records from a popup dialog, 2) Picklist if you want the lookup Field to act like a picklist (for 1-1 and N-1 relationships), 3) a multi-select picklist (for 1-N and N-N relationships), or 4) Hidden for non-editable relationships (such as a relationship between Invoice and Invoice Line Item). You can also select the Default List View to be used for this popup selector when users use this Lookup Field. This allows you to choose which sorting and filtering of related records are available to your users when they are selecting related records. Check the Use Record in Scope for New Object property if you want lookups to be pre-populated for new records (this is the only option to populate hidden lookups). See Chapter 4. Pages, the Page Editor and Grid Control for more information on using the Page Editor.

Global Lookup Field Properties

In addition to Page-level settings defined in the Page Editor, there are a number of global settings available for Lookup Fields when editing the Field: Hide Quick Create button for this Field: Check this box if you want to hide the button used to create and select a new related record rather than choosing an existing one. Main Lookup and Link Lookup: Use this setting to restrict the available choices for related records based on the current selection in another lookup Field (referred to as the Main Lookup). Consider an example: A Quote Object has relationships with Customer and Lead Objects and the

How to mission.do - 59

Customer Object has a relationship with the Lead Object as well. While creating or editing a Quote record, you need to make sure that only leads related to the selected customer record can be selected. In this example, you would choose the QuoteCustomer relationship as the Main Lookup and the CustomerLead relationship as the Link Lookup. Autocomplete Field: Select the Field to be used to find matches when users start typing in the lookup Field. After typing 3 characters mission.do starts displaying matches automatically for the user to select as desired. Autocomplete Rule: You can select Starts With or Contains to change the matching behavior of the autocomplete feature. Default Value: You can optionally select a record to be selected in this Field by default when users create new records.

How to mission.do - 60

Related View
Related Views are used to display a list of related records for Objects with 1-many or many-many relationships. For example, if you have an Organization Object with a 1-many relationship with a Request Object, your Organization View Page can contain a Related View component to view these requests. Related View components must be placed in their own dedicated sections in Pages. The Page Editor enforces this rule. You can use the Page Editor to define whether or not you want to hide or show controls of the related view such as the Quick Create and New links. You can also use the Page Editor to define what View should be shown by default. For more information about configuring related views in Pages using the Page Editor, see Chapter 4. Pages, the Page Editor and Grid Control.

Related Views are only shown on View Pages for specific records and automatically filter the data displayed to only show those records that are related to the current record being viewed. For more information on creating and configuring Views, see Chapter 3. Views and Search.

How to mission.do - 61

Tabs and Menus


Tabs and Menus provide the core navigational components of mission.do Applications. Tabs are parent-level navigation controls and Menus can be created and organized hierarchically within Tabs.
Tabs

Tabs are the clickable section headers below the Application header bar in any mission.do Application. The only difference between Tabs and Menus is that Tabs are top-level and Menus are beneath them. (Technically speaking, Tabs are really just top-level Menus in mission.do). There are three different types of Tabs in mission.do: Generic: Generic tabs contain Pages with arbitrary Views, Charts and HTML or Script components. This type of tab is typically used when you want to create a tab to point to a Page that contains some custom content or 3rd party widgets. Object: Object Tabs are the most common types of Tabs and point to list view Pages associated with a particular Object definition. Web: Web Tabs contain an embedded website, allowing you to embed other sites or web-based Applications into your mission.do Applications. Tabs point to a specific Page which is either a Generic Page (in the case of Generic Tabs), a List Page (in the case of Object Tabs), or an embedded website (in the case of Web Tabs). When you create a new Object definition, mission.do creates a new Object Tab that points to that new Objects List View Page, by default. You can also create your own custom Tabs manually. To create a new Tab, either click the + Tab from within any Application, or go to the Setup Tab, click on Applications Setup and then click on Tabs. You will be taken to a list of all Tabs in your account, where you can customize them or click New Tab to start the process of creating a new Tab. When you click the Tab described in Section 2 and select A new Tab to start the Tab creation process. When defining a new Tab, you first give it a name and an option to select a parent Tab. By default, new Tabs will become top-level Tabs, shown in the row of Tabs in any Application to which they are added. However, if you choose to add the new Tabs as a child of an existing Tab it will become a menu within that Tab. Next, select the Tab type. Based on the type selected, mission.do presents different configuration options.

How to mission.do - 62

When creating a Web Tab, you can input a URL that incorporates merge Fields from the current user, current company, or other data. The resulting URL will open inside mission.do when the Tab is clicked. The Frame Height parameter allows you to specify the height for the internal frame used to display the website within mission.do. You can use the Preview Link feature to test the web Tab URL before saving your new Tab. When defining an Object Tab, select the Object to which this tab is will be related. Once the Tab is created, a new List View Page is created in that Object definition and this new Tab will point to it. When defining a Generic Tab, there are no extra options to select. A new blank Page is created and this new Tab will point to it. You can then use the Page Editor to edit this Page as needed. When creating a Tab, mission.do presents a list of Applications to which to add the Tab. If you initiated Tab creation from within an existing Application, that Application will be selected for you by default. You can also choose to add this Tab to any other Applications at this point.

Administrators often see a selector icon inside the selected Tab that provides quick access to Setup features when clicked.

How to mission.do - 63

Click on the Tab Properties link to view the Tabs configuration information. Alternatively, you can view and edit Tab properties by going to Setup > Application Settings > Tabs. From here you can see the Page to which this Tab points and you can edit it directly using the Page Editor. You can also see the Tab type, the Object this Tab is associated with (if any) and which Applications are currently using that Tab. Click the Edit button to edit the Tabs configuration information, such as Tab name, parent, description and permissions. The Menus section lists all of the Menus underneath this Tab. You can add and edit Menus here. You can also change the order of Menu appearance within this Tab by clicking the Reorder link. Each Menu that points to an editable Page will have a link that allows you to edit the Page directly with the Page Editor.

Menus

Below the row of Tabs in each Application, several links are displayed. These are the Menus associated with the selected Tab. Each Tab can have an arbitrary number of Menus. Menus are links to specific Pages in your Application. For example, in a Tab called Contacts, the New Contact Menu points to the New Page for the Contact Object. Object Tabs come with four Menus by default. New XX: Link to the New Page for the associated Object (where XX is the singular name of the Object). Import: Link to the Import Wizard that allows you to import data from a spreadsheet; each row becomes a new Object record. Templates: Link to the Templates Page, where you can define email and document templates associated with this Object for sending customized individual emails or mass emails and generating customized documents on the fly incorporating Object record data (i.e. mail merge). To create, edit or change the order of Menus in any Tab, go to the Tab details Page in Setup and scroll down to the Menus section. You can create new Menus within Tabs or other existing Menus. Creating a Menu is the same as

How to mission.do - 64

creating a Tab. As mentioned earlier, Tabs are really just top-level Menus. Clicking New Menu allow you to create new Menu using identical options to those when creating a Tab (see Section 4.1 Tabs above).

How to mission.do - 65

Portals
Portals provide a flexible way to build and expose external-facing Applications in public websites or intranets for external users, such as website visitors, partners, or employees on an intranet. With Mission Control, you can create Portals to allow just about any type of external user to access specific Application functionality such as creating, editing, searching and viewing Object records and much more. Portals are in fact very similar to websites you are familiar with, in that they consist of an arbitrary number of Pages that are linked together to form a cohesive site. You can create and edit portal Pages using the Mission Control Page Editor, just like Object Pages. Portals are typically built to work in conjunction with Mission Control Applications. For example, a Mission Control Application for managing grant would have a portal integrated with your website to collect requests submitted by Grant Applicants. Portals are a powerful component of Mission Control Applications and can be used to define entirely new web-based Applications designed for public consumption. For more information on designing and developing portals, see Chapter 12. Portals.

How to mission.do - 66

The mission.do Calendar


Your mission.do account comes with a special Tab called Calendar, embedded in your default mission.do Application. This Tab contains a Calendar control that allows you to browse and interact with any mission.do task and event data in your system.
Using the Calendar

The Calendar allows you to browse all Object records with the Event or Task attribute in three different view modes: Day, Week and Month. You can filter any calendar view by Object type and by records assigned to just you, or all users (any records marked as private that are not assigned to you will not appear in your calendar).

Day and Week Views

The Day and Week views show separate sections for Tasks and Events. The Events section is broken down by hour. The Week view displays columns for each day of the week. To hide the weekend days, uncheck the Show Weekends checkbox. Clicking on a record in Day or Week mode displays more information about that Task or Event in a popup window.

How to mission.do - 67

Clicking on any task slot or hourly time slot in Day or Week mode displays a popup allowing quick creation of a new record.

Month View

The Month view shows all days in the month and lists all tasks and events in chronological order. Clicking on a record takes you to that records View Page. Clicking on a day displays a popup allowing quick creation of a new record.

How to mission.do - 68

Calendar Notications

Event objects may include trigger-based notification which sends email prior to event start (see Chapter 10 for details). Also while working with mission.do pages the user will receive pop-up notifications when event assigned to a user is about to start. Timing for that notification is determined by Pop-up Reminder field on Event record. Pop-up is displayed only once.

How to mission.do - 69

Chapter 3: Views and Searches

How to mission.do - 70

Chapter Overview
This chapter introduces mission.do Views and Search functionality. Views are the key component of mission.do Object definitions that allow you to View and navigate through a group of records. This chapter discusses how Views are created and configured and digs into the details regarding ways to define grouping, sorting, totaling and filtering behaviors (including dynamic filtering, expressions and exporting). It then shows how Views are used in Generic, Object and record View Pages to display related records. This chapter also discusses using dynamic filtering of Views as a way of performing a detailed Search and narrowing the current set of records shown by Search results. This chapter also explores Global text Search, with its powerful syntax capabilities and Object-specific Search that allows users to perform more detailed Searches for records of a specific Object type. Finally, this chapter covers some other critical details: Group operations (compare, merge and convert); mass update,; Template-based emails; full-text search using the Lucene engine; search by distance (US ZIP codes); quick create and Tags,.

How to mission.do - 71

Views
Views are the component of Object definitions that allow you to define lists of records. Views essentially display a list of Object records that you can navigate, sort and perform other actions upon individually or in bulk. Each Object definition can have an arbitrary number of associated Views and users can switch to any other available View as needed. Views consist of columns that correspond to Object fields. Most columns are sortable. Normally the record name field is included as a column, so users can click on each record as desired to be taken to that records View Page. Above is an example of a typical View. The left-most column contains a checkbox for each row that allows you to select multiple records on which to perform an action such as Editing, Deleting, or Tagging. Note that your selections will be maintained as you navigate from Page to Page in your View. The View will keep track of this by displaying this information in real-time as you select records.

The upper portion of the View is the View header. The top row of the View header shows the View Name (e.g., All Organizations), a link for creating a new record, and a way to quickly create a record without leaving the current Page (Quick Create). The Quick Create option opens a popup that allows you to quickly add new records without leaving the View. You can edit the Quick Create Page to change what fields appear in the popup using the Page Editor (see Chapter 4. Pages, the Page Editor and Grid Control for details). The second row of the View header consists of features that relate to managing the current View: A View picklist that allows you to select a different View to load, providing an alternative View into the list of Object records. An Edit View link that provides a quick way to make changes to this Views settings such

How to mission.do - 72

as name, columns, sorting, grouping and filtering. A New View link that provides a quick way to create a brand new View. A Clone link that provides a quick way to create a copy of the currently selected View. A Delete link that provides a quick way to delete the currently selected View (there must always be at least one View, so you cannot delete a View if it is the only one). A Filter link that provides a quick way to dynamically filter the currently selected View without making changes to the saved View itself. A Subscribe: RSS link, if you have enabled RSS feeds for the Object. This allows you to subscribe to the selected View via RSS. See Chapter 15. Integration and mission.do APIs: SOAP, REST and RSS for more details on RSS feeds. Export options for XLS, CSV and Google. XLS exports the entire View to Excel (XLS) format. CSV exports the entire View to a comma-separated value flat file (CSV). The Google option opens the currently selected View in a Google Docs spreadsheet.

The bottom portion of the View header consists of features that relate to managing selected records in that View: A Tag button that allows you to add keywords to selected records so you can easily find them in the future. Once a record is tagged with a keyword, it appears in the search results when you perform a search for that keyword. A Delete button that allows you to move all of the currently selected records to the Recycle Bin. Administrator users can recover records from the Recycle Bin if they are deleted by mistake.

A More Actions picklist that presents many other features available for group operations. The items in this picklist vary depending on the configuration of your Object definition. Any workflow actions marked as a Group Action appear here, allowing you to invoke that action on all selected records (see Chapter 10. Workflow and Triggers for more on Workflow Actions). Similarly, all Mass Update Pages will appear here (see Chapter 4. Pages, the Page Editor and Grid Control for more on Pages).

How to mission.do - 73

A Select picklist providing a way to manage your current set of selections on the current Page of the View as well as across all Pages.

Next, below the View header, the View shows information on the total number of records in the View, the current number of records selected (if any) and navigation links for moving from Page to Page in the View.

Below this information, the View shows column headers and then the data itself. You can dynamically sort the records by any column that is based on the basic field types by clicking the column header.

How to mission.do - 74

How to mission.do - 75

Creating and Editing Views


Administrators can create and edit Views to show any desired record information. The first step is to give the View a name. You can optionally choose to hide the View from the View picklist by checking the box below the name field.

Columns

The next step is to define which Fields should appear as columns in your View. Use the checkbox labeled Show Actions column in this View to specify whether or not you want users whom can access this View to see the standard Actions column that provides links to Edit and Delete records. For example, you may want to hide this column in Views exposed in external Portals. When you create a new View, Record Name Field is added by default to Selected Columns.

How to mission.do - 76

Grouping and Sorting

Once you have chosen columns, you can specify grouping and sorting behavior. Second sorting criteria will apply when two records have the same column selected for first sorting. You can sort by up to three columns. You can also select direction of grouping and sorting: ascending or descending. Optionally you can disable sorting in a view by clicking on the link atop of columns.

Totaling

You can total on up to three columns. Totaling is only available if you have selected at least one numerical field to use as a column in your View, providing three different math options for each specified column: total, average and count. When totaling is enabled on one or more columns, two extra rows become available at the bottom of the View displaying the following Fields: Calculated amount for the set of records shown on the current group (if grouping is enabled). Calculated amount for the set of records shown on the current Page. Sum of amounts for all records in this View on all Pages (grand total). This sum is not available for formula fields. You can turn off any of these three ways of totaling for the View you are editing.

How to mission.do - 77

Filtering by Date Intervals

You can easily filter records used in Views, Reports, and Charts by interval of dates. From drop-down list select Date or Date/Time field which exists in your object. From second drop-down select interval relative to current date: current year, next quarter, current week etc. That will create filter for View etc. output which will be applied before any other filter you may create.

Filter Criteria

When defining Views, you can design detailed filter criteria that provides a way to narrow in on specific data you are interested in seeing in that View. This filtering mechanism is the same as is used by Object-specific search and Reports to determine which records are shown in the output. The filter mechanism allows you to design up to five filters by selecting a field, an operator and a value. You can use several different operators, depending on the selected field type. They are: equals, not equal to, less than, greater than, less or equal, greater or equal, starts with, contains, does not contain, is one of, is not one of, is empty and is not empty. To filter by date columns you can use special tokens derived from current date.

How to mission.do - 78

You can add/subtract integer number from token to shift on number of periods. Examples: To filter by current week (from Sunday to Saturday) use conditions: date>=WEEK AND date<WEEK+1 To filter by previous month use conditions: date>=MONTH-1 AND date<MONTH To filter by previous and current year use conditions: date>=YEAR-1 AND date<YEAR+1

In addition, some fields, such as Dates and User lookups, have special tokens that can be used in filters: For Text fields, you can create "or" filters by using the "is one of" operator and separating multiple values with "," (commas). For example Sales, Marketing would look for either Sales or Marketing. For Date or Date/Time fields, use TODAY to represent the current date. For example, TODAY - 7 means seven days ago and TODAY + 7 means 7 days from today. For Date or Date/Time fields, use tokens YEAR, QUARTER, MONTH and WEEK to refer to the current year, quarter, month and week respectively. For User Lookup fields, use CURRENT_USER to represent the current user.

The filter conditions parameter allows you to control how each of the filters are used to determine the output of the View: All (AND): Selecting this condition means that all filter conditions must be met in order for a record to display in this View. Any (OR): Selecting this condition means that at least one of the filter conditions must be met in order for a record to display in this View, but it doesnt matter which one. Expression: If the above conditions are not flexible enough, you can select Expression to define your own conditions. Formula: the most flexible way to filter records using any combination of data columns and special functions. Filter expressions allow you to specify how filters should be evaluated together to determine whether or not a record should be shown in the View. To define an expression, use the numerical value of the filters (1 through 5) along with AND, OR, and NOT keywords and parenthesis ( ) to group sub-expressions together. Always make sure that you have an equal number of open ( and closed parenthesis ). Examples: (1 OR 2) AND 3 Only show records that match filter 3 and at least one of 1 or 2 (1 AND 2) OR NOT 3 Only show records that either match both 1 and 2, or do not match 3. (1 AND 2) OR (3 AND 4) Only show records that match both 1 and 2, or both 3 and 4. (1 AND (2 OR 3)) OR NOT 4 Only show records that do not match 4 or those that match 1 and either 2 or 3.
How to mission.do - 79

Filtering by Formula

Although expression which includes several filters offers a great flexibility it does not cover all possible filtering scenarios. For that mission.do offers filtering by Formula which may include any data columns, operands (including LIKE, IN, AND, OR, NOT) and special functions: #YEAR(date) returns dates year as integer #MONTH(date) returns dates month as integer in range 1 - 12 #DAY(date) returns dates day of month as integer #IF(expr, val1, val2) returns val1 if expr is evaluated to true, val2 otherwise.

Formula may include tokens derived from current date as explained above. For instance to filter by d_o_b date column with month equals to the current month use formula: #MONTH(d_o_b)=#MONTH(TODAY)

Dynamic Filtering

In the View header, clicking the Filter link opens up the View filter conditions options within the View header itself. This allows you to temporarily modify the filter conditions of your selected View without changing the saved version. Use the Refresh View button to reload the View once you have made changes and the Clear Filters button to go back to the default filter conditions of the saved View.
Inline Editing

Records in View can be edited inline just like fields on View Record pages. Click the pencil icon while mouse is hovering over particular column in view. Than enter new value and click Save button.

How to mission.do - 80

Tagging

A tag is a label used to describe one or more records. You can affix Tags to records by using the Tag button in the View header, or by using the Tag button in a records View Page. Once records are tagged with keywords, they will show up as matches for searches on any of those keywords. In addition, when you View a record with Tags, you will be able to see all the Tags affixed to that record, along with how many different users tagged that record with the same keywords. Clicking on a Tag automatically performs a global text search for that keyword and displays the search results.

Click the Send Email option in the More actions picklist in the View header to send an email to all of the selected records. This option is only available for Objects with the Contact attribute. The Send Email Page allows you to select a predefined email template (e.g., you can select an email template associated with the Object definition). The Reply To Field allows you to select the sender: either the current users email address, or the Default Email Sender address specified in Setup > Administration Settings > Account Settings. The Send To Field allows you to specify the recipients email address. The default selection is Records address, which uses the email address Field in the Contact attribute. To change this behavior, select Specified address to specify one or more recipient email addresses (using merge Fields such as {!email} {!#CREATED_BY.email}), as well as CC and BCC options. You can manually type in addresses in the To, CC and BCC Fields if you select the Specified address option. The top of the Page shows a list of recipients that can be used to verify that your selection is correct. Links at the bottom of the Page allow you to add up to three email attachments.

How to mission.do - 81

When sending emails to a group of recipients you can check Do not send duplicate emails to the same address option. This may be useful if youre sending a large number of emails which may have duplicate to addresses.
Compare

Click the Compare option in the More actions picklist in the View header o View each selected record side by side for comparison purposes. This is useful prior to merging duplicate records.

Merge

Click the Merge option in the More actions picklist in the View header to merge two or more records into one resulting record. The merge Page allows you to select which Field value from each selected record to use in the resulting single record.
Convert

Click the Convert option in the More actions picklist in the View header to convert all of the selected records into new records of a different Object type. Select a target Object type to display the Conversion Map Page, where you can map values from the selected records Fields to Fields of the new Object type. You can save these Conversion Maps for future use. When defining a conversion map, you can choose whether or not to delete the source record after the conversion takes place. See Chapter 8. Additional Application Tools for more on Conversion Maps and where they can be used.

How to mission.do - 82

Transfer

Click the Transfer Owners option in the More actions picklist in the View header to quickly change the ownership of the selected records from one user to another. This option is only available if the Object definition has at least one relationship with the User Object.

Mass Update

Click the Mass Update option in the More actions picklist in the View header to update all of the selected records at once. By default, this Page contains no Fields. Click Edit this Page to add Fields to your Mass Update Page. By default, Fields will not be modified unless you enter data into them. You can create as many Mass Update Pages as you need for each Object definition. Each Mass Update Page will appear as an option in the More actions picklist on the View. See Chapter 4. Pages, the Page Editor and Grid Control for more on Mass Update Pages
Group Actions

If you have any Workflow Actions in your Object definition marked as Group Actions, each of these workflow actions appears as an option in the More actions picklist on the View. This allows you to invoke an action on all of the selected records at once. See Chapter 10. Workflow and Triggers for more on Workflow Actions

How to mission.do - 83

Search
Global Text Search

You can quickly search for structured data (Object records) and unstructured data (file attachments) throughout your entire mission.do account by typing keywords into the search box shown on the top of every mission.do Page. You can optionally select a specific Object definition to narrow your search to records of that type. mission.do knows what Object Fields to search because each Field of every Object definition contains a property specifying whether or not to Index this Field as part of the text search engine. If none of object fields has "Text Index" attribute, such object cannot participate in text search. In this case: Text Index Enabled box on Object View page is unchecked Object is not listed in global search drop-down list (see above) Search box is not displayed in Selector windows Keywords box is not displayed on Search pages

Search Syntax

The simplest way to search for data is to type a single term into the search box. Search queries in mission.do are broken up into terms and operators. There are two types of terms: Single Terms and Phrases. A Single Term is a single word, such as "Sales" or "Marketing." A Phrase is a group of words surrounded by double quotes, such as "Human Resources". mission.do supports advanced search syntax, such as wildcard and fuzzy searches and the ability to combine multiple terms together with Boolean operators to form more complex queries.

How to mission.do - 84

Wildcard Searches

mission.do supports single and multiple character wildcard searches. To perform a single character wildcard search, use the "?" symbol. To perform a multiple character wildcard search, use the "*" symbol. The single character wildcard search looks for terms that match those with the single character replaced. For example, to search for text or test you can use the search: te?t Multiple character wildcard searches look for 0 or more characters. For example, to search for test, tests or tester, you can use the search: test* You can also use the wildcard searches in the middle of a term. te*t
Boolean Operators

Boolean operators allow you to combine search terms through logic operators. mission.do supports AND, "+", OR, NOT and "-" as Boolean operators (Note: Boolean operators must be ALL CAPS). OR The OR operator is the default conjunction operator. This means that if there is no Boolean operator between two terms, the OR operator is used. The OR operator links two terms and finds a matching record if either of the terms exists in one of that records Fields or file attachments. This is equivalent to a union using sets. The symbol || can be used in place of the word OR. For example, to search for records that contain either "Human Resources" or just "Human" use the query: "Human Resources" Human or: "Human Resources" OR Human AND The AND operator matches records where both terms exist somewhere in one or more of the records Fields or file attachments. This is equivalent to an intersection using sets. The symbol && can be used in place of the word AND. For example, to search for documents that contain "Human Resources" and "Sales" use the query: "Human Resources" AND "Sales" +
How to mission.do - 85

The "+" or required operator requires that the term after the "+" symbol exist somewhere in a Field of a single record or in one of its file attachments. For example, to search for records that must contain "Human" and may contain "Resources" use the query: +Human Resources NOT The NOT operator excludes records with Fields or file attachments that contain the term after NOT. This is equivalent to a difference using sets. The symbol ! can be used in place of the word NOT. For example, to search for records that contain "Human Resources" but not "Sales" use the query: "Human Resources" NOT "Sales" Note: The NOT operator cannot be used with just one term. For example, the following search will return no results: NOT "Sales" The "-" or prohibit operator excludes records with Fields or file attachments that contain the term after the "-" symbol. For example, to search for records that contain "Human Resources" but not "Sales" use the query: "Human Resources" -"Sales"
Fuzzy Searches

mission.do supports fuzzy searches based on the Levenshtein Distance, or Edit Distance algorithm. To do a fuzzy search, use the tilde (~) symbol at the end of a Single word Term. For example to search for a term similar in spelling to "roam" use the fuzzy search: roam~ This search will find terms like foam and roams. An additional (optional) parameter can specify the required similarity. The value is between 0 and 1. With a value closer to 1, only terms with a higher similarity will be matched. For example: roam~0.8 The default that is used if the parameter is not given is 0.5.

How to mission.do - 86

Proximity Searches

mission.do supports finding words that are within a specific distance away. To do a proximity search, use the tilde (~) symbol at the end of a Phrase. For example to search for a "Human" and "Resources" within 10 words of each other in a Field or file attachment, use the search: "Human Resources"~10
Boosting a Term

mission.do provides the relevance level of matching documents based on the terms found. To boost a term use the caret (^) symbol with a boost factor (a number) at the end of the term you are searching. The higher the boost factor, the more relevant the term will be. Boosting allows you to control the relevance of a document by boosting its term. For example, if you are searching for: Human Resources ...and you want the term "Human" to be more relevant, boost it using the ^ symbol along with the boost factor next to the term. You would type: Human^4 Resources This will make documents with the term Human appear more relevant. You can also boost Phrase Terms as in the example: "Human Resources"^4 "Sales" By default, the boost factor is 1. Although the boost factor must be positive, it can be less than 1 (e.g. 0.2).
Escaping Special Characters

mission.do supports escaping special characters that are part of the query syntax. The current special characters are: + - && || ! ( ) { } [ ] ^ " ~ * ? : \ To escape these characters, use the backslash (\) before the character. For example, to search for (1+1):2, use the query: \(1\+1\)\:2
Language Specic Search

It is important to mention that text indexing is performed for company-level base language. Foreign languages selected for company (and, possibly, by some of users) are not used in text indexing and full-text search in foreign languages is not guaranteed. If you choose to change company-level base language (from Account Settings) page please ask
How to mission.do - 87

mission.do support to re-create full-text index for your company. Please note that minimum length of query for text search is 1 character for Asian (multi-byte) languages and 3 characters otherwise.

How to mission.do - 88

Chapter 4: Pages, Page Editor and Grid Control

How to mission.do - 89

Chapter Overview
This chapter explains the concepts behind mission.do and the tools available, for working with the mission.do User Interface (UI) components that combine to form mission.do application Pages. It explains how Pages, Sections, Tabs, Cells and Fields work together to form a functioning UI layer. It also guides you through creating and modifying Pages using the Page Editor. In addition, this chapter discusses the advanced Grid Control tool that allows you to create and edit data in groups of related records while working with a parent record (i.e. line items or child records).

How to mission.do - 90

Understanding mission.do UI Components


Before working with mission.do UI components, it is helpful to have an understanding of the structure of Pages and page components.

The following diagram illustrates the containership hierarchy of mission.do UI Components:

How to mission.do - 91

Page Tabs

The contents of the currently selected Tab are shown, while others are hidden. Clicking on a hidden tab displays its contents and hides all others. Hidden tabs on View pages are only displayed on-demand when the user selects them. The content of these tabs is generated and sent via AJAX as needed. This may present a problem if hidden tabs include JavaScript. In this case you can check the Do not use AJAX loading for Tabs on the pages Properties page.

How to mission.do - 92

Page Types and Components


Every object definition has eight different types of Pages associated with it. When an object is created, one Page of each type is automatically created with it. Other pages, such as Generic page types, are created when Menus are created. The following table describes the types of mission.do Pages and their usages. Generic: A Generic Page has no association with a particular object. It is used to render dashboards and other information such as HTML and Script components and summary information calculated using formula and template fields. A Generic Page is created when you create a generic menu. Records List: A Records List Page is used to render a list of records for a particular object type. By default this contains a View component. New: A New Page is used to create a new record of a particular object type. View: A View Page is used to view an existing record of a particular object type. Edit: An Edit Page is used to edit an existing record of a particular object type. Status Change: A Status Change Page is used to a confirm changes to an existing record of a particular object type. You can optionally include other Fields in this page to be updated and different versions of this page can be associated with different statuses. Mass Update: A Mass Update Page is used to update a group of selected records. Different versions of this page can be created and used to represent different kinds of mass updates. Selector List: A Selector List Page is shown in a popup window used to select one or more records when using a lookup field (i.e. when clicking a lookup icon Portal Page: A Portal Page is used as part of a Portal (see Chapter 12. Portals for more details). Portal pages can be shared by many portals (i.e. the same Portal Page can be assigned to multiple portals). Important: Each Page has a single section marked Default New Fields Section. When a new Field is created and you choose to add the newly created Field to a Page, the Field is automatically added to the section of that Page marked as Default New Fields Section. When you add a new Object attribute (e.g., Location, Contact, etc.), mission.do creates a new Section for all View, New and Edit Pages and adds a group of Fields associated with that attribute (such as First Name, Last Name, Email, etc) to that Section.

How to mission.do - 93

Page Alignment

Sections on the page are typically aligned from top to bottom in one column. However, Generic and List pages have an option to align sections into one or two columns. This option can be enabled in the Page Editor by selecting the page title and editing the Columns property. If the page has more than one column, that pages sections will an Alignment option allowing selection of Left (default), Right, or Center. Using these options you can create richer page layouts to place, for instance, charts side-by-side on a dashboard page.

Page Tabs

The contents of the currently selected Tab are shown, while others are hidden. Clicking on a hidden tab displays its contents and hides all others. Hidden tabs on View pages are only displayed on-demand when the user selects them. The content of these tabs is generated and sent via AJAX as needed. This may present a problem if hidden tabs include JavaScript. In this case you can check the Do not use AJAX loading for Tabs on the pages Properties page.

Page Cells

The following table lists the major Cell components that are either added to Pages when created, or can be added by dragging them onto a page from the list of available components in the Page Editor (explained later in this chapter). Form Beginning and End Contains buttons to edit, cancel or submit a form. Added automatically to View, New, Edit, Status Change and Mass Update Pages. Cannot be deleted.

How to mission.do - 94

Chart Renders selected Chart. Generic and List. Is available if at least one Chart is created for this object. Gauge Renders selected Gauge. Is available on Generic and List if at least one Gauge is created for this object. Comments Table Renders a list of Comment records created on a particular record. Audit Trail List Renders a list of Audit Trail records created on particular record.

View List of records which can be paged, sorted, filtered, grouped, etc. Available in Generic, List, Selector no more than one such component for any given object type can be placed on a page. View of Related Records List of records related to (i.e. that have a Relationship with) the record currently being viewed. Detailed Search A configurable search component providing a way to allow users to do field-specific searches (for instance, Amount>Min AND Amount<Max). Field Renders an object field in view or edit mode. View mode (in certain cases) allows inline editing using the icon. Many Field types have properties that can be configured at the Page level (see Section 5. Using the Page Editor below for more details). View, New, Edit, Status Change and Mass Update Pages. When new Fields are created each field is added to the Default New Fields Section of each page. Grid Control A configurable component used in view pages to create and edit a group of records related to the current (i.e. master or parent) record (see Section 6. Using the Grid Control Tool below for more details). New, Edit and Status Change No more than one Grid Control can be used on any given View page. Organization Tree Displays an interactive hierarchy of Locations, Departments, or Functions. List (for LDF objects only) Report Link Link to a particular report. Available in Generic, List, View pages. Template HTML Template-based HTML component. Script Component Template-based Script component.

How to mission.do - 95

Page Editor
You can use the mission.do Page Editor to make changes to any Page in your Applications or Portals. If you are logged in as a user with the Administrator role, you will see an Edit this Page link in the upper-right corner of most pages. Click on this link to edit the current page with the Page Editor.

How to mission.do - 96

The main components of the Page Editor are: 1. Working Area: A WYSIWYG (what you see is what you get) drag-and-drop environment that emulates the Page being edited. Click on the Page title, or any Section, Cell (field) or other component to select it. Properties: The Properties section at the top of the left sidebar allows you to display and often change the properties of the currently selected component (such as the Page name, Section title, Field size, etc). Create: The Create section has placeholders for new components that can be added to the current Page: New Section, New Field, New HTML Component and New Script Component. Drag the desired placeholder and drop it on the Page where you want the component to appear to start the creation process (see below). Available Components: The Available Components section contains a sorted list of unused components that you can add to the current Page. You can drag a component from this section and drop it onto the Page where you want it to appear. Similarly you can remove a component from the page by dragging it off and into the Available Components section.

2.

3.

4.

When you select a particular Field, you can modify the page-level properties for that component in the Properties section. These settings will take precedence over global Field-level properties set on the Edit Field Page (as described in more detail in Chapter 2. Basic Concepts).

How to mission.do - 97

You can configure several important page-level properties on Sections as well, such as: Section title Number of columns: one, two, or three Style: No title, no border Title bar Title bar and rounded border

When you make a change to the current Page, mission.do will notify you by displaying a message, as shown below in yellow, above the page contents. From here you can: Click Save to save your changes. Click Save & Synchronize to save your changes and synchronize them with other Pages (as explained in more detail below), or Click Cancel to discard your changes.

How to mission.do - 98

Page Level Component Properties

How to mission.do - 99

Other Page Actions

When viewing a list of Pages associated with an Object definition or a Portal, several other actions can be performed on Pages as summarized in the table below:

How to mission.do - 100

Page Properties

When editing a pages Properties, note that each page allows the selection of different properties based on that pages type. Many, but not all, page properties can also be set in the Page Editor by clicking on the page title and editing them in the Properties box. The below table describes each of the page properties you will encounter and to which page types they belong:

How to mission.do - 101

How to mission.do - 102

How to mission.do - 103

Grid Control
The Grid Control is a relatively sophisticated UI component that allows you to create, update and delete a group of related records while editing the current (master or parent) record. To enable and use a Grid Control component, follow these steps: 1. 2. Create a 1-to-Many or Many-to-Many relationship between a master object and a child object (such as Purchase Order to PO Line Items). In the New, Edit, or Status Page for the master object, add a new separate section and drop the Grid Control component into it (you will find one Grid Component for each relationship in the Available Components section in the Page Editor). Save your changes. Click the Configure link (either on the Page itself or on the Object Definitions Pages section) to select from a number of available options: Choose columns to appear in the grid (may include Formula Fields). Check the required flag for selected columns as necessary (if you want to require users to complete that field when entering records) Select up to 3 columns for dynamic totaling in the grid. Specify custom JavaScript code to be executed when a grid row is added, updated, or deleted

3.

After completing the steps above, you can use the grid component as shown below while working with a master record: Click the Add link to add a new (empty) related record. Be sure to fill in the fields with some data; an empty line will be ignored. Click the Delete link on the right of a selected row to delete that related record. Use the grid component API to define your own custom UI behavior

mission.do saves the changes youve made to each related record in the grid when you save the form. If an error occurs in one of the rows (e.g., empty required value in a non-empty row), mission.do will display one or more error messages below the grid component. After successfully saving your data, the system will notify you about the operation performed including how many line items were created, updated and deleted:

How to mission.do - 104

Data Validation
mission.do supports several types of data validation capabilities. Prior to saving form data when creating or updating a record, mission.do performs server-side data validation. If validation succeeds, the save process continues. If validation throws an error, mission.do redirects the user back to the original form page and displays appropriate error messages. There are 3 types of validation that can be defined in mission.do: 1. Field-level Properties (e.g. required values, min/max ranges, maximum length of text or size of uploaded file, etc.). These constraints depend on the fields type and are discussed in Chapter 2. Field-level Validation: You can specify a custom JavaScript formula and attach it to a specific field to validate the value of that field and return a custom error message if necessary. This type of validation is discussed in Chapter 2. Record-level Validation via Triggers. You can specify a custom JavaScript formula and attach it to a Trigger to validate any number of values and prevent creation or update of a record and return a custom error message if necessary. This type of validation is discussed in Chapter 10.

2.

3.

How to mission.do - 105

Chapter 5: Reports, Charts, and Gauges

How to mission.do - 106

Chapter Overview
This chapter explains how to create, configure and use mission.do data visualization and the presentation functions: Reports, Charts and Gauges. With mission.do reports, you can present data in the following ways: Tabular: Each row represents a data record and each column represents a field. Tabular reports may include up to three layers to show dependent records. Document Template: Build custom Microsoft Word and Excel, plain text and XML document templates that are used to display record data in pre-specified locations. HTML: Create custom HTML documents that are used to display record data in pre-specified locations. JavaScript: Write custom JavaScript code to loop over a list of records, perform calculations and analysis and display results in custom HTML.

Charts are UI components that that present summaries of data in visual formats: bar charts, column charts, pie charts, donut charts, line graphs, and others. Charts can periodically and automatically refresh themselves without a complete page refresh. Some charts provide drill-down capabilities and interactivity options such as rotation and slice movement. Gauges are UI components that that present a single formula-based value in a way similar to a cars speedometer or a scale display. mission.do supports several different gauge types for various visual effects. Gauges can periodically and automatically refresh themselves without a complete page refresh.

How to mission.do - 107

Reports
The following sections describe how to work with each of the report types available in mission.do.
Tabular Reports

Tabular reports are the most common type. mission.do renders tabular reports as rectangular tables in which each row represents a data record and each column represents a field value. You can define up to three layers in tabular reports with a list of related records rendered below the parent row. In addition, you can define a Layer 3 of records dependent to Layer 2. The screenshot shows an example of a report with three layers of data. Notice that each layer can be expanded en masse with the Expand All and Collapse All links, as well as individually by expanding or collapsing each row. You can create a new report in the following ways: Use the New Report link in the Reports tab in the default mission.do Application. Go to an Object definition, scroll down to the Reports section and click on the New Report link Go to any page containing a section with a report link and click on the New Report link in that sections header.

In the next step you can define your reports columns, sorting and filtering conditions for Layer 1, similar to the way you define List Views (described in Chapter 3) with the added option to select a relationship for Layer 2 records (see note that follows). If you do choose a related object to display in a second layer, mission.do will create Layer 1 and then take you to the Layer 2 edit page. You can create a third layer in a similar manner if desired. If your object has defined charts, you can optionally select a chart to be included in the report that will be rendered below the reports body.

How to mission.do - 108

Template Based Reports

In addition to tabular reports, you can create reports based on HTML or a binary document template almost identical to Document Templates, except that reports are designed to present information on multiple records rather than a single record. See chapter 6 for more details. To create a Document Template report you can: Upload a binary file with the report template. Supported formats are the same as for Document Templates: Microsoft Word (.DOC) Microsoft Excel (.XLS) Plain text (.TXT) XML For HTML Template reports, you define your HTML code within the report definition itself rather than uploading a document.

How to mission.do - 109

In both cases, to generate the report, mission.do will: Scan through all of the object records the report is being run on (Report Filters can be used to limit this list). Execute template Group Functions on that list if they exist in the report (see chapter 6 for more details). Run template loops over that list if they exist in the report (see chapter 6 for more details). Finally, generate the report document in the source format.
JavaScript Reports

JavaScript reports allow you to loop through a list of records and use server-side JavaScript (or formulas) to generate output. You can invoke complex logic, run queries using the mission.do Query API, and do other such reporting. See chapter 6 for more details. To define a JavaScript report: Select the content type of the output (plain text, HTML, XML, or CSV) Define JavaScript to generate the reports header (optional) Select a View to use to loop through the selected objects records Define JavaScript to be executed for each record in the loop Define JavaScript to generate the reports footer (optionally) Inside the header, body and footer you can use rbv_api.print() or rbv_api.println() API methods to generate the reports output. Consider this simple example that prints a list of Lead records: Header: rbv_api.println("Hot Leads\n========================="); Body: if ("{!lead_type#code}"=="HOT") rbv_api.println("{!name#text}"); This will generate a text report that looks like: Hot Leads ========================= Per Hanseon jose del pino sawyer joe Todd Geist Bob Myers

How to mission.do - 110

Running Reports

After creating a report, you can use the Page Editor to add a Report Link component to a section in any Generic Page or Object List Page (see Chapter 4): Users with View permissions on particular report will be able to run the report by clicking on the reports link (as shown in the beginning of this chapter). Users with Manage Reports Administrative permission can Edit, Delete, or set View Permissions for particular report Complex reports (especially template-based) may require long time to execute. In this case, use the Email link to place report in a queue for asynchronous execution. It will be e-mailed to you when ready. In addition, when running a report you can use Dynamic Report Filters to filter Layer 1 records. Filtering reports works the same way as dynamic filtering in List Views. When you open first Report page it will render report with default filters specified when report was created (if any). You can dynamically update these filters and click Run Report button to render report again with new filter values. Click Reset Filters to restore default (which may be empty) filters. When running template-based report you can use the following buttons: Run Report: display report with currently selected filters Reset Filters: reset filters to original reports selection, clear filters if no filters is selected in report

Finally, you can export the reports data to XLS or CSV formats. When running template-based report you can use the following buttons: Run Report: display report with currently selected filters Print: display report in pop-up window ready for printing Reset Filters: reset filters to original reports selection, clear filters if no filters is selected in report Edit: open report for editing (if current user has permission to manage reports)

How to mission.do - 111

You can create a Batch Job with a predefined frequency that that will generate and e-mail a report as an attachment to a pre-specified e-mail address. Please refer to chapter 14 for more details on the Batch Job feature.

How to mission.do - 112

Charts
You can use the Charts function in mission.do to visually represent a snapshot of your data. You can give your charts a wide variety of styles: bar, column, pie, donut, and many others. Charts can periodically and automatically refresh themselves without a complete page refresh. Some charts provide drill-down capabilities and interactivity options such as rotation and slice movement. mission.do offers two engines to render charts: Fusion Charts (based on Flash) Google Charts (based on HTML vector graphics)
Creating and Conguring Charts

To create a new Chart, go to the Object definition, scroll down to the Charts section and click the New Chart link. Use the two-step wizard to build or configure a Chart. To begin, follow the steps below: 1. 2. Select chart engine: Fusion Charts or Google Charts. Designate how records of particular Object will be grouped into collections (i.e. columns or slices). A set of collections is referred as the X Axis (this refers to bar-style charts and can be logically extended to other types of charts). You can create these groupings for: Enumeration fields (picklists, status) Lookup fields (one or more related records) Date fields (dates can be further grouped by week, month, quarter, or year) Numeric fields (allows specification of a range of numeric values)

3. Select which numeric value will be summarized for each collection. This value is referred as Y Axis. This value may belong to either the parent or a related Object. You can also use the count of parent or related records. 4. Provide more information, including: Name for this Chart and labels for X- and Y- axes (not used for pie and donut charts) Chart style Chart size: width and height in pixels For Fusion Charts only you can select: Check the Animate Chart box if you want flash-style animation for this Chart when available. Check the Auto-Refresh Chart box if you want this Chart to be automatically refreshed without manually reloading the Page or Report the chart sits in. Check the Disable Drill-Down box if you do not want to allow drill-down to records in

How to mission.do - 113

chart columns or pie slices (i.e. collections). Select View to use to display drill-down data.

5. Additionally, configure the selected collections: For numeric fields, select the range and width of each collection. For date fields, select the dates interval (week, month, quarter, or year) range Select what is to be computed for records that fall in q particular collection: total, average, or percentage of this collection relative to all collections total.

Using Charts

To make a Chart available for viewing on a Page, use the Page Editor to add the Chart component to an empty section on a Generic or Object List View Page. Above is an example of Fusion Chart. This will result in displaying the selected Chart on your Page. From this runtime view of the Chart, options in the Section header that contains it allow you to: Select another Chart Edit the selected Chart Create a new Chart or clone the selected Chart Delete the selected Chart Dynamically filter data visualized in the selected Chart

How to mission.do - 114

Gauges
You can use Gauges in mission.do to visually represent a single numeric value computed using a JavaScript formula. Gauges resemble familiar devices such as a cars speedometer or gas meter, electronic scales, etc. mission.do supports several different gauge types for various visual effects. Gauges can periodically and automatically refresh themselves without a complete Page refresh.
Creating and Conguring Gauges

To create a new Gauge go to an Object definitions details page and scroll down to the Gauges section. Click the New Gauge link. Choose one of presentation styles shown above. Next, select minimum and maximum values to represent the beginning and end of the Gauges display range. mission.do renders the computed value by positioning the Gauges arrow relative to these values. You can also optionally set lower and upper values inside the min/max interval. mission.do uses these values to visually indicate the Gauges lower and upper threshold values (i.e. consider the red zone on an automobiles tachometer). Finally and most importantly, specify the JavaScript formula to compute the Gauges value. If you use the Gauge to visualize data for a particular record, use tokens from that record and related records. If you use the Gauge is to visualize data from a list of records, use a loop to iterate over records, compute and return a final value.

Using Gauges

Using links above each Gauge component, you can: Force a Gauge component to refresh itself Edit a Gauge component

How to mission.do - 115

How to mission.do - 116

Chapter 6: Server-Side Code: Templates and Mission Control Formulas

How to mission.do - 117

Chapter Overview
This chapter covers mission.do server-side coding in the form of Templates, Formulas and the mission.do Query API. It provides a rich set of syntax and examples you can use to write code to harness the power of mission.do server-side data manipulation for custom business logic and calculations. We explain in detail where Templates can be used, looping through related records, email templates, document templates, server-side Formulas (JavaScript), group functions (SUM, COUNT, MIN, MAX), the mission.do Query API, EVAL, Formula Fields and Field-level validation.

How to mission.do - 118

Templates and Formulas Overview


mission.do uses the term Templates for text and binary documents that include special tokens to merge record data into a final result. A typical merge token looks like this: {!createdAt}. mission.do parses Templates at runtime, where the token is replaced by the actual value that depends on the Templates syntax and the Object record currently in scope. After parsing, mission.do sends some Templates to the JavaScript engine, where they are evaluated as JavaScript expressions. When this happens, we use term Formula. Consider this simple example: Formula Template: {!price} * {!amount} Parsed Formula: 100.00 * 5 Formula result: 500.00

Templates and Formulas are used in many places throughout the mission.do platform: Templates: Page-level HTML and Script components created in the Page Editor Template fields and Integration links created as part of an Object definition Record name Template (the object definition property that determines how record names appear) Mail and Document (binary) Templates (used to dynamically generate emails and documents respectively) Report Templates (binary and HTML) (used to dynamically generate custom-formatted reports) Formulas: Formula fields created as part of an Object definition Conditions and expressions used in triggers (to determine whether a trigger should be run, or what value to use as the result of a trigger) Conditions used in workflow actions (to determine whether a workflow action should be allowed to proceed) Conditions used in field-level validation (to define custom field-level validation and error messaging) Values calculated in gauge components (to determine the value to render in the gauge) #EVAL[ ] helper that may be embedded in any Template (to explicitly invoke the Formula engine from a non-formula context such as an email or document template)

How to mission.do - 119

Creating Templates in the Page Editor


You can use Template-based components in your Pages to display a records information in specific ways, such as use of custom formatting, described in the steps below: When editing a page with the Page Editor, drag the New HTML Component or New Script Component widgets from the toolbar on the left to the desired place on the Page. Enter custom HTML or JavaScript. You can use the Rich Text Editor or switch to Script mode (the only mode available for Script Component). To embed merge tokens into the component, use the merge field helper at the top of the dialog:

Select a group of tokens (the Object itself is the most obvious choice).

Select a Merge token available for that group (all of the Objects fields which have This field can be used as a merge field in Templates and Formulas box checked on Field Edit page are eligible).

The selected merge token will appear in a text box. Copy it into the clipboard (its text is already selected) and paste it into the Templates body. Save your changes and then save the Page. At runtime your Template will be parsed and merge tokens will be automatically replaced by values from the current Object record. In the simple example above, the View Page looks like this.

How to mission.do - 120

How to mission.do - 121

Template Fields and Integration Links


Template Fields are similar to Template-based HTML components, but can be used in Views and Page layouts. To create a Template Field, follow these steps: 1. 2. 3. 4. On an Object definitions View Page, scroll down to the Fields section and click New Field, then select Template as the fields type. Enter HTML for the fields body and embed any Template merge tokens as needed using the merge field helper. You can preview the resulting field by clicking the Preview Template link. Now the field can be added to Pages and Views see the screen capture below.

Integration Links are specifically used to construct a URL with embedded parameters. To construct Integration Links follow the steps above, but be sure to keep the URL syntax in mind.

How to mission.do - 122

Record Name Template


Every Object record in mission.do has a special field labeled Record Name, which is used as a link to a records view Page and in other cases when the records name is displayed. By default this field allows direct user input. However, in many cases it is more convenient to instead automatically populate this fields value from other fields using a Record Name Template. To set up a record naming Template, follow these steps: 1. Edit your Object Definition. 2. Find the Record Name Template property. 3. Select one or more merge tokens and paste them into the Record Name Template field. Add separator characters as desired. 4. To update all existing records using the new Template, check the box below the Template called Update names of all existing object records using this template. If you want to use the value of a checkbox in the record name template, use the #EVAL[] helper as shown here: #EVAL[ {!club_member} ? Member : Non-Member ] {!title}

How to mission.do - 123

Syntax for Template Tokens


Normally, you will not need to type merge tokens manually, since the merge field helper allows you to select and copy all available tokens. However, you may find it beneficial to learn the syntax that can be quite useful in troubleshooting issues. Generally, a Template token has a form similar to: {![Prefix].TokenName#[Suffix]} Prefix (optional) is the integration name for the relationship, if any. For example: R123456. For hierarchical relationships, it additionally includes #C for the child side of the relationship and #P for parent side of the relationship. TokenName (mandatory) represents the integration name of the field. Suffix (optional) includes additional instructions on how to render a given token. Available suffixes are listed below.

How to mission.do - 124

How to mission.do - 125

Advanced Template Syntax

Several unique merge tokens can be used to build links within Template components (use actual Object integration name instead of objName). All fields from the currently logged-in user and current customer zone are available for use in Templates: Name of current user: {!#CURR_USER.name} Name of current customer: {!#CURR_CUSTM.name}

You can also use Template tokens for: Company-wide settings Current portal visitor (for portal Pages) Shared images (from any Object) Helpers

How to mission.do - 126

Loops Through Related Records


Most importantly, Templates can iterate through a list of records related to the current record. To accomplish this, include a portion of the Template between the #LOOP_BEGIN and #LOOP_END tokens and that portion will be repeated for each record related to the current record. Below is an example of Template code that renders a list of related items: <ul> {!#LOOP_BEGIN.R8011504#8108944} <li>Item: <b>{!R8011504.R8011504}</b> Amount: <b>{!R8011504.amount}</b></li> {!#LOOP_END.R8011504} </ul> To create a Template loop: In the left drop down, select the Object type related to the current record Select and copy the Loop Begin token. If you have several Views for a related record, you will have a choice of the View to use for iteration that allows an easy way to filter and sort related records in Templates. Create a portion of the Template to be repeated for each related record. Select and copy the Loop End token. To use template tokens from parent record while looping through related record use object integration name (of parent record) as prefix: <ul> {!#LOOP_BEGIN.R8011504#8108944} <li>Bill: <b>{!order.name}</b> Amount: <b>{!R8011504.amount}</b></li> {!#LOOP_END.R8011504} </ul> Optionally, you can include a maximum number of records to iterate through in parentheses at the end of the LOOP_BEGIN token: {!#LOOP_BEGIN.R8011504#8108944(10)} {!#LOOP_END.R8011504} This Template will iterate through the first 10 related records, ordered according to the selected View. You can also loop through any records of a certain Object within a template, not just through related records. To accomplish this, follow the steps below: 1. Prepare a List View which sorts and filters records the way you desire (e.g., to render the most recent records and sort them by Updated At in descending order). 2. Record the Original Id of that List View (you can find it on the Object definitions View page).

How to mission.do - 127

3. Use that Original Id in the Template: {!#LOOP_BEGIN.all#originalViewId} {!#LOOP_END.all} Use the Objects integration name as prefix for merge fields used inside loops through all records. Example: {!#LOOP_BEGIN.all#479484} {!order.name} {!#LOOP_END.all} Instead of {!name} here we use {!order.name} so that the merge field is replaced by the related records name rather than that of the parent object record.

How to mission.do - 128

Example of a Template Field


You can use Template fields in combination with other field types to deeply customize the mission.do user interface. Consider this example: you have a related field on the Order Object which points to the email address of a related User. This related field will display a link to send an email to that user and this is correct behavior. However, you may want to have a link to send an email using Order fields to a different related email address. To accomplish this, you can create a Template Field with the following HTML Template:

<a href='../m/send.jsp?act=clean&id={!id}&objDefId={!#OBJ_ID.order}&to={!relatedEmail}'>{!relatedEmail}< This Template will render a link to a Send Email Page using fields from the current Order record, but the email address from the related field.

How to mission.do - 129

Mail Templates
Mail Templates provide convenient way to send template-based emails manually from within mission.do (for single record or group of records). They also can be used in/with: "Email Template" Fields "Send Email" Workflow Actions Workflow Triggers

To create an email Template: Provide a display name for the Template. Check the Private box if you want this Template to be hidden from other users. Select a Template format: plain text or HTML. Optionally enter integration code (used by API to find this template). Specify a subject line for this Template. The subject may include any Template merge field tokens. Specify the body for this Template. The body may include any Template merge field tokens and loops as described above.

How to mission.do - 130

Document Templates
mission.do also allows defining document Templates based on uploaded documents (plain text or binary). Document Templates can be used to generate documents such as Quotes, Purchase Orders, Invoices, etc. Supported document formats include: Microsoft Word 2003 (DOC) RTF Microsoft Excel 2003 (XLS) CSV HTML XML PDF forms Plain text (TXT)

Document templates can be used in/with: "Document Template" Fields "Template Document" Workflow Actions Workflow Triggers Template-Based Reports (share the same syntax

To create a new Document Template, follow these steps below: Prepare a file in one of the supported formats which includes Template tokens and loops, as explained above. Provide display name for the Template. Optionally enter integration code (used by API to find this template). Check the Private box if you want this Template to be hidden from other users. For HTML-based Templates, check Render as PDF if you want the resulting HTML document to be converted into PDF format. Upload the prepared file to mission.do. When modifying existing text-based template (XML, TXT etc.) you have an option to edit text directly on web page rather than uploading a new file.

How to mission.do - 131

Text-based templates (TXT, CSV, and HTML) can be edited directly from Template Edit page without having uploaded new file.

Microsoft Word Templates

You can upload Microsoft Word documents and use them as mission.do Document Templates. The screenshot below shows an example of a Word Document Template that includes tokens from a base record that utilizes different styles and includes a loop through related items.

How to mission.do - 132

Writable PDF Forms

PDF templates allow filling up fields in writable PDF Forms. To enable that filling after uploading PDF document which contains such form please map form fields to object fields of simple expressions. You can upload PDF files which contain writable PDF Forms and use these files as mission.do templates. To use PDF Forms you need to map PDF fields to template tokens or simple expressions. Use Map Form Fields button (available only for PDF Document Templates) to bring up mapping page. Example below shows mapping for Object with Location and Contact attributes and PDF fields in standard IRS W-9 form. Please note that one field is mapped to a single token {!streetAddr1} while another is mapped to string template: "{!city}, {!state#code} {!zip}".

How to mission.do - 133

Formulas
Formulas are text Templates sent to the JavaScript engine after parsing (i.e. after all merge field tokens have been replaced with real data). The JavaScript engine executes the Formula and returns a single value to the caller.
Simple Formula Example

This simple Formula represents an expression: {!amount}*{!price}*(1-{!discount_proc}/100) In more complex cases, you can define intermediate variables, flow-control operators, etc. For example, the following Formula calculates monthly payments on a mortgage: var q = {!mortgage_rate}/12/100; var A = parseInt('{!amount}',10); if (A<=0 || q<=0) return null; var N= parseInt('{!loan_type#code}',10); if (N<=0) return A*q; return A*q/(1-Math.pow(1+q, -N)); In such a case, the Formulas body will be wrapped into a JavaScript function and the resultant function will represent the Formulas result.
Including Your Own Functions in a Formula

You can include your own functions in a Formula: function formatNum(x) { if (x instanceof Number && !isNaN(x)) return x.toFixed(2); return ""; } function calcStr() { var y={!amount}*{!discount}; return formatNum(y); } calcStr(); The Formulas resulting value must be of a certain type that depends on where the Formula is

How to mission.do - 134

used:

String tokens such as {!lastName} will be replaced by values from text fields before sending the Formula to the JavaScript engine. Unlike numeric tokens that can be used in the Formulas as is, text tokens typically must be enclosed in quotes to produce meaningful results. The table below gives some examples of valid and invalid usage of tokens in Formulas:

Important: For the Date return type, Formulas can use the JavaScript Date Object. Formulas also can optionally return the number of milliseconds between midnight of January 1, 1970 and the specified date. Typically you will create a JavaScript Date() Object and call getTime() on it. The following Formula returns the current date shifted forward by 24 hours: var d = new Date(); return d.getTime() + 24*60*60*1000;

How to mission.do - 135

Creating an HTML Icon with a Record Status Image

Another important example: how to create an HTML icon with an image that reflects the current status of a particular record. Follow these steps: Create several Shared Icon fields to hold your icons. Create a Formula field with return type String and the following Formula: if ("{!status#code}"=="CRE") return "{!order.created_icon#html}"; else if ("{!status#code}"=="SHI") return "{!order.shipped_icon#html}"; else if ("{!status#code}"=="CAN") return "{!order.cancelled_icon#html}"; return ""; Add this Formula field to Views and View Pages as needed. It will generate HTML with an image field which depends on the records status
Formula Security Limitations

You can use any valid JavaScript code in your Formulas, including Array, for loop, etc. However, to protect our computational resources, total execution time of any Formula is limited to 3000 ms. The length of a parsed server-side script cannot exceed 10KB. This is normally not an issue and can only become an issue if youre using loops through a long list of records. Try to avoid using
How to mission.do - 136

long loops (see below for suggestions). For obvious reasons, server-side Formulas cannot make use of the Document Object Model (DOM) or third-party JavaScript libraries. However, core JavaScript Objects (Math, String and Date) are available for server-side scripting.
Writing and Debugging Formulas

mission.do provides the following capabilities to assist with writing and debugging Formulas. In the Formula Helper section, you can select a Template token and paste it into the Formulas body in the same way as done with Templates. The Group Token will be explained later in the Group Functions section. The Select ID control can be used for picklists, lookup and status fields when you want to select an ID or integration code for use in your Formula. Loops through related records can be used in Formulas in the same way as in Templates. The loops body will be replicated during parsing using data from each related record. Click the Validate Formula button for quick validation of the Formulas syntax. This will process the Formula on an arbitrarily selected Object record. Click the Debug Formula button for detailed Formula debugging. Select the Object record to run the formula on in the Lookup window. The debugger will show: Original Formula Formula parsed using the selected records data (with line numbers on the left for convenience) Debugging output (if any) Result of Formula calculation Error message (if any)

How to mission.do - 137

Example of Date Usage in Formulas


You can use the standard JavaScript Object Date in your Formulas. Constructor new Date() will create an Object with the current date (using server time zone), while constructor new Date({!date_field}) will create a Date Object corresponding to your date field. The following Formula shows how to calculate the difference in days between the mission.do Date field and the current date taking into account the users time zone setting: var dt = new Date("{!date_field}"); var today = new Date(rbv_api.getCurrentDate()); var day = 24*60*60*1000; // Length of 24 hours on milliseconds var days1 = Math.floor(dt.getTime()/day); // Rounded down integer var days2 = Math.floor(today.getTime()/day); return days1 days2; Note: String representations of date fields in Formulas (e.g. the merge field {!date_field} above) automatically uses the correct time zone from the current user. To ensure that current date uses the correct time zone as well, use getCurrentDate() API.

How to mission.do - 138

Group Functions
Group functions are used to calculate the value of an expression from groups of related records. mission.do Formulas support four types of group functions. You can also run Group Functions on the entire set of an Objects records. For that use the Objects integration name instead of a specific Relationship name, such as: #CALC_SUM.invoice( amount | true ) When writing expressions and conditions for Group Functions do not use tokens from the Select Merge Token box; rather, use the Group Token box for fields from related records.

For Group Function conditions you can use the following special tokens: TODAY for the current time WEEK for 12PM of last Sunday MONTH for 12PM of 1st day of the current month QUARTER for 12PM of 1st day of the current quarter YEAR for 12PM of 1st day of the current year CURR_USER for id of the currently logged in user You can also use integration codes from picklists and status fields. Examples of Group Functions: Maximum value of amount field among records created in current quarter: #CALC_MAX.R8011457( amount | createdAt>=QUARTER ) Count number of related records with address1 field not null:
How to mission.do - 139

#CALC_COUNT.R8011457( address1 ) Typical Mistakes in Formulas The following sections summarize some typical mistakes and inefficiencies in Formulas. Include Tokens in Quotes Do not forget that Template tokens like {!name} are not JavaScript variables. They are replaced by actual values before being sent to the JavaScript engine. While numeric values can be used as is,, strings are typically enclosed in quotes to form a meaningful result:

Unnecessary Quotes

You can often use the fact that Template tokens will be replaced with real, non-quoted values to your advantage by simplifying token concatenation. You dont have to use JavaScript to concatenate tokens the Template parser can do it for you.

How to mission.do - 140

Avoid Loops in Formulas

Although you can use Template loops in Formulas, beware that they can result in very long JavaScript after parsing; that script could be aborted by mission.do due to Formula length and execution time limitations. Consider this example: {!#LOOP_BEGIN.R12345} // Do some processing rbv_api.setFieldValue(...); {!#LOOP_END.R12345} The code inside the loop will be replicated for each record in the loop. A much more efficient approach would be to use a JavaScript for() loop: var ids = rbv_api.getRelatedIds("R123456", {!id}); for (var i=0; i<ids.length; i++) { var ordered = ids[i]; rbv_api.runTrigger("order", orderId, "trUpdate"); } In this example, the Formula obtains a list of related IDs, loops through them all and invokes a trigger on the corresponding related record.

How to mission.do - 141

Chapter 7: Client-Side Code: HTML Event Handlers

How to mission.do - 142

Chapter Overview
This chapter explains mission.do client-side development and customization in the form of HTML event handlers and the mission.do AJAX API. Together these capabilities allow you to create a richer user interface and customized user experience. This chapter also provides a set of examples you can use to get started writing your own custom client-side code.. Note: When developing using the client-side HTML Event Handlers and AJAX API, be sure to regularly monitor your browsers JavaScript errors (for this we recommend installing the FireBug plug-in). In Internet Explorer (IE), we recommend enabling the Display every JavaScript error option. In Firefox, if you do not have FireBug, you can use the Error Console window. Tip: We highly recommended that you use some sort of browser-side debugging as you develop. The JavaScript alert() method provides a simple way to debug your client-side JavaScript as you write it.

How to mission.do - 143

HTML Event Handlers


HTML events occur in a clients web browser when a user moves, clicks and drags the mouse, enters text and performs other interactions. HTML components, such as text boxes or selects (picklists), can expose JavaScript handlers that can be invoked when these events occur. You can read more about HTML events at this recommended web site: http://www.w3schools.com/jsref/jsref_events.asp mission.do provides a way to specify JavaScript handlers for HTML events. To access this feature, navigate to an Object definitions page. Scroll down to its Fields section and click the Events link in the Action column for a particular field.

Alternatively, you can navigate to the Field View Page and select Event Handlers from the More Actions drop down box. Different field types expose different event handlers. For instance, a text input box exposes the following: onchange, onclick, onfocus, onblur, onkeypress, onselect, onmouseover, onmouseout. A picklist exposes the following: onchange, onclick, onfocus, onblur, onmouseover, onmouseout. Read-only and hidden fields do not expose any handlers.

Dening Event Handlers

The above screen allows you to define event handling code for a selected field. The merge field helper component on the top allows you to select names of other Object fields and values (or codes) for picklists and lookups. Note that, unlike similar helper components for templates, these helper tokens contain just the fields integration names, rather than template tokens. These names can be used to refer to HTML elements in client-side JavaScript.

How to mission.do - 144

To view how your event handling code appears in generated HTML at runtime, click the Debug link to bring up the debug window.

Simple Event Handlers

Using event handlers, you can customize the behavior of your HTML components. In the example below, the pair of handlers named onfocus and onblur for Text Areas will expand a component to eight rows when it receives focus (onfocus) and then compress it to two rows when it loses focus (onblur). Please note that the this reference can be used inside event handlers to access or modify the properties of the relevant input field.

How to mission.do - 145

Copying a Fields Value to Other Fields


In some cases you may need to use a value entered into one field as the default value for another field. For example, an email address is likely to be re-used as login name. To achieve this you can implement the onblur handler for the email field. Enter the following JavaScript code: if (form.loginName && form.loginName.value=='') form.loginName.value=this.value; This code first verifies that the loginName field exists in the current form and has no value specified by the user. Tip: You can use the prefix form. in front of any field integration name to reference that field in the DOM. For example, in the above code we reference the loginName field as form.loginName.

How to mission.do - 146

Changing the Appearance of Fields


Often, behavior of one field should depend on a selection made in another field. Consider the example below, in which there are three fields: Club Member (checkbox) Membership Fee (currency) Member Since (date) The last two fields should only be available if Club Member is checked. To achieve this, take following steps: 1. Create a script component on the Page with the following code: <script> function my_showClubControls(form) { var isMember = form.club_member.checked; form.membership_fee.disabled = !isMember; form.member_since.disabled = !isMember; } </script> 2. Add event handling code to the onclick event of the Club Member checkbox: if (typeof showClubControls == 'function') my_showClubControls(form); 3. For consistency, add the same code as above to the Pages onload handler: if (typeof showClubControls == 'function') my_showClubControls(document.theForm); After this, Membership Fee and Member Since fields will be enabled or disabled, depending whether or not the checkbox Club Member is checked or unchecked. After this, Membership Fee and Member Since fields will be enabled or disabled, depending whether or not the checkbox Club Member is checked or unchecked.

How to mission.do - 147

Setting Default Values


In some cases selection or input of a certain value in your form should determine the default value for another field. Consider an extension of the example above, in which a selection in a picklist called Membership Type determines the default value for another field called Membership Fee: 1. Create a picklist called Membership Type with three values. Each of the values should have an integration code as shown below (important): 2 Add a script component to the Page: <script> function cust_membFee() { with (document.theForm) { if (membership_fee.value=='') { var code = membership_type.options[membership_type.selectedIndex]. getAttribute('code'); if (code=='A') membership_fee.value=1000; else if (code=='C') membership_fee.value=500; else membership_fee.value=200; } } } </script> 3. Add the following code to the onchange event handling code for the Membership Type picklist: if (typeof cust_membFee == 'function') cust_membFee(); Now when the Membership Type option is selected and the Membership Fee box is empty, this box will be pre-populated with a new value depending on the selection.

How to mission.do - 148

Chapter 8: Additional Application Tools

How to mission.do - 149

Chapter Overview
In this chapter we discuss application tools and capabilities not covered in previous chapters, including: Auditing Communication Logs Printing Records and PDF Generation Cloning Records and New Record Templates Converting Records Locking Records

This chapter covers the following critical areas in detail: Auditing (Object level, Field level and custom audit trail entries); record conversion and conversion templates; cloning records (including related records); communication logs; PDF generation; and new record Templates.

How to mission.do - 150

Auditing
mission.do automatically creates audit trail entries for records to keep track of a history of changes to Object records and Object definitions. Audit trail records cannot be modified or deleted; they are only deleted when their related Object record is deleted. To enable auditing on Object records, enable the Audit Trail attribute for the Object definition. Audit trail entries are displayed in a list view component which is placed in the System Info tab by default in an objects View Page. You can move or remove it using the Page Editor. Audit trail records are automatically be created in the following cases: When a record is created or updated and the Object has the Audit Trail attribute enabled. When a record is deleted and the Object has the Audit Trail attribute enabled. In this case the audit trail entry will be recorded in the associated Users audit trail. When a Field has the Track all changes attribute enabled and the content of the Field has been changed (in this case the audit trail record is created without regard to the Object level Audit Trail attribute).

When an email related to an Object record is sent. In this case, the View link in the Action column allows viewing a copy of the email message that was sent.

You can create a Workflow Trigger of type Create Activity Trail Record to generate custom template-based audit trail entries when a record is created or updated.

The above screenshot illustrates several types of Audit Trail entries associated with an Object record. The Audit Trail list view component shows the 20 most recent entries. Use the Show All link to see more (up to 100) entries in a pop-up window. You can also export all entries to XLS or CSV format from this window. Audit Trail entries are also created when you make changes to an Object Definition or Application. You can see these records on the bottom of the Object View and Application View
How to mission.do - 151

Pages. Finally, some types of administrative Audit Trail entries related to a customer zone in general can be found on the bottom of the Administration Setup Page. These records include, for example, a copy of email messages sent as result of large asynchronous data imports.

How to mission.do - 152

Communication Logs
Communication Log records are used to keep track of email messages, phone calls and other forms of communication. Unlike Audit Trail entries, you can add Fields to the Communication Log object definition and modify its Pages and Views. When an object with Contact attribute is enabled on new or existing object the system automatically creates relationship with Communication Log and adds list of related Communication Log records to objects View page. Otherwise you can create relationship with Communication Log object using New Relationship link. Communication Log records can be edited or deleted if the User attempting to do so has sufficient permissions. Click the Send Email link to send a template-based email, with the email address pre-populated with the address of the base record. Click New Communication Log to create a new log record for a phone call, conversation, or other documented communication.

How to mission.do - 153

Printing and PDF Generation


All editable mission.do Pages have a Print link that renders a Page without the sidebar or header in a popup window suitable for printing. Links and buttons are intentionally disabled.

View and List Pages allow viewing this data in PDF format.

How to mission.do - 154

Cloning Records and New Record Templates


You can clone the currently selected record by selecting Clone from the More Actions drop-down box on the Object View Page.

This action displays the New Record Page, where all Fields are pre-populated with values from the original record. You can change these Fields or accept values from the original record. The original record is not affected when you create a cloned record. Things get more complex when the original record has a relationship with dependent records. When you define a relationship, you can indicate whether related records should be cloned when a parent record is cloned: When the Clone all related flag is set, related records are cloned and attached to the resulting cloned records. For example, when you clone a Purchase Order header record that has relationships with Line Item records, it makes sense to clone all of its related line items.

How to mission.do - 155

New Record Templates


In cases where users will need to create similar records repeatedly on a regular basis, you can use the Record Templates feature to streamline this process. New Record templates are available from the Templates menu for a particular Object definition, or from an Object definitions setup page. To create a New Record template, define its name and select an existing record to be cloned. If you have defined one or more New Record templates for your Object definition, a drop-down list of these templates is displayed on the New Page for that object definition. Selecting one of them will initiate cloning of the record using the selected New Record template.

How to mission.do - 156

Converting Records
Conversion features allow you to convert records from one Object type into records of another Object type. Conversion may occur: From a List View for one or more selected records: See Chapter 3. Views and Search for more details on record selection. From a record View Page: Select Clone from the More Actions drop-down list in the upper-right corner. Through triggers and workflow actions

In either case the basic mechanism is the same: 1. Select the destination Object type. 2. Map the destination Fields to source Fields, formulas, constant values, or default values. You can save mapping as Conversion Maps for future use (Conversion Maps are stored as part of the source object definition). 3. Perform the actual conversion.

Lets go through these steps in more detail. Conversion works as a 3-step process: Step 1: Select the destination Object type. Available destination Object types include all deployed Objects except the source Object. Step2: Map destination Fields to the source. All Fields of the selected destination Object are displayed except read-only (including template) Fields. A drop-down box with a list of selectable source Fields for direct conversion is displayed on the right of each destination Field. The system will ensure that data types of source Fields offered for mapping are compatible with destination Fields. Some Fields may be selected by default if the display names of source and destination fields match. You can change these if desired. You can also map a destination Field to a constant value (i.e. a string, number, or particular record for lookups), or an expression. An expression can be a simple formula built from source Field tokens the same way as other formulas are constructed (see Chapter 6. Server-side Code: Templates, Formulas and the Rollbase Query API for more details). The mapping user interface does not provide helpers to build these expressions. Example of a mapping expression: {!total} {!amount} If a destination Field provides a default value, you can map a destination Field to its default value (as automatically happens with new record creation).

How to mission.do - 157

Finally you can select an option to delete the source record after successful conversion.

Mapping complex Objects with many Fields can be a tedious task you may not want to repeat frequently. To save time after you have finished mapping, click the Save Map button. You will only need to enter a display name for a new Conversion Map. When one or more maps are defined for conversion between two given Object types, a drop-down list allows selection of one of them.

How to mission.do - 158

Attaching Related Records to a Newly Created Converted Record


If source and destination Objects both have relationships with the same Object and that relationship has the Clone all related setting enabled, then converted records can be attached to newly created cloned related records from the source record. For example, consider LOI and Request Object definitions that both have relationships to a Organization Object definition. When a LOI is converted into an Request, from the Organization are cloned and attached to the Invoice. To enable this conversion, check the box in the Clone Matched Related Objects section:

How to mission.do - 159

Finding Duplicates
This feature allows you to easily find potential duplicate records among a set of records and then merge them with a currently selected record. To use this feature: 1. 2. Go to a particular object record and select Find Duplicates from the More Actions drop-down. Select desired criteria to find duplicate records: values of selected Fields must be equal to Field values in the current record. Then click the Find button.

3. If any records matching the selected criteria are found, select the records to be merged and then click Merge. 4. Finally, select Fields from all records to be merged into a final record, in the same way as you would use the merge records feature (see the Merge feature in Chapter 2. Basic Concepts for more details).

How to mission.do - 160

Locking Records
In some cases, you may want to lock a record to prevent it from being edited or deleted. To use this feature, enable the Lockable attribute on your Object that adds a new checkbox called Is Locked. When you set this Field to checked (either by directly editing a record, via a mass update, Trigger, etc.), the record is moved into a locked state. This means: Edit and Delete buttons on the record View Page are disabled. Edit and Del links are not shown. A lock icon is shown as the value for the Is Locked Field. Related Lists shown on the record View Page do not display links to create, attach, edit, or delete related records. Edit and Delete buttons on the View Page for related records are disabled. To remove locks on records, you can use a Trigger or the API to set the Is Locked checkbox to false. A new Trigger type called Unlock is created when the Lockable attribute is set. Workflow actions are still available when a record is in the locked state. If you wish to disable them you can do so by adding a formula condition to each workflow action to return false if the record is locked: !{!isLocked}

How to mission.do - 161

Chapter 9: Importing and Exporting

How to mission.do - 162

Chapter Overview
This chapter discusses how Mission.do allows you to use spreadsheets (CSV and XLS) to import and update Mission.do records and export data from Mission.do into spreadsheets It discusses the following critical areas in detail: Import maps; creating an Object definition from a spreadsheet; creating an Application from a Microsoft Access database (covered in more detail in Appendix A); exporting data from Views and Reports.

How to mission.do - 163

Importing Data
This section explains how to import data from spreadsheets for the purposes of adding new records, modifying existing records and creating new Objects definitions populated with a set of records.
Adding New Records from a Spreadsheet

Importing data from spreadsheets is a common and easy way to add new records, or to mass-update existing records. mission.do automatically creates a default Import menu when you create a new Object definition. You can find this menu under the Objects tab in any application it appears in. You can also use Page Editor and configure List View component to display Import link in sections header. mission.do simplifies the import process with a wizard, as follows: Step 1. Create the spreadsheet you wish to import in XLS (Microsoft Excel) or Comma-Separated Values (CSV) format. Click the Import link, browse and locate the file and click the Create new records radio button. Click the Next button. mission.do assumes each row starting from row 2 in the uploaded spreadsheet represents a record to be created or updated. Row 1 is always considered to be a header row (when creating an object definition from a spreadsheet, the header row is used to name new fields).

How to mission.do - 164

Step 2. Next, map the Fields of the destination Object to columns in the uploaded spreadsheet by selecting the desired spreadsheet column from the drop-down list on the right of each Field. You can also select Not mapped to not populate a field, or Field default if the Field has a default value for new records that you want to use when the records are created (by default this will not happen automatically). mission.do makes a best guess at automatically selecting field mappings based on the column headers in Row 1, but it is up to you to verify and change mappings as needed.

For Lookup Fields, select a spreadsheet column with a unique string value or numeric ID. The system will find corresponding records with matching record name value or ID number and attach them if found. To map more than one value to a lookup field, include record names or IDs in double quotes such as 123456,789101. You can import complex data structures with Primary Keys (PK) and Foreign Keys (FK) and replace the PK FK with mission.do relationships. For example, you may have a database of Vendors (with FK) and database of Products (with FK pointing to PK). To import this data structure and preserve those relationships, you can: 1. 2. 3. 4. 5. 6. 7. Create a Vendor Object definition. Create a text field to hold the Vendors PK. Make sure to give this field the Do not allow duplicate values in this field attribute. Import Vendors from a CSV file and populate the PK Field (among others). Create a Product Object definition with a text field to hold the FK. Create a many-to-one relationship between Products and a Vendor. Import Products from a CSV file. When importing, map the FK field to the unique PK field in the Vendor Object (see above). If you no longer need FK and PK fields, delete them. mission.do replaces them with internal IDs.

For picklist fields, mission.do tries to find existing picklist values with integration code or a display name that matches the value in the spreadsheet. If it cannot find one and Create new picklist items during import checkbox is checked (see below), it creates a new picklist value.

How to mission.do - 165

If you regularly import data from spreadsheets with the same structure, you may want to save your import data map for future use. To do so, click the Save Map button and enter the maps name. Step 3: Select the Import Mode: Normal: Runs all triggers on creation of new records and creates picklist values while importing rows. This mode is best for medium-size imports. Test: Limits your import to the first five records and displays a detailed report. Use this mode to test out your mapping before launching large imports. Bulk: Optimized for faster processing of large imports. In this mode triggers are not executed and new picklist values are not automatically created. Check Create new picklist items during import box if you want the system to create new picklist items during import (checked by default, not available in Bulk mode). Step 4. Click the Import button to start the import process. Small files (less than 20KB) are processed immediately, with results displayed on the next page. For large imports, mission.do creates a job and places it into a queue for asynchronous processing and then sends an email to you with results of the import once the job is completed. This message includes a report detailing successfully imported records and errors encountered during the import process.

How to mission.do - 166

The import report starts with a timestamp indicating when the import process started (due to the queuing mechanism, there may be a delay between when you submit the import and when it actually begins). Next, the results of each of the first five spreadsheet rows are displayed, by line number: Started at 06/21/2010 06:16 PM 2: Import error: Field Permit No. cannot accept null values 3: Permit "Test 1" has been created 4: Permit "Test 2" has been created 5: Import error: Error importing data for mechanical_cost Field: For input string: "1200-1300" 6: Import error: Error importing data for electrical_admin Field: multiple points

How to mission.do - 167

Updating and Deleting Records from a Spreadsheet


Updating records from a Spreadsheet

If you want to update existing records using the import mechanism, include a column with a unique identifier for the existing mission.do record in your spreadsheet, so the system can accurately find the record you wish to update. This could be the ID value of your records, or the value of any text field with the Do not allow duplicate values in this field. property (see Chapter 2. Basic Concepts for more details). Select this unique field in Step 1. Follow the steps in Section 2.1 above, except click the Update existing records using unique fields radio button. In Step 2, be sure to map the selected unique field to the corresponding spreadsheet column. This field is only used to find existing records for updating. The remainder of the process is identical.
Update or Create Existing Records

This mode is similar to Update mode described above, but when a record with specified unique identified does not exist, the importer will create a new record rather than post an error message.
Delete Existing Records

This mode is used to delete existing records whose unique key matches mapped values in spreadsheet.

How to mission.do - 168

Creating an Object from a Spreadsheet


In mission.do you can combine Object creation with importing to do both in a single wizard-based process. Before starting, determine the singular and plural names for your new Object, as well as other Object attributes (see Chapter 2. Basic Concepts for more details). Next, create the spreadsheet you wish to import in XLS (Microsoft Excel) or Comma-Separated Format (CSV) format. Step 1. Begin the process with the steps to create a new Object: click the + sign to the right of the Applications tabs, or go to Application Setup > Objects and click the New Object via Spreadsheet link. In the Create dialog box, click the A new Object (with Tab) from a Spreadsheet radio button option. On the A New Object from a Spreadsheet: Create Object screen, browse for and select the spreadsheet for import, enter the Singular and Plural Names for your new Object definition and choose the desired Object properties and attributes.

How to mission.do - 169

Click the Create Object button to create your new Object with the selected names and attributes. Step 2. For each spreadsheet column (identified by its header name on the left), select what to do with it: Map spreadsheet columns to an existing field. Create a new field and import a columns data into that field. In this case, select the fields type and display label (the system will use the columns header by default). For text fields, you can check the no duplicates box. Discard the spreadsheet column (i.e. do not use it).

Use the checkbox to indicate whether or not to allow duplicate values.

Step 3. mission.do will create new fields (in addition to the fields automatically created from Step 1). Next, the data import will proceed the same way as described in previous sections. You will see results on the screen (for small spreadsheets) or receive them in an email.

How to mission.do - 170

Data Format for Importing


The following table summarizes date formats expected by different field types.

How to mission.do - 171

Exporting from Views and Reports


mission.do provides export capabilities from Views and Reports. The header part of each View component contains links to export the Views records in XLS, CSV, or to a spreadsheet in Google Docs. The first two options are straightforward: all records and columns in the currently selected View or Report are exported and available for viewing in a separate window that can be a Microsoft Excel or your browser, depending on the client machines configuration. Important: Exports created in this way are limited to 1000 rows for performance reasons. Exporting to Google spreadsheets is covered in more detail in Chapter 13. Additional Application Tools: Advanced, along with other Google integration topics.

How to mission.do - 172

Chapter 10: Workflow and Triggers

How to mission.do - 173

Chapter Overview
This chapter introduces and explains mission.do Workflow and Trigger capabilities used to implement user driven and programmatic business logic in mission.do. Workflow enables a structured user-driven flow of records via the user interface, while Triggers define custom programmatic behavior either automatically based on changes in data, or at scheduled moments in time. We cover the following critical areas in detail: Workflow concepts including Processes, Statuses and Actions; types of actions; group actions and examples; Triggers; rules for running Triggers for complex updates; using Formulas for Triggers and actions; delayed and recursive Triggers.

How to mission.do - 174

Workow Concepts: Processes, Statuses and Actions


To use Workflow, you must first enable the Workflow attribute on the desired Object definitions when you create or edit that Object. This creates a default record Status (called Created) and a Workflow Process that you then can modify based on your specific needs. It is important to understand three basic Workflow concepts: Workflow Statuses: Indicate current state of a record. A current records status determines the set of currently available Workflow Actions. Workflow Action: An operation that a user can presently perform on a record. The action can change the status of a record, invoke one or more triggers, send an email, etc.

Workflow Process: A container for a set of statuses and actions, that as a whole makes up a particular workflow process.

The diagram above illustrates the basic concepts of a mission.do Workflow.

How to mission.do - 175

Workow Statuses

A status represents the current state of a record. Statuses are similar to picklist values, with a special meaning in Workflow. To define a new Workflow status, you specify: Display name (mandatory) Integration name/code (has the same meaning as it does in picklist values) Whether or not you want to automatically create a new corresponding Workflow Action to enable moving records into this new status. You can also provide a name for that new action (the status name will be used by default).

Statuses can be assigned through Workflow Actions, or explicitly by editing an Object record. When editing an object record, statuses are presented in sequential order. You can define this order by clicking the Reorder link in the Workflow Statuses section of an Object Definitions View Page.

Workow Actions

A Workflow Action represents a manual action such as a click or selection that can be performed on a record that changes the records status, sends an email, invokes a trigger, etc. mission.do supports several types of actions, as described in the sections below.
Status Change Action

This action changes the Workflow status of the current record. To create this Action select: New workflow status assigned as a result of this action Check if this action can be performed on group of records selected in List View Check if this action should be rendered as a button (rather than item in More Actions drop-down list) on Record View page. If this option is checked links to this action will be rendered using bold font to draw attention. Web page of type Status Change to display to the user when changing the status (this allows you to present fields for the user to complete or edit upon status change) Alternatively you can choose to run this action without using Status Change page, in one

How to mission.do - 176

click. Note: You can create any number of Status Change Pages and use them for different Workflow actions. You can place any editable field from the Object definition on these Pages. This allows you to update record various information at the time of a user-driven status change. In addition you can select deployed triggers to run when this Action is completed.

Related Record Action

This action creates a related record of the selected type using a conversion map to either create a record of a different object type or cloning of the current record if desired. To create this type of Action select: Web page of type New to create a record of selected type (this will be the page the user is taken to when the action is performed) Conversion Map to transfer fields from original record to the new one (see Chapter 8. Additional Application Tools to find out more about Conversion Maps) Record Template to create new record (this will be ignored if Conversion Map is selected)
Send Email Action

This action sends a template-based email using data from the current record. To create this Action select: Reply-To email address Destination email address or addresses and/or email address stored in the current record Optionally CC and BCC
How to mission.do - 177

Email Template to use

: You can also type in text and Formula fields which return valid email address. Alternatively, you can select the Email Template field to use (which gets its value from the record the action is working upon). Note: This action is only available if at least one email template exists for the current Object. In addition you can select deployed triggers to run when this Action is completed.

Template Document Action

This action generates a template-based document using data from the current record and presents this document to the user in a popup window. When used as a group action (see below), this action will merge documents from all selected records into one. To create this Action select: Document template to use Note: This action is only available if at least one document template exists for the current Object.

How to mission.do - 178

Run Triggers Action

This action runs a group of selected Triggers on the current record. To create this Action, select the Triggers to run and specify the order you want to run them in. Note: This action is only available if at least one Trigger exists for the current Object.

How to mission.do - 179

Common Action Properties


Every Workflow Action allows selecting: Whether this action is available for a group of records (see below) Whether this action should be rendered as a button rather than an item in a drop-down list Whether to change the records Workflow status(es) when the action is performed. A Formula that returns true or false. If the formula returns false, this action will not be available for the current record. Refer to Chapter 6. Server-side Code: Templates, Formulas and the mission.do Query API for more details on formulas.

You can reorder Workflow actions to set an order in which they appear in any list. Access to Workflow Actions can be limited only to certain roles or users. See Chapter 11. Security and Access Control for more about mission.do Access Control. The read-only field named Workflow Actions renders links to available actions. This field can be added to View pages and as a column in List Views. In addition, actions available to the current user for the current record are rendered in a drop-down box in the header of the View page, or as buttons if this option is selected:.

How to mission.do - 180

Group Actions

If you check the Group Action box for a particular Workflow Action, it becomes available for a group of selected records in List Views by selecting the action from the More Actions drop-down list. Group actions work the same as single record actions, as follows: Status Change: Changes statuses and updates fields on selected records. If the field value is not set, it will remain unchanged. Related Records: Creates related records for all selected records. Send Email: Sends emails using the selected records. Template Document: Generates template-based documents for selected records and merges them into a single document. Run Triggers: Runs one or more Triggers on the selected records.

If group workflow action has formula-based condition, selected records will be filtered by using that condition.
Workow Processes

A Workflow Process is a container for a group of Workflow Statuses and Actions, moving a record from one status to another. When the Workflow attribute is first set on an object definition, mission.do creates one Process named Default. In most cases all records follow the same Workflow and it is sufficient to have only one Workflow Process. To create a new Workflow Process, specify its name and select a Status to be used by default when this process is assigned to a particular record: Each status can participate in any process. To accomplish this, define a set of Workflow Actions available for the record in a particular process when this record reaches a given status. Use buttons to select the set of available actions as well as their display order. From the default status, Workflow actions can allow movement of a record into another set of statuses, etc. that implicitly determines how a particular Workflow Process is designed. You can reorder Workflow Processes to set the order in which they appear in any list Tip: When you have more than one process, you can use a Trigger to automatically assign the appropriate process to newly created records based on certain criteria (e.g. such as an orders amount value).

How to mission.do - 181

Triggers
mission.do provides a powerful business logic framework that enable automatic workflow. The object components that define business logic and behavior are called Triggers. You can create and configure any number of Triggers to perform automated and programmatic validation, notification, data manipulation and other activities upon record creation, update and deletion.
Triggers

NOTE: The Workflow attribute does not need to be set on an Object to create Triggers. When you create or configure a trigger, you select a timing option that determines when this trigger should run. Timing can be any combination of the following: Before Create After Create Before Update After Update Before Delete After Delete Tip: Timing is an optional setting. If you select no timing option, you still can use this Trigger in Workflow Actions of type "Run Triggers". When a record is created mission.do will: Create a new record without committing it into database. Run all Triggers with the "Before Create" timing. Create a new record in the database. Run all Triggers with the "After Create" timing.

When a record is updated mission.do will: Run all Triggers with the "Before Update" timing (please note that record is not updated at this point of time). Perform the actual record update in the database. Run all Triggers with the "After Update" timing.

When a record is deleted mission.do will:

How to mission.do - 182

Run all Triggers with the "Before Delete" timing. Move record to Recycle Bin. Run all Triggers with the "After Delete" timing.

All Triggers (unless specified otherwise) can be conditional. You can specify a formula that returns a boolean value. If the value is evaluated to false or null for a particular record, the Trigger will not run. For example, to run Triggers only for large orders, you could use a formula such as: {!amount} > 10000 Note: Note that a single line of JavaScript such as that shown above that evaluates to true, false, or null does not require a return statement. However, multi-line conditions such as those shown in upcoming examples do require a return statement. When defining a Trigger you can also specify: Integration name of the trigger. This can be used by the runTriggers API method (see Chapter 6. Server-side Code: Templates, Formulas and the mission.do Query API for more details). Whether to run this Trigger only when a particular field has changed its value (this will only affect After Update triggers).

You can use Template and Formula fields in this condition, allowing you to determine whether or not the trigger should fire based on changes to a group of fields instead of a single field. Whether or not this Trigger is deployed. Un-deployed Triggers will not run.

Important: You can select the order in which Triggers will run. Use the Reorder link in the Triggers section of an object definitions page to change the execution order of Triggers. Important: Running Triggers is subject to certain platform limitations, as explained below. If a trigger performs an update of an existing record or creates a new record, there is an option specifying whether dependent Triggers (before/after update, before/after create) should also run.

Important: Use this option with caution, since it may lead to inefficient nested trigger invocations.

How to mission.do - 183

Trigger Types

Each of the currently available Trigger types are described in the following sections. Send Email This Trigger sends an email based on an Email Template. Alternatively, you can select an Email Template field to use per record (this provides a way to dynamically determine which email template to use based on a field value in the record). Warning: You must create at least one Email Template for a given Object definition to create this type of Trigger. Apart from the common Trigger settings described above, you must select the recipient email address (and, optionally, CC and BCC recipients). This may be a specific address (you can use the popup selector to choose one), or an email address stored in one of the records fields (use the Use Field helper). You must also select the Email Template or Email Template field to use. Tip: You can also type in text and Formula fields which return valid email address. You can also specify whether the Reply To field in a trigger-generated email should contain the email address of the current user, the default auto-reply email address (defined in the Account Settings page), or explicitly specified email address. Create Activity Trail Record This Trigger creates a new Activity Trail (i.e. Audit Trail) entry based on a template defined by you and attaches it to the current or related record. To use this Trigger, select an Object (either the current records object type or that of a related record) and specify the template to populate the activity trail records text. Validate Record Data This Trigger validates the record's data using an expression. If the expression results in an error

How to mission.do - 184

(i.e. a non-null value expected as a String message), the data operation is terminated and an error message is displayed. This is similar to the situation where a Field validation fails when creating or modifying a record. To use this Trigger, provide a formula expression to validate. The formula returns a string error message when validation fails, or an empty string or null if the validation succeeds. For example: if ({!amount} > 100000) return "Order is too large: {!amount}"; else return null; Another example: if ("{!email}" == "" && "{!phone}" == "") return "Either email or phone must be specified"; else return null; Note: You can choose the Treat this trigger as a Warning option to allow trigger execution to continue even if there is an error message. In this case if validation fails at runtime the user will have a chance to check an Ignore Warning checkbox and proceed with saving data despite the warning. This is similar to custom field validation described in Chapter 2. Unique Fields Combination This Trigger validates that a certain combination of fields is unique across all records. If the combination is not unique (another record contains the same values for each of the fields specified here), the operation is terminated and an error message is displayed. To use this Trigger, select a combination of fields that must be unique and the error message to display (e.g., Author and title combination must be unique). Update Field Value This Trigger updates the value of a field in the current record or a related record using a formula. To use this Trigger select: A record to update: current or related record(s). A field to change (depends on the previous selection). Formula to calculate the new fields value: See below for expected return types. For example: ({!amount} > 1000) ? "Big Order" : "Small Order"); Important: If this formula evaluates to or returns null, the fields value will NOT be changed. In addition, the following options are available when configuring Access Control Policy: Most Trigger types do not check Permissions; however, the Update

How to mission.do - 185

Access Control Policy: Most Trigger types do not check Permissions; however, the Update Field Value Trigger (along with Change Workflow Status and Create New Record Trigger types described below) does check update and create permissions for the current user. When configuring a trigger of this type you can choose what mission.do should do when access is not allowed: Do nothing: (ignore permissions). Skip this Trigger: Do not run the trigger Throw an error: This will terminate entire update or create transaction. Dependent Triggers. Most Triggers do not result in running other Triggers; however, the Update Field Value Trigger (along with Change Workflow Status and Create New Record Trigger types described below) does have the option to run dependent Triggers after this one is completed by checking the checkbox called Run dependent triggers after this one is completed.

Warning: If you use this option, we highly recommended using the Trigger debugger (described below) to ensure expected results. The formula used in this Trigger must return a value that is used to update the selected field on the current or related record(s). The expected return value depends on the type of the field to be updated, as in the table below:

How to mission.do - 186

Example: Recording Date of Status Change Consider the following example: You want to record the date when the Workflow status was changed to Closed for reporting purposes. You can accomplish this as follows: 1. 2. 3. 4. Create a Workflow Status named Closed and assign it an integration code C. Create a Date field called Closing Date. Only add this field to the View page so it is essentially treated as a read-only field. Create a Workflow Action named Close which will change the status to Closed. Create a Trigger named Record Closing Date with following parameters:

This will complete the task. As soon as the Status is changed to Closed (regardless of whether this change was invoked by the Workflow action, manual record editing, another Trigger, API call or other source of change), the current date will be stored in as the Closing Date field. Change Workflow Status This Trigger changes the Workflow status of a record. To use this Trigger, select a target Workflow status. Use a Trigger Condition Formula to make this change optional. Also, refer to the notes in Section 3.1.5 Update Field Value above for more details. Note: You must create at least one Workflow Status before you can use this type of Trigger. Create New Record
How to mission.do - 187

This Trigger creates a new record from the current record using a Conversion Map. To use this Trigger, select a Conversion Map (which determines the type of the resulting record). Also, refer to the notes in Section 3.1.5 Update Field Value above for more details. Note: You must create at least one Conversion Map to convert the current record into another record to use this type of Trigger. Attach Related Record This Trigger attaches the current record to a Related Record (i.e. establishes a relationship between two Records). To use this Trigger select or define: Relationship between current Object and a target Object. Formula that calculates the ID of the related record (instead of a condition formula). If this formula returns a null or negative number, this Trigger is ignored.

Create Template Document This Trigger creates a template-based document for the current record and (optionally) sends it in an email as an attachment. For instance, you can use this Trigger to generate an Invoice and send it to a customer. To use this Trigger select: Document template or Template picklist field (which selects a document template based on the value of that field for a given record) to use. File Upload field where to store the resulting generated template-based document. Email template and email address to send resulting document (optional).

You can create a Document Template field that generates a new document each time you view it (see Chapter 2. Basic Concepts for more details). This Trigger is similar, but it generates and stores the template document in a particular field and its contents do not change even if other field values change). Run Triggers on Related Records Typically, Triggers do not invoke other Triggers; however, some Triggers offer an explicit option to do so. This Trigger type allows you to explicitly invoke Triggers with specified Timing options on related records. To use this Trigger select: Relationship between the current Object and a target Object (if the relationship is multiple, triggers will be invoked on multiple records). Timing option to on target object to determine which triggers to invoke (e.g., On After Update). Alternatively to Timing option you can explicitly select group of related triggers to run.

How to mission.do - 188

Alternatively to Timing option you can explicitly select group of related triggers to run.

Warning: If this Trigger is used, we highly recommend using the Trigger Debugger (described below) to ensure expected results. Object Script This Trigger type runs JavaScript allowing manipulation of multiple fields and records in one Trigger via server-side Query API calls. To use this Trigger, enter a formula that returns no value, but invokes one or more mission.do API calls (see Chapter 6. Server-side Code: Templates, Formulas and the mission.do Query API for more details on the mission.do API). The following example modifies the field amount and prints a message displayed in the trigger debugger: rbv_api.setFieldValue(invoice, {!id}, amount, {!amount}*(1-{!discount}/100)); rbv_api.print(amount after discount: + rbv_api.getFieldValue(invoice, {!id}, amount)); Warning: We recommend that only experienced mission.do developers use this type of Trigger. We also highly recommended using the Trigger Debugger (described below) to ensure expected results. You can use all power of JavaScript in Object Script triggers including flow control constructions. To terminate flow of Object Script trigger, as well as all subsequent triggers, and rollback entire transaction you can throw JavaScript exception: if (something_is_terribly_wrong) throw Cannot perform operation aborted; Send HTTP GET Request This Trigger sends an HTTP GET request to a specified URL. It can be used to send a REST-style request to a third party. To use this Trigger, select an Integration Link field (which includes a dynamically generated destination URL template). You can immediately debug your Trigger by selecting a record to run it on (click the icon). This sends the HTTP GET request to the generated URL and displays the results in a popup window. Result of HTTP GET request is stored in shared variables similar to POST request see below. Note: You must create at least one Integration Link field before you can use Triggers of this type. Send HTTP POST Request This Trigger sends an HTTP POST request to a specified URL. It can be used to send any XML (i.e. SOAP) or other POST request to a third party containing information and instructions gathered from mission.do record data. To use this Trigger, select:
How to mission.do - 189

from mission.do record data. To use this Trigger, select: A Document Template to generate the request with an .XML extension The target URL to send the HTTP POST request to The Content Type (text/xml by default) Up to 5 HTTP headers (names and values) Check if you want this Trigger to throw an exception if the HTTP return code is out of the range 200-210 indicating success.

You can immediately debug your Trigger by selecting a record to debug against (click the icon). This sends a generated HTTP POST request to the specified URL and displays results in a popup window. Note: You must create at least one Document Template with an .XML extension before you can use this Trigger. Important: The HTTP POST Trigger does not add a header or footer to your XML document. After the HTTP response is retrieved, this Trigger stores two values and makes them available for subsequent Triggers through the getSharedValue() API (see Chapter 6 . Server-side Code: Templates, Formulas and the mission.do Query API for details):

How to mission.do - 190

Rules and Restrictions for Running Triggers

As you can see from the above sections, Triggers can (and often are) used in combination with each other to form a group of business logic components, where one Trigger may invoke or rely on the results of others. To ensure that this process will not result in endless recursion that could potentially drain system resources, mission.do imposes several rules on Triggers execution: 1. The total number of Triggers invoked in a single update, create, or delete operation is limited to 100 for immediate Triggers and 20 for delayed Triggers (these numbers may vary for on-premises installations). 2. The same group of Triggers (e.g., "On After Update") will not run twice on the same record. 3. The same Trigger will not run twice on the same record. Tip: Use the Trigger Debugger window to verify how Triggers are actually being executed. See the sections below for more details.
Using Formulas for Triggers and Actions

Triggers and Actions use formulas to calculate conditions, field values, etc. Here are some recommendations and best practices for writing efficient formulas: 1. Use the return keyword only in complex formulas with intermediate variables. 2. Efficient: ({!amount} > 1000) Inefficient: if ({!amount} > 1000) return true; else return false; 1. 2. Avoid looping through related records. Use group functions instead (looping through related records can seriously affect performance). Avoid using explicit IDs for statuses and picklist items; use integration codes instead (this applies to template fields and formula fields as well). If your logic is based on IDs, when you publish your Application, these formulas and templates will be rendered useless because IDs of records, picklist values, statuses and all other components change from customer to customer (this is why you always want to use value and integration codes in formulas and templates).

How to mission.do - 191

Delayed and Recursive Triggers

If you would like this Trigger to not run immediately but instead be delayed relative to a particular date/time, you can specify delay criteria. Note: For delayed Triggers, the timing options "Before" or "After" are irrelevant. A Trigger can be delayed relative to the current time or value of any date or date/time field for the selected record. The Example above shows a Trigger that will run seven days after the last records update. You can also specify recursion criteria to run a particular Trigger periodically.

Debugging Complex Triggers

When you use a group of several Triggers that invoke Triggers on related records, it is critical that you use the trigger debugger to ensure expected results. To use the trigger debugger, simply click the Debug link in the Triggers section of the Object definitions page that displays a pop-up Debug window. To use the debugger, follow these steps: Without closing the Debug window, open any object tab. Perform an operation on a single record: Create, Update, or Delete. Come back to the Debug window and click the Refresh button. The debugger displays a trace of all Triggers that were invoked on the selected record as well as those invoked on related records. It also displays printouts from any rbv_api.print() API calls.

The following screenshot illustrates a debugging trace for both current and related records shown in the Debug window:

How to mission.do - 192

Debugging Delayed Triggers

Debugging delayed triggers has additional challenge since there is no one around then they run. The following considerations will be helpful: 1. 2. 3. 4. Always debug triggers in immediate mode first before turning on delayed option. Check Queue page to see when trigger is scheduled to run. Remember that Object Script on delayed triggers require permissions assigned to Query API role (see Chapter 11 for details). It is advisable to create Activity Log triggers for debugging purposes since regular Debug window is not available for delayed triggers.

Developing Custom Triggers

In addition to built-in trigger types explained in this chapter, customers of mission.do Private Cloud (see Chapter 18) can develop their own Custom Triggers using Java code designed for that purpose. Please contact mission.do for more info.

How to mission.do - 193

Chapter 11: Security and Access Control

How to mission.do - 194

Chapter Overview
This chapter describes the various security and access control capabilities built into the mission.do platform. This includes descriptions of: Default Security Levels Passwords, Authentication and Logins Portal Security The Private Attribute for Events, Tasks, Reports and Templates User Roles and Permissions Access Control Examples (for Objects, Workflow Actions, Views, etc.) Role-based and User-based) Page Versions and Assignments Field-Level Permissions Location/Department/Function (LDF) Permissions and Groups User Hierarchy and Hierarchy-based Permissions

How to mission.do - 195

mission.do Security Overview


The mission.do infrastructure is hosted in a secure server environment that uses firewalls and other security technology to prevent interference or access from outside intruders. When you access the mission.do service via HTTPS, Secure Socket Layer (SSL) technology protects your information using both server authentication and data encryption, ensuring that your data is safe, secure and available only to registered Users in your account. As long as your authentication information (username and password) are kept safe, your data remains inaccessible to unauthorized viewing and use. In addition, you can customize specific security settings and the Access Control Layer (ACL), each of which we will discuss in this chapter.
Default Security Levels

For convenience, security-related settings in mission.do are grouped into the concept of a Security Level. To change the Security Level of your account, access your account settings (Setup > Administration Setup > Account Settings), then click the Security Level drop-down list: mission.do supports three security levels, as described Low (default): Passwords must be at least 6 characters long. Passwords are case-insensitive. Block unsuccessful login attempts: Never # minutes of inactivity before expiring sessions: 720 # minutes of usage before forcing users to login again: 1440 # minutes to wait before expiring record locks: 240

Medium Passwords must be at least 8 characters long. Passwords are case-sensitive. # of unsuccessful login attempts before blocking user: 10 attempts; block for 30 min # minutes of inactivity before expiring sessions: 480 # minutes of usage before forcing users to login again: 720 # minutes to wait before expiring record locks: 60 High Passwords must be at least 8 characters long. Passwords must include at least 1 non-alphabetical character. Passwords are case-sensitive. # of unsuccessful login attempts before blocking user: 5 attempts; block for 60 min

How to mission.do - 196

# minutes of inactivity before expiring sessions: 240 # minutes of usage before forcing users to login again: 720 # minutes to wait before expiring record locks: 30

How to mission.do - 197

Passwords, Authentication and Logins


The following sections describe user passwords, authentication and login details.
Password Expiration

You can set a Password Expiration policy for your organization using the Account Administration page (see Chapter 14. Setup and Administration for details). By setting the Expiration Policy field to the number of days before password expiration, user passwords will expire after that number of days. mission.do will prompt the user to enter a new password during the next login attempt. Tip: Leave the Expiration Policy field blank to disable the password expiration policy. You can enable email notification prior to password expiration by editing the "Send Password Expiration Notification" trigger in the User object definition page. Check the Deployed box and select the number of days after the date of the last password update to send the notification message. The email template for that message can be customized the same as any other email template. Tip: You can create more than one notification trigger if desired.
User Authentication

mission.do provides each user in your organization with a unique user name and password that must be entered each time a user logs in. mission.do issues a session "cookie" to record encrypted authentication information for the duration of a specific session. The session "cookie" does not include the password of the user. mission.do does not use "cookies" to store other confidential user and session information, but instead implements more advanced security methods based on dynamic data and encoded session IDs. Requirements for user passwords depend on the Security Level, as described above. When a new user account is created, the system automatically generates a new temporary password and sends this password in a welcome email to the user. This password must be changed during the first login. Neither the administrator nor mission.do personnel have access to user passwords. To login as a regular user, the user is directed to the mission.do login Page: https://www.mission.do/router/login/login.jsp

How to mission.do - 198

WARNING: A user can have only one mission.do session open at a time. If a user logs in again in a different browser mission.do terminates any previously opened mission.do sessions (the only exception to this is API sessions).
Single Click Login

When mission.do sends emails with links to selected object records, these links can allow a single-click login under certain conditions. By clicking on that link, the user bypasses user name/password authentication and is taken directly to the record view page. To enable single click login, follow the steps below: Prepare an email template with a Link to View Page token such as {!#LINK.$APPROVAL} Make sure the email recipient fields uniquely identify a single user. This is possible if you have: -No CC or BCC addresses. -A single TO address. -No users with duplicate email addresses. If these conditions are met, #LINK URL is replaced with a specially constructed URL which allows single-click login when you send the email message. To increase security, further limitations apply: -The single-click URL will expire after 30 days. -The URL can be used only once. If any of the above conditions is not met, the user will be asked to provide a user name and password on the regular login page.
Portal Security

mission.do portals can use the HTTPS protocol if you select this option for a particular portal on the Portal Edit page. Portal pages can use Portal Visitors authentication via portal Login pages. See Chapter 12. Portals for more details. When you select the Portal Visitor attribute on an object definition, mission.do creates a a login name and password field to enable the visitor to login to the Portal. The password field allows two settings: Minimum password length. Password must contain both letters and digits.

How to mission.do - 199

Private Attribute
Calendar Events and Tasks, as well as Reports and Templates, provide an Is Private attribute that introduces additional visibility limitations: 1. 2. 3. Private reports are only visible to their creator and administrative users. Private email and document templates are only visible to their creator and administrative users. Private events and tasks are only visible their creator, users with direct relationships (assigned to) and administrative users.

Note: The Private attribute for Events and Tasks applies atop of all other View permissions (described in more detail below). It does not substitute them.

How to mission.do - 200

User Roles and Permissions


Managing User Roles

You can add a new role or edit an existing role using the Roles screen (Setup > Administration Setup > Roles or Apps > mission.do > Users > Roles). To define a new role, click the New Role link and specify: The Roles name for display purposes. The Roles Integration Code that is used in formulas and Triggers the same way as an integration name is used for picklist items and workflow statuses. A description of the role.

mission.do initially creates three system roles for you: Administrator: A system administrator has full access to all Objects and all customization features. Portal Visitor: Assigned to visitors of external-facing Portals, even if they are not actually mission.do users. Record Creator: Permissions assigned to this pseudo-role are granted to the user (or Portal visitor) whom has created a particular record.

Note: Create access is meaningless relative to this role, since you need to create a record first in order to be the creator. Query API: Used to check permissions in Query API calls when the current user is not authorized to perform an operation.

Tip: User-created Roles can be added to Applications and published along with other Application components, such as Objects. Publishing a Role will include permissions assigned to these Roles.

How to mission.do - 201

Role Based Permissions

The following permissions can be assigned by Role: 1. Administrative permissions: Manage (create, modify and delete) Views Manage Charts Manage Reports Manage Currency exchange rates Use Print, PDF, and Spreadsheet Export links (selected for all roles by default)

2. Permissions to access selected Applications from the Apps section on the mission.do sidebar. Warning: If a particular Role does not have access to at least one Application, a user with that Role will not be able to log in to mission.do. Note: If a particular Role has access to an Application, that Role will be given default access to newly created components of that Application unless you override this access. 3. Object permissions: View, create, edit and delete permissions per Object. In addition, you can assign Role-based permissions to access Views, Reports and Workflow actions to the Role. The list of Objects includes system entities that may be used in reports, such as Activity Trails, Comments and Login History records. 4.Menus (including sub-menus) access permissions. Note: A user has all permissions assigned to a users assigned Role. In addition, you can assign individual permissions to a particular user. Use the Permissions section on the Users View page (Setup > Administrative Setup > Users) to assign individual permissions. The detailed setting of all these permissions can be a tedious task, but it gives you full control over user access to all data in mission.do. To simplify navigation, the mission.do UI helps you: Filter Objects and menus by Application. Select a full set of permissions per Application. Select all or none of the lists of sub-items for Objects and menus.

How to mission.do - 202

When Permissions are Checked

mission.do checks permissions at the following times: 1. 2. 3. When displaying Applications and Menus available to the current user. When displaying a list of records in a View or Chart. If the user does not have access to certain records (because of relationship-based permissions or LDF), they will not be shown. When displaying a Page to View or edit a particular record. If the user is trying to access a record without authorization, mission.do displays an Access Denied error message:

4. When presenting a list of records to create relationships (either in a popup window or a drop-down list). 5. When displaying search results. The mission.do Query API requires that the current user or the surrogate Role Query API has full view access to all records of an Object type referenced in a method call. See Chapter 6. Server-side Code: Templates, Formulas and the mission.do Query API for more details. Note: When displaying links to related records, mission.do does not check permissions for the current user. Permissions will be checked, however, if the user tries to drill down on a related record by clicking on the link.

Component Permissions

Although you can set all Role-based permissions in one place, you can also set them on an individual Object, Menu, View, Report, or Workflow Action. The Setup pages to view and edit these components include a Permissions section. On an Object Definition, you can set view, create, edit and delete permissions: Important: in addition to Role-based permissions, you can assign individual permissions by user. Click on a users link anywhere it is available in the setup screens, click the Permissions tab and set the permissions as desired. On a Menu, View, Report, or Workflow Action component, you can set a single View (i.e. whether or not this component can be accessed) permission.

How to mission.do - 203

Tip: Limiting access to Views can be useful for limit user access to certain kinds of records, provided that the user does not have access to creating or editing Views. However, we do not recommend this approach. Using relationship-based permissions (see section 8.2 below) or Location, Department and Function (LDF) based permissions is more secure and reliable.

How to mission.do - 204

Access Control Examples


The following sections provide some helpful examples for configuring user access control.
Using the Record Creator Pseudo-Role

Consider the following example: Visitors to your Portal can create Request records, as well as browse and manage a list of their own requests. To achieve this access, set up the following permissions on the Support Request Object: To Portal Visitor Role: Create only To Record Creator pseudo-role: View, Edit and Delete

Assigning Permissions through Relationships

You can use relationships between a user and records to give that user access to related records only, rather than to all records of that type. You can assign Permissions through Relationships when editing Object-related permissions (or use the Permissions link on the Relationships section): Consider the following example: You want to limit the access of users in the Account Manager Role to Order records. There is a one-to-many relationship between User (called Owner for the sake of this relationship) and Order. To achieve this, give following permissions: To Account Manager Role: Create only To Owner relationship: View, Edit and Delete

Tip: For dependent records, such as Order Line Items in the example above, use Role-based permissions. This strategy works because the user can only access these dependent records through the parent record, access to which is controlled through the relationship.

How to mission.do - 205

Permissions through User Hierarchy

Permissions through relationships are only granted to the users with direct relationship to the record. However, in many business cases, users are in hierarchical relationships, such as manager-subordinate. In these situations it is unusual to give access to lower levels of the hierarchy without providing access to users higher up in the reporting structure. To solve this issue, mission.do provides a Hierarchy of Users relationship you can define: Direct Reports (multiple) and Reports To (single).

Field Level Permissions

You can also limit access to specific Fields for certain non-administrator Roles. On any Object View Page, click the Permissions link in the Fields table. From here, you can hide selected Fields from all Pages and Views by un-checking View, or show Fields but make them read-only on all Pages by checking Read Only.

How to mission.do - 206

Location/Department/Function Permissions
Location/Department/Function (LDF) permissions are the most complex mission.do permissions, used to cater to the security needs of larger organizations with more complex internal structures. Note: LDF is essentially a filter that is applied before Role-based and relationship-based permissions discussed above. Use of LDF-based permissions requires explicit understanding of this mechanism.
Getting Started with LDF

To use LDF permissions, install the Organization Management standard Application if it was not automatically installed when you created your mission.do account. This Application installs four Objects (with tabs): Locations Departments Functions Groups

Location, Department and Function represent three dimensions with a tree-like internal structure. When you install the Organization Management Application, these Objects come pre-populated with a set of base records. Tip: You can interpret LDF dimensions in any way that matches your organizations needs. For example, on any View Page for LDF dimension records, you can add a list of records of a certain type related to the current LDF record (e.g., a list of Users at a current Department). Check the Organization attribute for the Object on which you wish to enable LDF-based permissions: Then you can assign any or all LDF records to particular records of your Object.

Default Values for LDF Fields

We recommend that you only use the Organization attribute on your object definitions when it makes good business sense to do so. For instance, an Invoice object may have Organization attribute and be subjected to LDF access control, while Invoice Line Item may not (assuming
How to mission.do - 207

they are only accessible through the parent Invoice record). Assigning LDF attributes for all records can be a tedious task. To simplify it please keep in mind the following rules for assigning LDF attributes by default for new records: LDF lookup fields may use default LDF values assigned to the current user if this option is checked on the lookup Fields Edit page for that object. If new related record is created and LDF fields are absent from the New record page, LDF values from the parent record will be used by default.
LDF Groups: Creating and Assigning Users

The Organization Management Application also contains a Group Object that allows you to define combinations of LDF values as groups and assign one or more groups to users to create sophisticated organization-based permissions structures. First, define an LDF group by giving it a name and assigning any or all of the LDF attributes. Next, assign individual users to the group and/or assign (attach) groups to a particular user. Each group has zero to three assigned LDF dimensions. This means members of that group have access to all LDF records (regardless of their Object type) that match these dimensions (root node or any node below). Warning: A non-Administrator user whom does not belong to any group will have no access to any LDF records. Note: Within each group, attributes are connected by a logical AND. Groups themselves are connected by a logical OR. The special read-only Field named LDF Filter shows the exact access criteria for a particular user or LDF record. Tip: If you create a group without any LDF attributes, members of that group will have full access to all LDF records. Only users in that group or an administrator can access a record with no assigned LDF attributes. The following steps summarize actions needed to use LDF functionality: 1. 2. 3. 4. 5. 6. Install the Organization Management Application. Create records in the Location, Department and Function trees, as needed. Enable Organization attributes on desired Objects. Assign LDF attributes to your records. Define Groups for your users and assign LDF attributes to them. Use the LDF Filter Field to verify assigned permissions.

How to mission.do - 208

7.

From this point on, mission.do automatically checks LDF permissions to all LDF Objects and all users (except those with the Administrator Role) before checking all regular permissions (i.e. role-based, user-based and relationships-based).

From a mathematical perspective, each User Group defines a sub-set in a three-dimensional set of all LDF nodes that exist in a customer zone. From this perspective, one Group can consume another (if the root of the second group lies within first Group) and two groups can be merged (if they define the same and only one, dimension such as Location). Because of this, the LDF Filter can show fewer groups than those of which a particular user is a member. The user Object always has an Organization attribute, so you can assign LDF attributes directly to users. This does not grant any LDF permissions, as permissions need to be granted through Groups. Instead, these attributes can be used as the default when a particular user creates other LDF records. To enable this default behavior, check Use user's Location value as default for new records for the Objects Location lookup Field (similarly for its Department and Function lookup fields). Note: If you create a new LDF record as a child of another LDF record (e.g., Invoice Line Item) and do not assign any LDF attributes to that new record, it will inherit LDF attributes from the parent record (e.g. Invoice).

How to mission.do - 209

Chapter 12: Portals and Hosted Files

How to mission.do - 210

Chapter Overview
This chapter introduces mission.do Portals, portal pages, portal visitors setup and management, portal access control and login/authentication and recommended guidelines for planning and building Portals including configuring links to other portal pages within portals, assigning destination pages and working with page properties. It also covers the concept and usage of Hosted Files.

How to mission.do - 211

What is a mission.do Portal?


Portals are essentially external-facing web Applications that are built using the same tools and components as standard mission.do applications. However, Portals are different from normal mission.do applications in three significant ways: 1. Portals can be accessed by anyone with internet access, though they can be password protected with named accounts 2. Portals do not run within the normal mission.do user interface. Rather, they consist of a set of pages that are linked together to form a cohesive website 3. Portals can adopt the look and feel of any existing website where they can be embedded (in some cases portals can be used to power a domains entire website; for an example of this see http://www.geo30.com) Tip: Portals typically run as a part of a corporate website or intranet. They can be used to display dynamic lists of records and view record data, allow creation of records through custom forms and invoke triggers and custom business logic without requiring website visitors to have named mission.do user accounts. .

How to mission.do - 212

Managing Portals
To manage Portals in your customer zone, go to the Portal Setup Page (Setup > Applications Setup > Portals). Note: You can include any number of Portals with an Application and publish them as a part of an Applications XML (see Chapter 16. Publishing and Distributing Applications for more details). From this Page you can create a new Portal, edit or clone an existing Portal, set portal visitor permissions for Objects and managed hosted files. To create a new Portal, click the New Portal link and start by entering the following information: Portal Name: Give the portal a name you will remember it by Is Deployed?: Portal Pages are available for external access if they are used by deployed Portals; keep this box unchecked until the Portal is ready for use. Use HTTPS: Check this box if you want your portal to support HTTPS access (versus just HTTP, the default) Field-Level Help: If checked, Field-Level Help will be available upon clicking a ? icon next to fields Language: Select the language you want portal pages to be displayed in Date format: Select the date format to use in this portal when displaying and inputting dates Time zone: Select the time zone this portal should operate in; this causes all Date/Time field values shown in this portal to be adjusted accordingly Tip: Because each Portal visitor cannot select their own Language, Date Format and Time Zone the way regular users do, Portal-level settings will be applied for all portal visitors. Description: Provide a description for this portal Main Page: Select the default Page for this Portal (for new Portals, a Main Page will be created automatically). Login URL: Use this setting only for Portals embedded into other web sites that require authentication. This is the URL that portal visitors will be taken to when they login/logout

If you are planning to use this Portal as part of your website (rather than embedding it in one of your websites Pages using an HTML iframe), you will need to configure the Header and Footer here to adopt the look and feel of your site. If you do not already have HTML code to use for your Header and Footer, the best way to get started is by picking a Page on your site to use as a template. View the HTML source of this Page and remove any central content where you would like your Portal content to appear. All HTML code above this content should be used as your Header and all HTML code below should be used as your Footer.

How to mission.do - 213

Tip: You can choose to include the default Stylesheet named Portaltheme.css above the Header in each Portal Page. Some advice on how to build the Header and Footer of your Portal: 1. If any code in your Portal Header or Footer HTML contains references to external files such as images, JavaScript files, CSS files, or links to other Pages using relative URLs (such as "../images/myimage.gif", "../index.html", etc.), you will need to do one of the following: Switch to fully qualified URLs. In other words, always include the full path in your URLs such as "http://www.mycompany.com/index.html." Include the following tag in the <head> element of your header: <base href="www.mycompany.com"> where mycompany.com is your websites URL (i.e., the full path to the directory where your content can be found if the relative URLs were added to the end of it). This base tag tells any relative URLs to use the specified path as the root and is the only way relative URLs will resolve to the right domain. You can use JavaScript code and CSS styles in the Header and Footer, but make sure any URLs to externally referenced files are fully qualified as specified above. In addition, each JavaScript file and CSS file included must itself use fully qualified URLs if you are not using a base tag in your header. If you have enabled the HTTPS setting for this Portal, you either need to be using a base URL with HTTPS support, or you need to make sure that all of the images and files referenced in your Header and Footer have fully qualified HTTPS URLs. You can use merge fields in the Portal's header and footer, such as {!#CURR_USER.firstName}. See Chapter 6. Server-side Code: Templates, Formulas and the mission.do Query API for more details.

2. 3. 4. 5.

6.

7.

8.

When you finish creating settings for your Portal, youll find a URL to the Main Portal Page on the Portal View Page which looks something like this: http://www.mission.do/router/servlet/Portal?c=391197&p=469206&h=false&g=469208 You can change the main page by editing your portals settings. When you are ready to go live with your portal make sure it is marked as deployed and simply provide access to this URL from appropriate places on your website or intranet.

How to mission.do - 214

Creating Portal Pages


When you create a new Portal, mission.do creates a new empty Page and assigns it as the Portals Main Page. To add more Portal Pages, click the New Page link. For each new Page, complete the following info: Display name: Provide a unique name identifying this page Only logged in portal visitors can access this page: Check this box if you are creating a page that only authenticated portal visitors should be able to access (we will discuss how to set up portal authentication below) Page Type: Select the type of page to create from the following options: -Generic Page: An empty page in which you can embed list views (list of records of a specific object type) and arbitrary web content (HTML, JavaScript, etc) -Search Results Page: A page used to display the results of a search within a portal -Object View Page: A page to view a single record of a specific object type -Object Create Page: A page to create a single record of a specific object type -Object Edit Page: A page to edit a single record of a specific object type -Object Selector Page: A page shown in a popup window that is used to select related records when using a lookup field in a Create or Edit page -Login Form: A page specifically designed to allow portal visitors (i.e. Records of an object with the Portal Visitor attribute) to login and authenticate to a portal Object Type (not shown for Generic Pages): Depending on the type of page you selected above, you will be presented with different object types to select here that determine what type of object record(s) this page will be dealing with:

-If you selected a Login Form page, you will be presented with a list of objects that have the Portal Visitor attribute; in this way you are creating a login page for a specific type of portal visitor. -If you selected any page type other than Generic Page and Login Form, you will be able to choose from all available objects

Portal Pages can be shared among different Portals in your customer zone. When you create a new Page by clicking on the New Page link in a Portals View page, this new Page is automatically assigned to the selected Portal. Later, you can share that Page with other Portals by using the Assign Pages link.

How to mission.do - 215

How to mission.do - 216

Portals and Security


There is something to keep in mind when you consider security aspects of Portals: Portals can use HTTPS protocol if configured (see Managing Portals section above). Access to portal pages can be limited to authenticated visitors only. Rules for password authentication can be set when you edit Password field on Portal Visitor object: Minimum length of password Check if password must include both letters and digits Access rights for portal visitors are set for Portal Visitor role. These permissions cannot be relationship-based or include LDF filters.

As an additional security measure you can specify whitelist list of IP addresses to be checked when portal visitor logs in see Chapter 14 for details.

How to mission.do - 217

Planning and Building Portals


In addition to Portal-level settings, a Portal consists of a set of Portal Pages interconnected by links in any order you desire. This gives a developer greater flexibility than is available with normal mission.do application Pages. However, it also carries a greater responsibility, so planning your Portal strategy in advance is important. Warning: Building a sophisticated and easy to use Portal often requires significant knowledge of web design, HTML, CSS and JavaScript. It is often a good idea to start with a diagram that shows how visitors can navigate through the Portal Pages you intend to create.
Creating a Portal without Authentication

Consider the following simple Portal example, where a portal visitor can: Search a list of products View a list of search results View information on a selected product

To create this simple but fully functional Portal, take the following steps: 1. 2. Create a new Portal as described in previous sections that will generate the Main Page. Edit the Main Page and add a Text Search component to it (this will automatically be available in the Available Components section of the page editor), along with a template-based welcome message. Create a Search Results Page for the Product object. The system will place a list of Product components onto this Page for you automatically. Create a View Page for the Product Object. mission.do will place existing Product fields onto this Page by default automatically. Edit the Product View Page and remove or re-arrange Fields as needed. Create an HTML or Script component and, using the merge fields selector in the page editor, add links to the previously created Pages: Main Page and Search Results. Using these links, visitors can navigate through the Portal.

3. 4. 5.

How to mission.do - 218

You can create and edit Portal Links in the Page Editor to add explanatory text or images. 6. Finally, add permissions to view Product Object records to the Portal Visitor Role. Warning: Unless the proper permissions are assigned to the Portal Visitor role, visitors your Portal will not be able to view, edit or create records. Make sure to update the Portal Visitor role permissions when creating and deploying portals.

How to mission.do - 219

Creating a Portal with Authentication


Consider the following more complex example, where a Portal visitor can: Register for access to a Portal Login to that portal through login Page View his/her information Create comments View list of his/her own comments (but not comments created by other visitors)

To build such a portal you need to first create the following: An Object called Visitor with the Portal Visitor and Contact attributes. An Object called Comment with a Text Area field A OneMany Relationship between Visitor and Comment.

The next step is to create a Portal and several portal pages. The following diagram illustrates the required Portal Pages and the typical navigation between them. To create this Portal, create the following Portal Pages:

How to mission.do - 220

Portal Visitors and Security

Setting permissions for Portal Visitor objects requires careful planning to ensure that portal visitors cannot access information they are not supposed to. For the example from the previous section, you may have the following security requirements: Visitors can create, view and edit their own personal visitor information (i.e. their own record). Visitors cannot access personal records of other visitors. Visitors can create and view (optionally edit and delete) their own comments. Visitors cannot access comments created by other visitors

To satisfy these requirements you can set the following permissions on the Visitor and Comment objects:

In this design any portal visitor can create a new Visitor record this represents self-registration. But the View privilege is granted only to the Record Creator. This means that any authenticated visitor can only view her own personal record. If she tries to access data of another visitor shell be denied access.

How to mission.do - 221

Tip: You can assign permissions to the Record Creator pseudo-role from the Permissions section of an Object definitions details page.

How to mission.do - 222

Portal Page Properties


The Actions column in the list of portal pages offers the following choices: View: Preview the selected portal page in a pop-up window. For View and Edit pages you will be asked to select an existing record first Edit: Edit the selected portal page in the Page Editor Clone: Clone the selected page and edit the new page n the Page Editor Del: Delete the selected page (not available for the main portal page) Copy to: Clone the selected page and assign it to a different portal Properties: Set the selected Pages properties; available properties vary depending on the pages type (see below)

Page Properties allows you set the following type-specific page attributes:

How to mission.do - 223

Using URLs to Portal Pages


Templates used on portal pages may frequently use URLs to other portal pages. To simplify portal development mission.do provides UI helpers which for each page may generate: Pages URL Link to page Pages ID For Generic or List pages these tokens can be used in UI templates directly. However for View or Edit pages you need to add an ID of the record being edited or viewed (generic token does not include this info for obvious reasons). For that append URL id parameter to UI token {!#PORTAL.159007.159009#url}&id={!id} At run time this will be resolved into full records URL. Tokens pointing to portal pages can be used in email templates as well.

How to mission.do - 224

Hosted Files
As with most websites, in portals you often need to make use of and reference files such as images, Flash movies, JavaScript, CSS, etc. These files are typically referenced in web pages through <IMG>, <SCRIPT> and other HTML tags. mission.do provides a convenient way to host and reference arbitrary files through a mechanism called Hosted Files.
Creating Hosted Files

For example, using this feature, third party and custom JavaScript and CSS libraries can be uploaded and use by your portals to create a unique user experience and look & feel. Note: Hosted files can be included as part of published Applications just like other Application components (e.g. Portals, Objects, etc.) Note: Hosted files are most often used in Portal pages but can also be used in mission.do Object pages. To upload and manage hosted files, click the Hosted Files link in the Applications Setup page (Setup > Applications Setup > Hosted Files). For convenience, this link is also shown on each Portals details page. From the Hosted Files Page you can create, view, update and delete hosted files. To create a new hosted file, click the New Hosted File link, then enter the display name and upload the file. The size of a single uploaded file cannot exceed 5MB.

How to mission.do - 225

Note: To modify text-based Hosted files (JavaScript, HTML, XML) you can simply modify text on web page without uploading new file.

How to mission.do - 226

Using Hosted Files


You can prepare CSS Stylesheet with all tags used by mission.do UI (see Appendix D for details) and upload this CSS as Hosted File. In this case you could use hosted CSS to customize appearance of all pages in your Customer Zone. See Chapter 14 for details. You can reference hosted files using merge fields in various scenarios such as in Template and Formula fields, HTML and Script components in pages, as well as within email and document templates. In the Template Helper UI when editing any of these components, select the Hosted Files group and then select the merge field token corresponding to the desired hosted file and paste it into your template. Tip: JavaScript Hosted Files can be very useful in development of both client-side and server-side scripts. You can preview these files while working in Formula editor using drop-down list "View JS Hosted Files". The following table summarizes usage of merge field tokens corresponding to different types of hosted files:

Tip: Using hosted file tokens in email templates provide a convenient way to add email attachments. The following example illustrates the usage of hosted JavaScript files in server-side formulas (using the Filename[text] format described above). Assume you have created and uploaded a JavaScript file that contains:
How to mission.do - 227

function my_func(x, y) { return x+y; } You can create a server-side formula which uses this file by using the hosted files Filename[text] merge token and then invoking the function, as follows: {!#HOSTED_FILE.499203#text} my_func({!num1}, {!num2}); If you use the formula debugger to debug this formula, it will be parsed in the following form: function my_func(x, y) { return x+y; } my_func(100, 200); Important: When using JavaScript functions in server-side formulas, do not use a stand-alone return statement; doing so will cause an error. The result of the very last JavaScript statement (typically a function call) will be used as the formula result. Please see Chapter 6. Server-side Code: Templates, Formulas and the mission.do Query API for more details.

How to mission.do - 228

Chapter 13: Additional Application Tools: Advanced

How to mission.do - 229

Chapter Overview
This chapter introduces and discusses some additional tools and capabilities provided by mission.do such as multi-currency support, approval processes (sequential, parallel and tallied votes), record queues, surveys (online questions), integration with Google Apps (Gmail, Google Spreadsheets and Google Calendar), Google Maps and even Facebook.

How to mission.do - 230

Multi-Currency Support
mission.do supports conversion between monetary values in different currencies. It is common for businesses to keep their accounting books in one currency (let us call this the base currency), while sending and receiving money in several other foreign currencies. In addition, exchange rates between currencies tend to change over time. mission.do provides a multi-currency framework for all customers. To start utilizing multi-currency, follow the steps below:
Set Up Currency Codes

On the Currency Codes page (Setup > Administration Setup > Currency Codes), enter a list of currency names and currency codes you would like to support. Mark the currency used in your bookkeeping as the default by prefixing it with the symbol {D}. For example: {D}US Dollar|USD Note: Currencies are essentially shared picklist items (see Chapter 2. Basic Concepts for more details).
Set Up Exchange Rates

On the Exchange Rates page (Setup > Administration Setup > Exchange Rates), for each relevant date, enter exchange rates as decimal numbers between your selected base currency (typically your bookkeeping currency) and the other supported currencies you defined above.

Note: By entering the exchange ratio between one unit of foreign currency and one unit of base currency, the inverse is handled for you automatically. For example, defining a EUR/USD ratio as x also defines an USD/EUR ratio as 1/x. You can also use the SOAP API to store exchange rates. See Chapter 15. Integration and mission.do APIs: SOAP, REST and RSS for more details. If you will be using multi-currency capabilities on a daily basis you might consider building an automated integration with another web service to
How to mission.do - 231

retrieve exchange rates and populate them in mission.do for you. Note: To managing exchange rates user must have Administrator role or Manage Exchange Rates administrative permission.

Multi-Currency Attribute

Enable the Multi-Currency attribute on the desired Objects that adds two new fields: Currency Code, used to specify the type of currency for a particular record (e.g., Invoice) Rate Date, used to determine the date for the exchange rate calculation (current date by default). This field ensures that the exchange rate calculation for any given record does not change over time as the exchange rates change.
Money Amounts in Base Currency

You can optionally create a Base Currency field corresponding to each new or existing Currency field as desired. In this case the Currency field holds the actual currency amount (determined by the Currency Code field at the record level as explained above) and the Base Currency field holds a read-only amount that is the currency amount from the Currency field automatically converted into the base bookkeeping currency. The Rate Date field, as explained above, determines the date of conversion. For example, an Invoice record has the following field values: Currency Code: British Pound Rate Date: 05/25/2010 Amount (editable): 2000.00

How to mission.do - 232

Base Amount (read-only): $2,894.40

The exchange rate on 05/25/2010 is set to: GBP/USD = 1.4472. mission.do calculates and displays the value for the Base Amount (which is configured to use USD) as $2,894.40. The following diagram illustrates Multi-currency functionality: Note: Although the Base-Currency field is read-only, you can use it in Formula fields and Triggers, as well as to calculate totals in List Views and Reports. Important: Modifying an exchange rate on a particular date will not affect any Base Currency values that already have been calculated because, unlike Formula fields which are dynamically computed, Base Currency fields are calculated and stored in your database. However, when you edit and save an existing record, this value will automatically be updated using the currently available exchange rate corresponding to the assigned rate date.

How to mission.do - 233

Approvals
mission.do Approvals involve multi-step processes which you should be planned in advance to provide the best results. Tip: The Approval process starts when a particular record is moved to the Workflow status called Waiting for Approval, and ends when the record is moved to the status called Approved or Rejected. mission.do provides a default implementation for this process that you can customize, including the names of these statuses. To configure an Approval Process follow these steps:
Install the Approvals Application

Install the Approvals Application (Sidebar > Find Apps > Approvals) from the Application Directory. This application has a system Object named Approval. Each approval record contains the following information: A reference to the record being approved A reference to the user being asked to approve or reject that record (approver) The current status of this approval: pending, approved, or rejected
Select Approvers

Next, select a group of Users whom will participate in the Approval process. Make sure the Approver checkbox is checked for each of these Users in the User Edit page (if you do not see this box, use the Page Editor to add it to the Page).
Set Approval Attribute

Edit the Object you want to participate in the Approval process and enable the Approval attribute (which automatically enables the Workflow attribute if not previously enabled). This creates the following components: System statuses: Approval In Progress, Approved and Declined Workflow Action Type Start Approval Process, which is used to start an approval process on a particular record.

How to mission.do - 234

Set Up Approval Process

Edit this Start Approval Process Workflow Action to complete the configuration of the approval process: Assign the Start Approval Process action to a Workflow status. Typically use the default Status for your Workflow Process. Select a default list of approvers (this can be changed at runtime whenever the approval process is started on a record). Select an email template to be used to notify approvers that they have something to approve or reject. You will want to create this beforehand. Choose the Workflow Process to use this approval action in(typically Default) Choose the approval type:

Sequential: Approvers will be notified in sequence. The record will be rejected if any approvers reject it, otherwise it will be approved once all approvers approve it. Parallel: All approvers will be notified simultaneously and can submit their feedback in arbitrary order. The record will be rejected if one or more approvers rejects it, otherwise it will be approved. Tally votes: This works identically to the parallel approval process, but will continue until all approvers approve or reject the record. The record will be approved if a majority of the approvers approve it and rejected otherwise. Assign appropriate permissions to run the Start Approval Process action.
Customize Approval Process

To further customize an Approval Process you can: Create several Workflow Processes Create (by cloning) several Start Approval Process Actions to start them. Create several email templates as needed.

Once configured, your approval processes will operate as follows: Any user with sufficient permissions can invoke the Start Approval Process action for a selected record (or a number of records if the Group Action attribute is enabled). An email to the first approver will be sent (or all approvers for a parallel or tally votes process). The email should include a link to the record being approved, with one-click login (see Chapter 11. Security and Access Control for details).

How to mission.do - 235

Approvers will also see a list of records currently waiting for their approval in the My Approvals tab. After reviewing a record submitted for approval, the approver clicks the Approve or Reject button, where he/she can: Provide comments Click the Approve or Reject button If the record is approved, the sequential process will continue and an email will be sent to the next approver in the sequence. If the record is rejected, the approval process will end and the record will be moved to the Rejected status (any approver has veto power, except for the Tally Votes process described above). When all approvers have approved the record, it is moved to Approved status.

Tip: You can associate Triggers to run when a records Status is changed to the Approved or Rejected status. It is common to configure a Trigger to notify specific Users when a record has been approved or rejected using this technique.
Record Queue

This Record Queue feature is a type of Workflow process specifically tailored for situations in which a queue of records of a certain type need to be processed by a specific group of Users. mission.do automatically creates this Workflow process when you add the Queue attribute to an Object definition. Note: The Queue attribute will enable the Workflow attribute if not already enabled. When you enable the Queue attribute on your Object definition, mission.do will create the following Object components: Two new Workflow Statuses: In Queue and In Process. The former is assigned by default to the first Workflow Process of your Object. A Relationship between this Object and the User object (if not already created). A new Workflow Action named Start Processing with a Status Change Page (more details below). This Page assigns the current User to the record being updated. The Start Processing action is available for the In Queue Status and can be used for one record or a group of records.

How to mission.do - 236

Surveys and Quizzes


Surveys provide a way to quickly assemble groups of questions and process answers from users or portal visitors. Survey questions may include ranking criteria. This way surveys can be interpreted as online quizzes or tests. In more general terms surveys allow to associate different groups of fields with records of the same object. The diagram below illustrates the process of creating and taking a survey.

Creating a Survey Object

First create an Object definition with the Survey attribute. By default a tab created for this Object includes one extra menu called Questions. Tip: If you enable the Survey attribute on an existing object you can add the Questions menu to its tab.

Questions Library

Survey Questions form a shared library that can be used by any survey of any object type. Survey questions are grouped by categories. One category is available by default: Generic. You can create new categories and rename or delete existing categories.

How to mission.do - 237

Tip: You can only delete categories that have no questions associated with them. Click New Question next to a particular category to create a new Survey Question. Next select the type of question: Text: Users can enter any combination of characters. You can optionally define an input mask to enforce certain kinds of input. Text Area: Users can enter multiple lines of text. You can optionally enable a rich text editor so users can enter text as formatted HTML. Picklist: Users can select a value from a list of values defined by you. Picklist (Multi-Select): Users can select any number of values from a list of values defined by you. Radio Buttons: Group of radio buttons with mutually exclusive selection Checkbox: Users can select a Checked (true) or Unchecked (false) value. Group of Checkboxes: Group of checkboxes with multiple selections Currency: Users can enter a dollar or other currency amount. Date: Users can enter a date or pick a date from a calendar popup. Date/Time: Users can enter a date and a time, or pick a date from a calendar popup (when a date is selected from the calendar popup, that date and the current time are entered into the Date/Time field). Email: Users can enter an email address which is checked to ensure that it is a valid format. Integer: Users can enter any number (without decimals). URL: Users can enter any website address.

Next, select properties for your question that can be different for different types. For instance, Text questions have the following properties: Question label Short label Category (the list of categories can be managed from the Questions menu) Check if this question must be answered Check if you want to publish this question in any application which includes the Survey object Size of HTML input box Keywords: you can specify keywords and their ranking in the range from -1000 to 1000. A score calculator will award scores for specified keywords in the answer.
Assigning Questions to Survey

To create a particular instance of a Survey you need to create a record of a Survey object and give it a name. Then use the Questions section (created by default on each Survey objects View Page; use Page Editor to add this to a new section if you dont see it) to attach existing questions or to create new questions for this survey.

How to mission.do - 238

Using links in sections header you can: Create a new Question. Select from existing questions in a popup window and them (or a copy of them) to the survey. Reorder questions in your survey. Preview survey questions as theyll appear to the user taking the survey. Please note that questions are grouped by categories and ordered by the selected order number. Tip: You can attach questions from the library directly or create a copy (clone) of each question. In the latter case if you modify the selected question it will not affect the version in the Library. From the Actions column in the list of questions you can: Edit a survey question. Permanently delete a question from all surveys. Remove a question from the current survey.
Survey Pages and Links

When you create an object with the Survey attribute mission.do creates a special category of pages for that object called Take Survey. This page can be used to answer questions attached to a particular survey and can be edited and cloned just like any other mission.do page. You can access pages of this type from an object definitions page. Click on the Config link to configure page-level settings: Number of columns to display questions in (1, 2, or 3) Default Survey record used for this page

Now you can add a URL to your Take Survey page to any template on an Application or portal page using the Surveys section in the Template helper. The Survey Pages group in the Template helper provides you with a merge field token that will be resolved into the URL of the Survey page. You can use this URL in links or in an HTML button control. Tip: The URL to a Take Survey page may include the ID of a particular survey: &surveyed=123456 If that ID is not included the default Survey record (selected in the Config page) will be used.
Survey Takers

Both regular mission.do Users and Portal Visitors can take surveys. To enable someone to take a survey you need to make sure that User or Portal Visitor has the special object attribute enabled called Survey Taker.

How to mission.do - 239

The mission.do User object by default has the Survey Taker attribute. If for some reason the User object in your Customer Zone does not have this attribute, you can manually edit the User object and enable the Survey Taker attribute. If you wish to post your survey questions in a portal page, make sure to enable both Portal Visitor and Survey Taker attributes on the appropriate object. Tip: A portal visitor must be authenticated in order to take a survey. Surveys will only work in portals that have authentication enabled (this is required in order for mission.do to know whom is taking the survey).

Taking a Survey

Using the right link (as described above), an Application user or portal visitor can navigate to Take Survey page. There he/she will be presented a list of selected questions grouped in sections by category. Answers to survey questions are subject to validation rules similar to those for Object Fields: required questions must be answered, integer questions must be parsed as integers, etc. Finally the results of a survey are recorded and can be viewed along with the record of each Survey Taker. On the record View page you will find a Survey Answers component (use the Page Editor to add it if it is not automatically added to your View page). The Survey Answers component lists all surveys taken. For each survey it displays a list of questions and answers provided. If ranking criteria was set for a particular question, the system also calculates and displays an assigned score along with maximum and minimum possible scores. Tip: Minimum score is only used when negative ranking was specified. Otherwise the minimum score is 0. The object fields Survey Score and Rank (i.e. score as a percentage of maximum score) can be used to set up triggers (i.e. business logic and automation) related to surveys.
Using Surveys on Portals

Surveys in portals can be a useful tool to, for example, collect customer feedback. To add surveys to your portal: Make sure that your Portal Visitor object also has the Survey Taker attribute. Create a Survey object, survey questions and survey record (see above).

How to mission.do - 240

Use the Page Editor to add the Survey Answers component to the New and Edit pages of your Portal Visitor/Survey Taker object. Use the Config link on that Survey Taker page to select the Survey record to be used by that page.

Now when a visitor is created or updated, the portal page will display a list of survey questions. Answers to these questions will be associated with the visitor record and available on the View page. Tip: You can include a desired survey ID directly into the link to a survey page by adding the following additional URL parameter: &surveyId=12345

How to mission.do - 241

Google Apps Integration


mission.do provides seamless integration with Google Apps: Gmail (outgoing and incoming), Google Spreadsheets and Google Calendar. The following sections describe how each user can activate Google Apps integration, as well as how it works.
Gmail Integration: Outgoing Email

On the Personal Settings page (Setup > Personal Settings) you can provide credentials to your Google Apps account (individual or corporate) and select whether: Gmail (rather than mission.do email server) should be used to send emails for this User. Google Calendar should be synchronized when mission.do records with the Event or Task attribute (related to the current User) are created or updated. Important: To use Gmail integration, beyond providing your credentials you also need to do the following setup in Gmail: 1. Login to your Gmail account 2. Click Settings then click Forwarding and POP/IMAP tab 3. In the IMAP Access section make sure Enable IMAP is selected. Now if you provided the correct credentials and checked the Use Gmail checkbox, mission.do will use Gmail to send emails on your behalf. This means that you will now see all mission.do-generated emails in your Sent Mail folder. Also, when a recipient replies, Gmail will group reply message with your original message for convenience. Important: Whenever you are sending an email using Gmail integration, mission.do will display a reminder about it and give you a chance to test your Gmail connections to ensure that your stored credentials are up-to-date with your Google account.

How to mission.do - 242

Gmail Integration: Incoming Email

Once you have provided your Google credentials and enabled IMAP, you can also gain limited access to your incoming emails from within mission.do. mission.do will read your Google inbox and display your messages there. The messages are ready dynamically and you cannot interact with them, nor are they stored in mission.do. Tip: If you do not see the Gmail tab in your default mission.do application use the Page Editor and add the Incoming Emails (Gmail) component to any Generic page. The list of messages in your Gmail inbox displays the senders email address, as well as the subject and date of the email. Unread messages are shown in bold and starred messages have a star as you would see them in your Gmail account. This list is sorted by date in descending order and can be scrolled back and forth. From the Message View page you can: Star/Un-star the message by clicking on the star icon. Use the button in the upper right corner to create a Communication Log record from this message and attach that record to a selected mission.do record (user, customer, etc.) or to record found by email address in incoming email message. Use the button in the upper right corner to delete the email message (move it to the Trash folder in your Gmail account).

Tip: mission.do will try to match the email addresses in a message to the records in your zone. If a match is found, mission.do will display a link to the matched record. Tip: If a message in your inbox was originated by mission.do and relates to a particular data record (such as an Invoice) mission.do will resolve this and display a link to that record (see Related To field in the above screenshot). This is generally true even if the original message was replied or forwarded before landing in your mailbox.

Google Spreadsheets Integration

If you have provided valid credentials to your Google account, you will have an option to export your Views as Google Spreadsheets (along with XLS and CSV see Chapter 3).Simply click on the Google link. All of the data in your View will be displayed as a new Spreadsheet in your Google Documents. In this way you can have all of the convenience of Google Spreadsheets to work with and analyze your data, including the ability to share your data with other users whom may not necessarily have access to your mission.do applications.

How to mission.do - 243

Google Calendar Integration

You can also synchronize Events and Tasks in your mission.do calendar (see Chapter 2 for details) with your Google calendar. To do so first make sure that the Synchronize these events checkbox is checked by editing each Object definition you want to enable this on:

Second, make sure that Synch Calendar box is checked on your Personal Settings page (see Section 6.1 above). From this point on mission.do will automatically update your Google calendar every time an event assigned to you is created or updated. Tip: You may need to refresh your Google calendar to view the result of synchronization with mission.do calendar. Tip: To synchronize your events with other calendars such as Microsoft Outlook mission.do provides the capability to export your Event and Task records in the standard iCal format. Click on the Synchronize link (make sure iCal File field is present on your Event or Task View page). Outlook will read data from your event or task record and prompt you to create a record in your calendar.

Google Maps Integration

You can use Google Maps to visually represent a location associated with a record of an object with the Location attribute. A Google Map will automatically be rendered by a UI component which will be added to the View page by default (when you select the Location attribute) or by using the Page Editor. The Google Maps component will render a map of the records address as shown here:

How to mission.do - 244

You can configure the Google Maps component to select: Height of component in pixels (it will take 100% of available width by default) Default zoom level (can be changed at run time) Default maps type (street, satellite, etc.; can be changed at run time)

How to mission.do - 245

Facebook Integration
mission.do also includes built-in support for Facebooks social plug-in: the Like button. Over the course of time we plan to support the Facebook API to enable tighter integration between mission.do and the Facebook platform.
Adding a Like Button

You can add a Facebook Like button to your Portal pages easily (Generic, View, Login and List of records) by dragging the Facebook placeholder from the list of Available Components on the left and dropping it into your Portal page. Then use the Config link next to your page to select various options for your Facebook button: URL to Like: Portals main page (default option) Portals current page Manually specified page (corporate home page, etc.) Buttons layout (see examples below) Option to show profile pictures below the button Width in pixels on the screen Verb to display (Like or Recommend) Font to use Color scheme (light or dark)

Examples:

How to mission.do - 246

Chapter 14: Setup and Administration

How to mission.do - 247

Chapter Overview
This chapter introduces and explains those setup and administrative features not covered during Application Setup discussions in previous chapters. These include Personal Setup, Administrative Setup, Localization and Support services. It covers the following critical areas in detail: Transfer ownership of records, company-wide settings, localization and batch jobs. This chapter is a must-read for administrators, developers and advanced users.

How to mission.do - 248

Personal Setup
Personal Setup is the only setup feature available for non-administrator users, allowing them to change their personal settings and preferences, accessible through the Personal Setup Page (Setup > Personal Setup). The following table describes Personal Setup Fields.

How to mission.do - 249

Tip: An administrator user can customize the Personal Settings Page that may (and should) look different than the User Edit Page. The second Personal Setup option available to all users is the Change My Password Page. To change their passwords, users must type in the old password and new password (twice). The new password must conform to password requirements selected for the current customer zone (see Chapter 11. Security and Access Control for more details).

How to mission.do - 250

How to mission.do - 251

Administration Setup
The Administration Setup Page allows administrator users to manage run-time activities not related to Application development (Setup > Administrative Setup). This Page contains the following sections: User Administration: Allows you to manage System-Wide Settings (see 3.1 below) as well as Users and their Roles (also available from the Users tab in the default mission.do Application). This section also contains a link to the Transfer Owners feature that allows you to move records from one user or users to another.

Account Administration: Allows you to manage currency codes and exchange rates for your company. Also manages whitelist of IP addresses.

Backup: Allows you to manage system backup files.

Batch Jobs: Allows you to manage scheduled jobs for email reports, automating backups via FTP and automating export of a specific subset of data via FTP.

System Jobs: Displays run-time information about large jobs (such as a spreadsheet import) running in asynchronous mode.

Portal Visitors Online: Displays a full listing of all currently active portal visitor sessions.

System Events Log: Shows important customer-related logs, including information about Application installation and deletion, large data imports, etc.
Company-Wide Settings

Use this feature if you want to manage a set of custom fields that represent system or customer-wide properties (rather than object-specific properties) that can be used in a number of areas throughout all your applications such as Templates and Formula fields and can be conveniently changed from one central location. Examples of such fields may be tax rate, your marketing slogan, etc. To utilize Company-Wide

How to mission.do - 252

settings, follow the steps below: 1. Use the Configure button (Setup > Administrative Setup > Settings > Configure) to define these Fields. 2. Use the Edit button (Setup > Administrative Setup > Settings > Edit) to set/modify values for these Fields. 3. In templates and formulas, use the Helper group of tokens and then select the Settings Field you want to use. Tip: If you use Settings fields in your Application, dont forget to include the Settings Object in your Application before publishing it.
Transfer Owners

Use the Transfer Owners feature to change relationships between one selected user and records of another type to a different user. Click the Transfer Owners link and select: Relationship: Select one or more relationships between the User Object and other Objects (ownership of accounts, cases, etc.) that youd like to change Current Owner: Select the user youd like to reassign records from New Owner: Select the user to assign the records to

mission.do will replace the current owner with the new owner for the selected relationships. Warning: There is no easy way to roll back these changes, other than editing each record one-by-one. Do not use this feature for temporary reassignments.

How to mission.do - 253

Account Settings

This link will take you to the mission.do Support Portal, where you can change some settings for your Customer Zone (Account) and customize some aspects of your mission.do appearance (colors, sidebar components, etc). The following table summarizes the meaning of Fields that can be modified.

How to mission.do - 254

Backup

mission.do is fully managed Software as a Service (SaaS) Application that means you generally do not need to worry about backing up your data or other disaster recovery Applications. However, you can protect yourself from inadvertent data loss (e.g. mistakenly deleted records, objects, Applications, etc.) by regularly exporting all of your data stored in mission.do. To create and download a backup file containing all record data in your account, use the Backup link on the Administration Setup Page (Setup > Administration Setup > Backup). You can either create a new System Backup file, or download an existing (previously created) backup file. Important: mission.do keeps up to 7 copies of the most recent backup file(s). You can create only one backup file per 24 hour period for performance reasons. Creating a backup file may take some time. This process runs in a queue in asynchronous mode.

How to mission.do - 255

You will receive an email when the backup is completed and ready to be downloaded. A full backup is a ZIP file that contains: All system tables with data from your customer zone as CSV files (one CSV per Object definition) All uploaded file attachments associated with File Upload and Image Upload fields Click the Download link to download a copy of your full backup. Note: You can ask mission.do Support to restore your data from particular backup file. That will erase all changes made since backup file was created. mission.do
Batch Jobs

This option allows you to setup and monitor jobs that run periodically for system maintenance (similar to Cron Jobs in Oracle). To create a new batch job, click on the Batch Jobs link and then the New Batch Job link and select one of the following available types as described in the sections below.
Data Maintenance

This job runs specified Object Script with mission.do client-side API (see Chapters 6 and 10 for details) on each record of selected type.
System Backup

This job generates a System Backup file (see above). Optionally, it may upload a backup file to a remote FTP server.
Generate Report

This job runs the selected report and sends it as an email attachment to the specified recipient.
FTP Data Snapshot

This job takes a snapshot of an Objects data using a selected View and uploads it via FTP to a remote server in CSV, XLS, or XML format. Apart from job-specific settings, each job should specify: Display name Starting date Period to run (24 hours minimum) Deployment status

How to mission.do - 256

Localization

Date Formats: Every user can choose a format for Date and Date/Time fields using the My Settings Page. The available date formats are listed in the table below:

A date format can also be set: Per customer zone (to be used as the default date format when no user selection was made or not available, such as when a system-generated email is sent) Per Portal (used in portal pages when displaying date and date/time values)

Note: In addition to Date Format, a user (customer or portal) can select a Time Zone. mission.do re-calculates all date/time values to match the users selected time zone before they are displayed.

Currency Formats

Every Currency field and every Formula field that returns a value of type Currency allows selection of a currency format to use (this field-specific format is used for all users). The available Currency formats are listed in the table below:

How to mission.do - 257

Note: If your Object supports the Multi-Currency attribute you can create a Base Currency Field that corresponds to each Currency Field to automatically calculate that fields value in the base foreign currency. You can also select the Base Currency format. See Chapter 13. Additional Application Tools: Advanced for more details

Multi-Lingual Support

mission.do supports several languages: English German Spanish French Dutch Portuguese Chinese (simplified) Japanese Korean

The following steps explain the concept of multilingual support in the mission.do platform: 1. When you submit a request for a mission.do trial, you can select: The base language for new Customer zone Additional languages supported in that customer zone Later, you can add/change additional languages based on the service level youve selected by editing your companys Account Settings Warning: We do not recommend changing the Base Language setting once selected. Be sure to choose it carefully.
How to mission.do - 258

2. Each user can select their preferred language on the My Settings Page that affects the language used to render all text on each Page. Users can select either the base language of the company or any of the additional languages supported by it. If no selection is made than base language for Customer zone is used. 3. All component names used by Application (Object names, Field labels, Action names, etc.) can be stored both in the base language and additional languages (marked on the right of the text box). Warning: The first entry is always in the zones base language regardless of the current users language setting. Tip: When you publish a localized Application, your translation will be preserved and installed in the destination customer zone. 4. When a customer zone has one or more additional languages available, selected text fields can be translated to all these languages. To enable this feature check the This field allows storing multiple values for supported languages box on the Field edit/create Page (see above). In this case, text fields will allow entering data in both the base language (always the first input field displayed) as well as additional supported languages. For example: The value shown when viewing a record is selected based on the users selected language preference (if multiple values are stored). The table below shows how both the Application resource file values (field label) and the localized data are used depending on the users selected language setting:

For picklists, you can provide translated item values after the item text in the base language separated by a colon: Big: Grand Medium: Moyenne Small: Petite Localization for picklists is intentionally disabled when creating a new picklist, because mission.do requires that you create each item in the base language first before defining localized values localizing them.

How to mission.do - 259

String Tokens

Templates can include String Tokens which will be replaces by localized text during parsing. To select/create String Token use link in Token Helper component: Next select existing String Token (it will be copied into Select Merge Token box) or create a new token and specify its text in available languages. Note: Selected String Tokens will be published and installed as part of mission.do application - please see Chapter 2 for more info.

Translation of mission.do Resources

Each language supported by mission.do is managed in a resource file for that specific language allowing easy improvement of translations throughout the platform. The default translation of each mission.do string resource is machine-assisted and far from perfect. If you are proficient in a language supported by mission.do you are invited to volunteer to improve any of our default translations. Upon request, we will email you the resource file in one of the supported languages listed above. When working with mission.do resource files, below are some important rules to follow: 1. Do not try to deal with entire file at once it is too big (about 3000 lines). Try to fix only strings you really care about first, or take a phased approach. Do not use automated translation tools. 2. The file has the format token = value and each line contains exactly one token-value pair. This structure must be preserved: __Please_select__ = -- Please select -3. Do not alter the token, as this will render the translation useless. Only translate the value portion as follows: __Please_select__ = - S'il vous plat se l ectionnez -4. Many string values contain special placeholders such as {0}, {1} etc. These placeholders should not be altered, though they can be moved to a different location within the value. At runtime these placeholders will be replaced by actual pieces of data: _related_child__0__ = (related child {0}) _related_child__0__ = (enfant lie {0})

How to mission.do - 260

5. Some string values contain HTML formatting tags such as <b> or <div>. These tags should not be altered; only the text inside should be changed: _0__equals__b__1___b_ = {0} e gale <b> {1} </ b>

Translation of Application

Although names of applications components (objects, menus, etc.) can be translated on respective edit pages, this process may not be convenient. To translate entire application at once you can use Translate option from More Actions drop-down on Application View page. Select foreign Language available for your Customer Zone and click Download link to download all string resources used in your Application as a single XLS file. That file has the following format:

Do not modify content of first 5 columns (that may render spreadsheet useless) and only change translations in the last column using text in column E as a reference. The same rules as for mission.do resources apply. When you done save XLS file on your local disk, go back to Translation screen and upload XML file (make sure correct language is selected). Uploaded resources will be stored in your Application. Note: Re-publish your Application or re-create XML after uploading new translation.

How to mission.do - 261

Chapter 15: Integration and mission.do APIs: SOAP, REST, RSS and JDBC

How to mission.do - 262

Chapter Overview
This chapter discusses how to programmatically access mission.do for integration and extension purposes via several supported Web Service APIs: SOAP, REST, RSS and JDBC. It provides detailed explanations and code examples demonstrating how to effectively use each API. This chapter is a must-read for developers building integrations or external data manipulation tools that need to communicate with mission.do programmatically.

How to mission.do - 263

SOAP API
The mission.do SOAP API is designed to enable integration between the mission.do platform and external systems via standards-based SOAP calls. In order to use this API, the client must have a valid mission.do user account with login credentials user name and password. These credentials must be supplied as parameters to the login method, the first SOAP call to mission.do that is required to establish an API session. This call will return a session id that must be used as the first parameter in all subsequent API calls. To end an API session, the logout method should always be used. The mission.do SOAP API uses the same permissions mechanism as the standard mission.do user interface. API users must have permission to view, create, update, or delete records in order to perform these actions via API calls. Permissions cannot bet set via the API. They can only be set by an Administrator using the mission.do user interface in the Setup area. To protect mission.do resources from overuse, the number of API calls is limited. The number of calls (hits) is counted over a 24-hour period for each mission.do customer and then reset the next day. The actual number of allowed API hits is based on your subscription. You can find this information in the Support > Subscription Info Page. Please contact mission.do Support if you need to increase this limit for any reason. Note: Changes in triggers, views etc. may not immediately affect Web Services and REST servers. There may be up to 1 hour latency period due to caching mechanism. Note: Most of the Web Services APIs include code samples written in Java using the Axis package.
Working with Field Data: the DataField Container

When working with records using the mission.do SOAP API, you use a special container called DataField. This serves as a container for data stored in a single record field and includes the following attributes: Integration name (mandatory): Integration name of the field the data belongs to. Data value: Actual data that belongs to this field in this record represented as string. The string format depends on the type of the given field: For check boxes: true or false, yes or no For numeric fields: Numeric value as decimal string For single picklists: External (i.e. integration) code of the selected item or item name For multi-select picklists: External codes of the selected items or item names separated by the | symbol For lookup fields: Numeric IDs or names (must be unique) of related records separated by

How to mission.do - 264

the | symbol For date fields: Date string in the format corresponding to the current users date format preference. Example: 05/01/2009 For date and time fields: Date-time string in the format corresponding to the current users date format preference. Time zone for this string is the same as time zone selected in the current users preferences. Example: 05/01/2009 1:00 PM is interpreted as 05/01/2009 1:00 PM PST, if the current user has the PST time zone setting.

SOAP API Documentation

login Performs a user login and initiates an API session. This method must be called prior to any other API call.

logout Terminates the specified API session. This method should be called to explicitly end each Web API session.

Usage sample URL url = new URL("http://www.mission.do.com/webapi/services/rpcrouter");

How to mission.do - 265

RpcrouterSoapBindingStub binding = (RpcrouterSoapBindingStub) new IWebServicesServiceLocator().getrpcrouter(url); binding.setTimeout(60000); String sessionId = binding.login("username", "password"); System.out.println("loginsuccessful: sessionId="+sessionId); // Perform some API calls binding.logout(sessionId);

getObjectDefNames

Retrieves an array of Object Definition integration names. Usage sample StringArr arr = binding.getObjectDefNames(sessionId);

getObjectDef

Retrieves a full description of a mission.do Object Definition as an XML document. Usage sample String xmlData = binding.getObjectDef(sessionId, "lead"); Example of XML output: <DataObjectDef objDefName="USER" > <SingularName>User</SingularName> <PluralName>Users</PluralName> <Description>System user 555</Description> <DataFieldDefs> <DataFieldDef fieldName="actions" groupName="WORKFLOW" dataName="FieldDummy"
How to mission.do - 266

isRequired="no" isReadOnly="yes" maxLength="0" > <DisplayLabel>Workflow Actions</DisplayLabel> </DataFieldDef> <DataFieldDef fieldName="assignedTo" dataName="FieldRelationship" isRequired="no" isReadOnly="no" maxLength="0" > <DisplayLabel>Users</DisplayLabel> </DataFieldDef> <DataFieldDef fieldName="createdAt" groupName="STANDARD" dataName="FieldDateTime" isRequired="yes" isReadOnly="yes" maxLength="-1" > <DisplayLabel>Created At</DisplayLabel> <Description>Created At</Description> </DataFieldDef> <DataFieldDef fieldName="createdBy" groupName="STANDARD" dataName="FieldLong" isRequired="yes" isReadOnly="yes" maxLength="-1"> <DisplayLabel>Created By</DisplayLabel> <Description>Created By</Description> </DataFieldDef> <DataFieldDef fieldName="CUSER" groupName="USER" dataName="FieldRelationship" isRequired="no" isReadOnly="no" maxLength="0> <DisplayLabel>Subordinates</DisplayLabel> </DataFieldDef> <DataFieldDef fieldName="useHtmlEditor" groupName="USER" dataName="FieldBoolean" isRequired="no" isReadOnly="no" maxLength="0" > <DisplayLabel>Use HTML Editor</DisplayLabel> </DataFieldDef> </DataFieldDefs> <RelationshipDefs> <RelationshipDef relName="USER_GROUP" objDef1="$GROUP" objDef2="USER" /> <RelationshipDef relName="USER_comm" objDef1="USER" objDef2="COMMLOG" /> <RelationshipDef relName="ORG_CHART" objDef1="USER" objDef2="USER" /> <RelationshipDef relName="assignedTo" objDef1="meeting" objDef2="USER" /> </RelationshipDefs> </DataObjectDef>

How to mission.do - 267

textSearch

Performs a full-text search in the mission.do database. The search query has the same syntax as that used in the standard mission.do interface. For more information on search syntax, see the mission.do User Guide or the online Help system. Usage sample LongArr arr = binding.textSearch(sessionId, "John Smith", "lead"); long[] ids = arr.getArr();

detailedSearch

Performs a detailed search throughout the customers mission.do database. This is equivalent to the search capabilities provided by the mission.do UI. SearchFilter is used to define a single search filter (there can be up to 5 per search).

How to mission.do - 268

Usage sample SearchFilter[] filters = new SearchFilter[1]; SearchFilter filter = new SearchFilter(); filter.setFieldName("firstName"); filter.setOpCode("EQ"); filter.setOpValue("Smith"); filters[0] = filter; SearchFilterArr filterArr = new SearchFilterArr(filters); LongArr arr = binding.detailedSearch(sessionId, null, "lead", filterArr, "AND", null); long[] ids = arr.getArr();

How to mission.do - 269

getUpdated

Retrieves an array of record IDs of a specified Object type that were either created or updated within the given date/time interval. Usage sample Calendar from = Calendar.getInstance(); from.setTime(...); Calendar till = null; LongArr arr = binding.getUpdated(sessionId, from, till, "lead"); long[] ids = arr.getArr();

getDataObj

Retrieves all Field data (including formulas) for a given record. Usage sample long id = 123456; DataObj obj = binding.getDataObj(sessionId, id, true); if (obj != null) { DataField[] fields = obj.getFields(); }

How to mission.do - 270

getDataField

Retrieves the value of a single field from a specific record. Usage sample long id = 123456; DataField field = binding.getDataField(sessionId, id, "lastName", false); if (field != null) { String lastName = field.getValue(); }

How to mission.do - 271

getBinaryData

Retrieves the binary data (file attachment) associated with a particular file Field from a specific record. Usage sample long id = 123456; ByteArr arr = binding.getBinaryData(sessionId, id, "picture"); if (arr != null { byte[] data = arr.getArr(); }

How to mission.do - 272

getRuntimeStatus

Retrieves runtime status of customer zone on Web API server. Usage sample int status = binding.getRuntimeStatus(sessionId, 123456);

getRelationships

Retrieves an array of related record IDs. Usage sample long id = 123456; LongArr arr = binding.getRelationships(sessionId, id, "R76543"); if (arr != null { long[] ids = arr.getArr(); }

How to mission.do - 273

getIdByCode

Retrieves the ID of the pick item or status by integration code. Usage sample long id = binding.getIdByCode(sessionId, "lead", "type", "HOT");

getCodeById

Retrieves integration code of pick item or status by ID. Usage sample String code = binding.getCodeById(sessionId, "lead", "type", 98765);

How to mission.do - 274

selectQuery

Runs SQL SELECT query on the server and returns results as 2D-array. The SELECT query used in this method consists of the following parts: The SELECT statement expects columns or expressions to be selected (mandatory). Use the Field integration names as SQL column names. You can use expressions such as COUNT(1). You cannot use * to bring all columns. The FROM clause must consist of exactly one object name (mandatory). The WHERE clause can include a valid SQL expression to narrow the selection (optional). Use Field integration names as SQL column names. The ORDER BY clause can include a valid SQL expression to order the selection (optional). Use Field integration names as SQL column names. You can use special tokens in your queries such as: TODAY for current time WEEK for 12PM of last Sunday MONTH for 12PM of 1st day of current month QUARTER for 12PM of 1st day of current quarter YEAR for 12PM of 1st day of current year CURR_USER for id of currently logged in user Note: Object and Field names are case-sensitive, while other components of the SQL query are not. Examples of valid queries on the USER object: SELECT id, name, updatedAt, updatedBy FROM USER WHERE name LIKE 'M%' ORDER BY name SELECT count(1) FROM USER WHERE name LIKE 'M%'

How to mission.do - 275

SELECT count(1) FROM USER WHERE updatedBy>=QUARTER Important: The selectQuery methods as well as selectValue and selectNumber use the same permissions model as the server-side query API (see Chapter 6. Server-side Code: Templates, Formulas and the mission.do Query API for more details). Either the current user or the API User must have View access for all records of the given type. Usage sample StringArr2D values = binding.selectQuery(sessionId, "SELECT loginName, firstName, lastName FROM USER ORDER BY lastLogin DESC", 10); StringArr[] recs = values.getArr(); for (StringArr rec: recs) { String[] data = rec.getArr(); String loginName = data[0]; String firstName = data[1]; String lastName = data[2];

selectValue

Runs a SQL SELECT query on the server and returns a single string value as the result. Usage sample // Login name of last login user (one value) String loginName = binding.selectValue(sessionId, "SELECT loginName FROM USER ORDER BY lastLogin DESC");

How to mission.do - 276

selectNumber

Runs a SQL SELECT query on the server and returns single decimal value as the result. This is simplified version of selectQuery suitable for calculating sums etc. Usage sample int count = binding.selectNumber(sessionId, "SELECT count(1) FROM USER WHERE name LIKE 'M%'");

create

Creates a new record. Usage sample // Populate data Fields to be set for new record DataField[] Fields = new DataField[5]; DataField Field = new DataField(); Field.setName("firstName");
How to mission.do - 277

Field.setValue("John"); Fields[0]=Field; Field.setName("lastName"); Field.setValue("Smith"); Fields[1]=Field; // Call create API binding.create(sessionId, "lead", new DataFieldArr(Fields), true);

createArr

Creates an array of new object records. This API will increment the hits counter per each array element. createArr (and updateArr described below) take arrays of transport Objects of type DataObj wrapped in DataObjArr instance. This transport Object carries: Object name Record id (for update only) Fields to be set This is a convenient form for transporting data. The following snipped code explains how to use this API: Usage sample // Array of transport objects to be sent to createArr DataObj[] arr = new DataObj[10];

How to mission.do - 278

// Populate data Fields to be set for record 0 DataField[] Fields = new DataField[5]; DataField Field = new DataField(); Field.setName("amount"); Field.setValue("1000"); Fields[0]=Field; // Create record 0 DataObj obj = new DataObj(); obj.setObjDefName("lead"); obj.setFields(Fields); arr[0] = obj; // Repeat for record 1 // Call createArr API binding.createArr(sessionId, new DataObjArr(arr), false);

createCustomer

Starts process of creating a new customer zone. Welcome email will be sent to first admin user when process is completed. Usage sample DataField[] arr = new DataField[6]; arr[0] = getField("companyName", "API Test"); arr[1] = getField("email", "myemail@mycompany.com"); arr[2] = getField("lastName", "Admin");
How to mission.do - 279

arr[3] = getField("loginName", "myemail@mycompany.com"); arr[4] = getField("timeZone", "Pacific/Guam"); arr[5] = getField("mailSender", "noreply@mycompany.com"); binding.createCustomer(sessionId, new DataFieldArr(arr), true);

update

Updates an existing record. Usage sample // Populate data Fields to be updated for existing record DataField[] Fields = new DataField[5]; DataField Field = new DataField(); Field.setName("R34567"); Field.setValue("100088,100089"); Fields[0]=Field; // Call update API long id = 123456; // Record id - required binding.update(sessionId, id, new DataFieldArr(Fields), true);

How to mission.do - 280

updateArr

Updates array of existing Object records. Note that this method will increment the API hits counter for each array element. Usage sample // Array of transport objects to be sent to updateArr DataObj[] arr = new DataObj[10]; // Populate data Fields to be updated for record 0 DataField[] Fields = new DataField[5]; DataField Field = new DataField(); Field.setName("amount"); Field.setValue(1000); Fields[0]=Field; // Update record 0 DataObj obj = new DataObj(); obj.setId(123456); // Required for update obj.setObjDefName("lead"); obj.setFields(Fields); arr[0] = obj; // Repeat for record 1 // Call updateArr API binding.updateArr(sessionId, new DataObjArr(arr), false);
How to mission.do - 281

updateCustomer

Update customer zone. Usage sample DataField[] arr = new DataField[1]; arr[0] = getField("companyName", "API Updated Test"); binding.updateCustomer(sessionId, 123456, new DataFieldArr(arr), true);

How to mission.do - 282

setDataField

Sets the value of a single Field for a specified record. Usage sample // Populate data Field to be set for existing record DataField Field = new DataField(); Field.setName("R34567"); Field.setValue("100088,100089"); // Call setDataField API long id = 123456; // Record id - required binding.setDataField(sessionId, id, Field, true);

setBinaryData

Sets the binary data (file attachment) associated with a particular file Field from a specific record Usage sample // Read binary data byte[] data; long id = 123456; ByteArr binData = new ByteArr(data); binding.setBinaryData(sessionId, id, "pdfData", "Application/pdf", "invoice.pdf", binData);
How to mission.do - 283

How to mission.do - 284

setRelationships

Assigns an array of related records to the specified record. Usage sample long id = 123456; long[] arr = new long[] { 100890, 100891 }; binding.setRelationships(sessionId, id, "R1223456", new LongArr(arr));

delete

Moves the specified record to the Recycle Bin. For users and customer zones deletes records permanently. Usage sample long id = 123456; binding.delete(sessionId, id);

How to mission.do - 285

deleteArr

Moves the specified array of records to the Recycle Bin. This method will increment the hits counter for each array element. Usage sample long[] ids = new long[] { 123456, 123457 }; binding.deleteArr(sessionId, new LongArr(ids));

getExchangeRate

Usage sample Calendar today = Calendar.getInstance(); today.setTime(new Date()); double rate = binding.setExchangeRate(sessionId, "EUR", "USD", today);

How to mission.do - 286

setExchangeRate

Sets the exchange rate between two currencies on a given date. Usage sample Calendar today = Calendar.getInstance(); today.setTime(new Date()); binding.setExchangeRate(sessionId, "EUR", "USD", today, 1.2823);

How to mission.do - 287

REST API
The mission.do REST API is designed to enable integration between the mission.do platform and external systems via REST calls. In order to use this API, the client must have a valid mission.do user account with login credentials: username and password. These credentials must be supplied as parameters to the login method, the first REST call to mission.do that is required to establish an API session. This call will return a session ID that must be used as the first parameter in all subsequent API calls. To end an API session, the logout method should always be used. The mission.do REST API uses the same permissions mechanism as the standard mission.do user interface. API users must have permission to view, create, update, or delete records in order to perform these actions via API calls. Permissions cannot bet set via the API; they can only be set by an Administrator using the mission.do user interface in the Setup area.
login

Performs a user login and initiates an API session. This method must be called prior to any other API call. Output example: <?xml version="1.0" encoding="utf-8" ?> <resp status="ok"> <sessionId>rest-433533393144236162</sessionId> </resp> Important: Subsequent API calls which utilize sessionon ID are considered to be made from behalf of logged in user. Permissions of that user are checked for each sunsequent call. For instance, to update a record logged in user must have sufficient permissions, of API call will fail.

How to mission.do - 288

logout

Terminates the specified API session. This method should be called to explicitly end each Web API session. Output example: <?xml version="1.0" encoding="utf-8" ?> <resp status="ok"> </resp>

getObjectDef

Retrieves the full description of a mission.do Object Definition as an XML document. The XML schema for this document can be found at: http://www.mission.do/webapi/wsdl/objectDescription.xsd Output example: <?xml version="1.0" encoding="utf-8" ?> <resp status="ok"> <DataObjectDef objName="person" > <SingularName>Person</SingularName> <PluralName>Persons</PluralName> <Description>Person</Description> <DataFieldDefs> <DataFieldDef FieldName="mobilePhone" groupName="CONTACT" dataName="FieldString" isRequired="no" isReadOnly="no" maxLength="50" > <DisplayLabel>Mobile Phone</DisplayLabel> <Description>Mobile Phone</Description> </DataFieldDef>

How to mission.do - 289

</DataFieldDefs> <RelationshipDefs> <RelationshipDef relName="person_comm" objDef1="person" objDef2="COMMLOG" /> </RelationshipDefs> </DataObjectDef> </resp>

header

<link rel='stylesheet' type='text/css' href='http://www.mission.do/rest/css/main.css' /> <script language='JavaScript' src='http://www.mission.do/rest/js/main.js'></script>

search

Performs a full-text search in the customers mission.do database. The search query has the same syntax as that used in the standard mission.do interface. See Chapter 3 for more information on search query syntax. Output example: <resp status="ok"> <ids> <id>314452</id> <id>128003</id> </ids> </resp>

How to mission.do - 290

selectQuery

Runs SQL SELECT query on the server and returns results as 2D-array. Example: query to run select id, firstName, lastName from lead oder by updatedAt desc startRow=0 maxRows=2 Output example in XML format: <?xml version="1.0" encoding="utf-8" ?> <resp status="ok"> <row> <col>131227</col> <col>Bill</col> <col>Smith</col> </row> <row> <col>131228</col> <col>John</col> <col>Roth</col> </row></resp> Output example in JSON format: [ [ 131227, "Bill", "Smith" ],

How to mission.do - 291

[ 131228, "John", "Roth" ] ]

selectValue

Runs SQL SELECT query on the server and returns results as single value. Output: first element returned by query wrapped in XML. Example: <?xml version="1.0" encoding="UTF-8"?> <resp status="ok"> <value>53</value> </resp>

How to mission.do - 292

selectNumber

Runs SQL SELECT query on the server and returns results as single number. Output: first element returned by query converted into number and wrapped in XML. Example: <?xml version="1.0" encoding="UTF-8"?> <resp status="ok"> <value>53</value> </resp>

How to mission.do - 293

getCount

Retrieves total number of records in a View (see Chapter 3 for more info on Views). Output example: <resp status="ok"> <count>100</count> </resp>

getPage

Retrieves specified range of data records in View. Selected View defines sorting and filtering of output. Output example in XML format (no recursive output for related records): <?xml version="1.0" encoding="utf-8" ?> <resp status="ok"> <data id="131227" objName="person"> <Field name="firstName">Bill</Field> <Field name="lastName">Smith</Field> </data> <data id="131228" objName="person"> <Field name="firstName">John</Field>
How to mission.do - 294

<Field name="lastName">Roth</Field> </data> </resp> Output example in JSON format (no recursive output for related records): [ {"objName": "lead", "id": 131227, "firstName": "Bill", "lastName": "Smith" }, {"objName": "lead", "id": 131228, "firstName": "John", "lastName": "Roth" } ]

getUpdated

Retrieves an array of record IDs of the specified Object type that were either created or updated within the given date/time interval.

How to mission.do - 295

Output example: <resp status="ok"> <ids> <id>314452</id> <id>128003</id> </ids> </resp>

getDataObj

Retrieves all Field data (including formulas) for a given record in XML format. Output example for core record: <?xml version="1.0" encoding="utf-8" ?> <resp status="ok"> <data id="131227" objName="person"> <Field name="id">131227</Field> <Field name="club_member">false</Field> <Field name="lastName">Smith</Field> <Field name="status">Created</Field> <Field name="updatedAt">20110111T143331Z</Field> </data> </resp> Output example for core and related record (composite parameter set to 1): <?xml version="1.0" encoding="utf-8" ?>
How to mission.do - 296

<resp status="ok"> <data id="131227" objName="person"> <Field name="id">131227</Field> <Field name="club_member">false</Field> <Field name="lastName">Smith</Field> <Field name="status">Created</Field> <Field name="updatedAt">20110111T143331Z</Field> <Field name="R986">131228,131229</Field> <composite> <data id="131228" objName="payment"> <Field name="amount">500.00</Field> <Field name="paym_date">20110115T143331Z</Field> <Field name="R986">131227</Field> </data> <data id="131229" objName="payment"> <Field name="amount">450.00</Field> <Field name="paym_date">20110116T143331Z</Field> <Field name="R986">131227</Field> </data> </composite> </data> </resp> Composite output is generated recursively in tree-type structure. The following rules apply: 1. Maximum level of recursion is provided as URL parameter. 2. Each data record is included in the output only once. 3. No more than 1000 total data records are included in output. 4. objNames input parameter can be used to explicitly set list of output data objects.

How to mission.do - 297

getDataField

Retrieves the value of a single Field from a specific record. Output example: <?xml version="1.0" encoding="utf-8" ?> <resp status="ok"> <Field name="status">Created</Field> </resp>

getBinaryData

Retrieves the binary data (file attachment) associated with a particular file Field from a specific record.

How to mission.do - 298

getRelationships

Retrieves an array of related record IDs. Output example: <resp status="ok"> <ids> <id>314452</id> <id>128003</id> </ids> </resp>

getIdByCode

Retrieves the ID of picklist item or status by providing its integration code.

How to mission.do - 299

getCodeById

Retrieves integration code of picklist item or status by providing its ID.

create

Creates a new record using data from XML document. Input example: <?xml version="1.0" encoding="utf-8" ?> <data objName="person" useIds="false"> <Field name="club_member">false</Field> <Field name="lastName">Smith</Field> <Field name="status">Created</Field> </data> Output example: <resp status="ok"> <data id=314452/> <Msg>12 fields have been processed.</Msg> </resp> Apart from creation a single record this API can also be used to create set of dependent records. To do that incluse "composite" XML node which wraps a set of "data" XML nodes as described above. New record will be created for each "data" XML node. These new nodes will have relationship with with core record. Consider example with dependent nodes: <?xml version="1.0" encoding="utf-8" ?>
How to mission.do - 300

<data objName="person" useIds="false"> <Field name="club_member">false</Field> <Field name="lastName">Smith</Field> <Field name="status">Created</Field> <composite> <data objName="payment" useIds="false"> <Field name="amount">500.00</Field> <Field name="paym_date">09/12/2011</Field> </data> <data objName="payment" useIds="false"> <Field name="amount">450.00</Field> <Field name="paym_date">09/22/2011</Field> </data> </composite> </data> This XML will create one person record and two related payment records in one call. Output example: <resp status="ok"> <data id=314452/> <Msg>12 fields have been processed. 2 related records have been created.</Msg> </resp>

create2

Creates a new record using data from HTTP parameters. Note: names of URL parameters used by this API are integration names of your fields. If field is not found, the system will ignore URL parameter.

How to mission.do - 301

Input example (URL parameters): &objDefName=person&useIds=false&club_member=false&lastName=Smith&status=Created Output example: <resp status="ok"> <data id=314452/> <Msg>12 fields have been processed</Msg> </resp>

update

Updates an existing record data from XML document. Input example: <?xml version="1.0" encoding="utf-8" ?> <data id="314452" useIds=false> <Field name="club_member">false</Field> <Field name="lastName">Smith</Field> <Field name="status">Created</Field> </data>

How to mission.do - 302

Output example: <resp status="ok"> <Msg>12 fields have been processed.</Msg> </resp> Like create API update can be used to update several related records in one call. To do that incluse "composite" XML node which wraps a set of "data" XML nodes with valid id attributes as described above. Records corresponding to for each "data" XML node will be updated. These updated nodes will have relationship with core record. Consider example with dependent nodes: <?xml version="1.0" encoding="utf-8" ?> <data id="314452" useIds=false> <Field name="club_member">false</Field> <Field name="lastName">Smith</Field> <Field name="status">Created</Field> <composite> <data id="314453" useIds="false"> <Field name="amount">500.00</Field> <Field name="paym_date">09/12/2011</Field> </data> <data id="314454" useIds="false"> <Field name="amount">450.00</Field> <Field name="paym_date">09/22/2011</Field> </data> </composite> </data> This XML will update one existing record and two related records in one call. Output example: <resp status="ok"> <data id=314452/> <Msg>12 fields have been processed. 2 related records have been updated.</Msg> </resp>

How to mission.do - 303

update2

Updates an existing record data from HTTP parameters. Note: names of URL parameters used by this API are integration names of your fields. If field is not found, the system will ignore URL parameter. Input example (URL parameters): &id=314452&useIds=false&club_member=false&lastName=Smith&status=Created Output example: <resp status="ok"> <Msg>12 fields have been processed</Msg> </resp>

setDataField

Sets the value of a single Field from a specific record. Output example: <?xml version="1.0" encoding="utf-8" ?> <resp status="ok">

How to mission.do - 304

<Msg>amount field has been updated</Msg> </resp>

setBinaryData

Sets the value of a single File Upload Field from a specific record. Output example: <?xml version="1.0" encoding="utf-8" ?> <resp status="ok"> <Msg>Field resume has been updated on John Smith</Msg> </resp>

How to mission.do - 305

delete

Moves the specified record to the Recycle Bin. Output example: <resp status="ok"> <Msg>Record has been deleted</Msg> </resp>

bulkCreate

Creates records from a bulk CSV upload.

How to mission.do - 306

bulkUpdate

Updates records from a bulk CSV upload.

bulkCreateOrUpdate

Updates existing records or creates new records from a bulk CSV upload.

How to mission.do - 307

bulkDelete

Deletes (moves to Recycle Bin) group of specified records.

How to mission.do - 308

RSS
Real Simple Syndication (RSS) allows mission.do users to receive notifications about new and updated Object records through RSS readers without logging into the mission.do service manually. RSS feeds of a particular object are based on a specific View that must be available for the current User. Records from that view can be mapped to an RSS feed and read by external RSS readers (Google Reader, MS Outlook or a mobile device). RSS does not support username / password authentication. Rather mission.do uses the following mechanism to protect your data via RSS: mission.do will create a unique session ID for each RSS subscription that is only known to the subscriber (stored in the RSS reader). By default the RSS feed only includes the records name and description. To get more information, the user will have to login into mission.do.

To use RSS feeds click on the Subscribe: RSS link (Setup > Applications Setup > Integration) that displays a list of all RSS sessions created for the current user. Select an Object for which you want to receive RSS feeds. First, map Fields from that Object to standard RSS Fields: Title, Published Date and Description. Tip: mission.do will choose default Fields for you, but you can change the mapping. Tip: If you want to display more information for each records, such as addition fields, etc, it is common practice to create a Template field that presents all of the data you want to publish and map the RSS Description article to that field. Next, you can create an RSS session by choosing the View to which you would like to subscribe.

How to mission.do - 309

How to mission.do - 310

JDBC Driver
The mission.do JDBC driver is currently an experimental project, with the intent to allow external programmatic access to a customers mission.do database through REST HTTP calls wrapped in the convenient and familiar JDBC mechanism. You can download the mission.do JDBC Driver from the Application Setup > JDBC Driver page. Note: The current implementation is limited to SELECT queries only. You may be interested in the sample Java program included in the distribution ZIP file for an example of how to use the mission.do JDBC driver. In SQL queries run through mission.do JDBC Driver you can use objects integration names as table names and fields integration names as columns. Examples of valid queries: SELECT COUNT(1) FROM invoice SELECT id, name, amount FROM invoice WHERE amount>0

How to mission.do - 311

Chapter 16: Publishing and Distributing Applications

How to mission.do - 312

Chapter Overview
This chapter introduces and discusses topics related to managing, publishing, distributing mission.do Applications so they can be installed into other customer zones. It covers the following critical areas in detail: Application as a container for Objects, Tabs, Portals, Seed Records and Hosted Files; fixing publishing errors; approval for published Applications; installing Applications from the Application Directory; and publishing and installing Application updates.

How to mission.do - 313

Application as a Container for Objects and Other Components


In Chapter2 Basic Concepts, we explained the place and role of Applications in mission.do. Here is a quick summary: Application is a container for a group of Objects, Tabs, Portals, Seed Records and Hosted Files. Applications and their related tabs and menus are displayed in the Apps section of the mission.do sidebar for quick navigation. The Application Name and Tabs from the currently selected Application are rendered in the header of every Page (except for Setup Pages). Users with the Administrator Role can create new Applications, install them from the mission.do Application Directory, or install them from an XML document. When a new customer zone is created, one or more System Applications are pre-installed. These typically include the default mission.do Application as well as the Organization Management app. These system Applications must include the User Object, as well as some other important elements: Calendar Page, Reports List Page etc.
Managing Applications

You can manage your Applications from the Application Setup screen (Setup > Applications Setup). Click on the name of any Application to use the Application View Page to manage the Application, or use the Action links on the left to perform one of the following: Edit the selected Application and modify/set the following parameters: Applications display name Is this Application deployed (available for use)? Is this Application hidden (does not appear in Apps navigation section on sidebar)? Is field-level help enabled for this Application through (?) icon? Custom Application logo to appear in the upper-left corner (max size 256 KB) Select the ordered sequence of Tabs to appear in this. Select the Objects that should be included in this app when it is published. Attach Portals to be published with this Application. Attach Roles (other than system Roles) to be published with this Application. Attach seed data records from any objects assigned to this Application to be published with the app. Attach Hosted Files to be published with this Application.

Using the More Actions drop-down to perform additional actions descried in Chapter 2.

How to mission.do - 314

Deleting Applications

To delete an existing Application, edit it and uncheck the Deployed checkbox. Actual deletion may be performed after a 60-minute cool-off period. This is in place to avoid un-intentional deletion of your Application that could have serious, un-reversible consequences: All Objects referenced by your Application and not referenced by any other Application will be permanently deleted along with all of their data records. All Menus referenced by your Application and not referenced by any other Application will be permanently deleted. All Portals referenced by your Application and not referenced by any other Application will be permanently deleted. Your Application itself will be permanently deleted.
Application Publication Algorithm

When an Application is published from mission.do it is serialized (i.e. saved) into a proprietary XML format. The following algorithm is used when generating this Application XML: 1. All Objects explicitly assigned to the Application (including all of their subcomponents such as Fields, Views, Pages, Document Templates, etc) are included into the Application XML. All Objects related to any explicitly assigned Tabs are included as well.

2. 3. For Example: your Application has Tabs called Accounts and Contacts, with related Objects Account and Contact. But your Application only explicitly assigns an Account Detail Object. When you publish this Application, it will include the following Objects: Account, Contact and Account Detail (without a Tab because you didnt assign one to the Application). Note: The list of Objects shown on the Application View Page includes Objects assigned explicitly as well as implicitly through tabs. Explicitly assigned Objects have a Remove action link. Implicitly assigned Objects can be removed only after removing the corresponding Tab. Behind the scenes when mission.do publishes an Application it creates a package and adds components to that package that are used to generate the Applications XML and render the

How to mission.do - 315

Application Tree component. The rule described at the beginning of this section explains how Objects are selected to form the package. The rules in the following table explain how smaller components are selected to form the final published package:

Troubleshooting Published Applications

Before publishing your Application, it is convenient to view the Application Tree to verify that your Application does not contain any errors. Tip: Application errors typically occur when a certain component has been deleted, but other components still have a reference to it. For example, a Trigger may have a reference to a deleted Conversion Map. The Application should not be published until these issues are fixed. Note: Error messages may contain numeric IDs of missing Application elements. Due to the mechanics of the publishing and installation process, little information other than the components internal ID is available to report errors on when they occur. For this reason, the Application Tree Component allows you to more easily pinpoint and fix problems before they
How to mission.do - 316

occur. However, you may occasionally encounter an error when installing a published Application. The following table lists some of the possible Application errors and suggestions on how to fix them if you do encounter them.

How to mission.do - 317

How to mission.do - 318

Important: If you encounter any of the errors listed above, please attempt to fix them as described before contacting mission.do Support. This can often save you both time and effort. Tip: If you see an error related to a Trigger etc., try editing this component and saving it, then re-generating the XML (i.e. re-publish the app). This may help to resolve the issue.

How to mission.do - 319

Special Types of Applications

When a mission.do customer zone is created, one or more system Applications is installed. A system Application must always contain the USER Object that is necessary for the functioning of every mission.do zone (otherwise no users would be able to login). System Applications also include other important components which cannot be created using regular setup functions: The Calendar Page and Menu The Reports list Page and Menu The System Settings Object definition The Location, Department and Function (LDF) Object definitions
Managed Applications

Some Applications can be marked by the publisher as managed. This means that after installation, users cannot modify these Applications and any of their components. For example, no new objects, fields, etc, can be added and no existing fields, pages, triggers, etc can be edited. Managed Applications can only be modified by installing updates as soon as they are published by the publisher. Important: If you are an Application publisher and you plan to provide updated versions of your Application to your customers, you will typically want to publish your Application as managed. This prevents your customers from changing the Application, to guarantee that your future updates can safely overwrite existing components (otherwise there would be potential for your updated version to overwrite any customizations the customer made to your app).

How to mission.do - 320

Installing and Publishing Applications


Publishing Applications

When you finish developing your Application, you can decide to publish it and make it available for installation in any mission.do customer zone. Click the Publish link or button. This will bring up a form from the mission.do Application Directory where you can provide additional information about your Application necessary for publishing. Newly published Applications must be approved by mission.do personnel before they will appear in the Application Directory where mission.do customers can select them for installation in their zones. If you continue development of an Application that has already been published, you can publish updates to your Application. The updated Application will have a higher version number than the original and customers who installed previous versions will be able to upgrade to the latest version.

Understanding the Installation Process

When you develop an Application with the intent to distribute it, it is important to understand the installation process. Each Application component (an Object and its subcomponents such as Fields, Views Pages, Templates, Triggers, etc.) has a unique numeric ID. You can find these IDs in the System Information section when viewing that component in the Setup area. When you publish your Application, these components are referenced by IDs. This explains why error messages generated by the Application Tree (explained above) contain IDs. However, it is important to know that when mission.do installs an Application into another customer zone, it will create new Application components with new IDs (i.e. IDs are not preserved). So you cannot assume that IDs of Application components will stay the same after installation. Component IDs are guaranteed to change.

How to mission.do - 321

Note: Although the IDs of components are not preserved, each component does have an Original ID that is preserved when the Application is published and installed (see picture above). In this way mission.do knows whether or not each particular component has already been installed and can handle the update appropriately. So if you are developing a Application with the intent to distribute it to other customers, we recommend following these guidelines: Do not explicitly use IDs of picklists items or Workflow Statuses in Formula Fields, Templates or Triggers; use integration codes instead (integration codes are always maintained through the publish and install processes). Do not explicitly use IDs in Template Fields or Integration Link Fields (used to build dynamic URLs); instead use template tokens such as Link to View Page {!#LINK.order} or a reference to the id such as {!id!}

Tip: If you plan to distribute your Application, we recommend thinking about how you want installation and upgrades to work earlier rather than later. Try publishing your Application to the Application Directory or save it as XML and then run a test install of your Application when it is almost ready, because installation may bring up a number of issues that need to be fixed as discussed above.

Installing Applications from the Application Directory

Installing a Application published to the mission.do Application Directory is simple: you browse the list of Applications, take a Test Drive if enabled, read reviews and click the Install Now button. After finishing the installation mission.do will take you back to your zone so you can review the newly installed Application. If youre not yet a mission.do customer, you can sign-up for a free trial. The selected Application will be installed into your trail zone once it is created. In the future you can check for updates to any of your installed Applications. Click the Check Updates link or button. mission.do will take you to the Applications page in the Application Directory. If updates have been published (i.e. the version of your installed Application is lower than the current published version), you can click the Install Updates button. The Override Changes checkbox below the Install Updates button has a very important meaning:

How to mission.do - 322

If checked, mission.do will overwrite all of the Applications components (Objects, Fields, Views, Pages, Templates, etc.) with those in the latest Application version. This happens for managed Applications regardless of whether this checkbox is checked. If unchecked, mission.do will only create new Application components without overwriting existing components to preserve any customizations the customer may have already made. In either case mission.do will not modify existing Pages: it has proven too risky. You can use the Page Editor to add new fields, etc. The only case in which Pages will be updated is when an Application is published as managed.
Installing Applications from XML

As an alternative to the Application Directory, you may choose to install an Application from XML. To do so: In the development zone where you created the app, go to the Applications setup page and use the Generate XML option to generate an XML document that represents the whole Application (see Chapter 2 for more info). Store that XML locally and ensure that the file has an .xml extension.

Note: Internet Explorer tend to ignore XML content type directive, so you may see garbled XML in popup window. However you can save correct XML if you choose Page > Save As menu option. In the destination zone where youd like to install the app, use the Install from XML link in the Setup > Applications Setup > Applications page. Upload your XML file to start the installation process. If you're installing Application first time you will see a tree of all components included in the Application. Review these components and press "Install" button to start installation process.

If this Application was already installed you will see a list of tree of all components included in the Application. Previously installed components can be viewed in pop-up window. Check box next to component if you wish to update this component.

How to mission.do - 323

If component was deleted from original Application but still present in destination zone this component will be listed on the bottom of the tree. Check box next to component if you wish to delete this component from destination zone as well.

If Application is "Managed" no UI tree is presented. Components will be updated/created/deleted automatically during installation process.

How to mission.do - 324

Installing Application Updates

After installing an Application you may need to update it periodically to the most recent version. To do that: If you installed the Application from the Applications Directory, click the Check for Updates button or link in the Applications view page. If a newer version exists, you will be prompted to install it from the Applications Directory. If you installed an Application from XML, obtain the newer version and upload it in using the same Install or Update Application from XML page (follow the same steps you used to install this Application to begin with).

In both cases you can specify whether you want mission.do to overwrite existing components with changes in the latest version of the app. Managed Applications will always receive these updates, regardless of the state of this checkbox.

How to mission.do - 325

Chapter 17: Wrapping Up and Glossary

How to mission.do - 326

Chapter Overview
Congratulations if you have made it this far! You are now familiar with all of the mission.do platform as a service capabilities and are well equipped to embark on the creation of new cloud business applications. The purpose of this chapter is to simply summarize the topics weve covered in this book and remind you of the various support options as well as partnership and deployment options available to you.

How to mission.do - 327

Summary of mission.do
As you have learned in over the course of this book, mission.do offers a robust and sophisticated environment for quickly building and delivering cloud business applications which may satisfy for just about any business function. Some of the core capabilities of mission.do include the ability to: Define a data dictionary (objects, fields, relationships) Customize the user interface (pages, views, templates, icons, logos) Define and customize workflows (processes, statuses and actions) Develop automated programmatic business logic (triggers using JavaScript) Generate and process documents (template-based) Use sophisticated full text search and filtering Process your data records using conversion mapping, comparison, parallel and sequential approvals, record queuing, multi-currency support and other built-in functionality Use built-in survey capabilities to create quizzes to questionnaires Run scheduled triggers and use the built-in Calendar for task and event management Define and use Portals to create external facing applications that integrate with your mission.do applications and seamlessly fit within existing websites and intranets Secure your data using secure authentication and a sophisticated Access Control Layer Enable deep integration with Google Apps: Gmail (outgoing and incoming), Spreadsheet, Calendar and Maps Easily import your data and metadata from spreadsheets and Microsoft Access Easily migrate applications from Salesforce.com and the Force.com platform

How to mission.do - 328

Glossary of Terms
Glossary of Terms

Glossary of Terms

How to mission.do - 329

How to mission.do - 330

How to mission.do - 331

How to mission.do - 332

How to mission.do - 333

How to mission.do - 334

How to mission.do - 335

How to mission.do - 336

How to mission.do - 337

Appendix A: Creating mission.do Applications from Microsoft Access Database

How to mission.do - 338

Instructions
Appendix Overview

This appendix explains how to create an entire mission.do Application by uploading an MDB file (Microsoft Access Database format). Note that Chapter 9. Importing and Exporting explains how to create a mission.do Object definition by uploading a spreadsheet in CSV or XLS format.
Step 1: Uploading your MDB File

Select the last option called Convert MS Access Database. The rest of the process is guided by a wizard-style UI. In Step 1, select the MDB file to upload. File size cannot exceed 10MB; please contact mission.do support if you need to upload a larger file: Important: The mission.do conversion tool does not support MDB formats older than Access 2000.

How to mission.do - 339

Step 2: Creating Objects from MDB Tables

mission.do will read the structure of the uploaded MDB database. Each table in the MDB database can be converted into a new mission.do Object and every row in that table may be converted into a mission.do record. The wizard-style UI will assist you in Steps 2 and 3. Enter the name for your new Application. The name of the uploaded database will be used by default. Select which tables should be converted into mission.do Objects. Select singular and plural names for these Objects (the tables name will be used by default). The number of records in the uploaded database is shown for each table for informational purposes. As a first step to establish relationships among Objects, select the Primary Key column in each table (PK column names often end with an ID). You need to know the structure of the uploaded database to complete this task. Select Objects for which associated Tabs will be created. Typically, every stand-alone Object (except for dependent ones) should have an associated Tab. Finally, select mission.do attributes for the newly created Objects. This is an optional step. We recommend using the Contact attribute for tables that represent peoples, Location for tables that represent things with a physical/geographical address and Workflow for Objects which later will be involved in Workflow processes.

Step 3: Creating Fields and Records

At this point, all selected database tables have an associated mission.do Object. Now we need to instruct the system what to do with the tables columns. For each column we can choose from one of the following:

How to mission.do - 340

Create a new mission.do Field. Map a column to an existing mission.do Field. Discard the column. Important: You should map one meaningful column to a records name Field. If you do not, all imported records will have no distinguishable name. To establish relationships between Objects, select Foreign Keys (FK) in appropriate tables. Note: Typically Foreign Keys in dependent tables have the same name as Primary Keys in main tables, e.g. SUPPLIERID in the Suppliers table (PK) matches SUPPLIERID in the Product table (FK). Correct selection of PK and FK is one of the keys to successful data import. Select a name for the newly created Fields. By default, mission.do derives this from the databases column name. And finally, you can mark some columns to prevent duplicate values in import. The resulting mapping screens are shown below. Please note that in this example: Foreign Keys are selected to create relationships between Objects. Some columns are mapped to existing Fields (address and contact fields). Every Object has one column mapped to Record Name field. Although the type for new Fields is selected by default, you dont have to accept it. Sometimes a different type (Currency or Text Area) is more appropriate. Field names often require some editing for UI purposes. It is always a good idea to double-check your mappings before proceeding with data import.

Step 4: Reviewing Results

After submitting the Fields mapping, mission.do creates the new Fields (if this option was selected for a particular database column). Then each database row will be converted into a mission.do Object record. To indicate completion of the import process, mission.do sends you an email message: 3202 records have been imported. From that point, you can use the fully functional mission.do application that preserves both structure and data from the MDB database. Relationships between records

How to mission.do - 341

Appendix B: Migrating Applications from Salesforce.com and the Force.com Platform

How to mission.do - 342

Instructions
This appendix explains how to create an entire mission.do Application by migrating an existing Salesforce.com CRM instance, or any other application built on the Force.com platform, along with all of its data to mission.do in a matter of minutes.
Migrating an application from Salesforce.com to mission.do

mission.do uses Web Service APIs to extract information from your Salesforce.com or Force.com account and use that information to build a new mission.do application and the migrate all of your data with it. To facilitate this process first ensure that your organization has access to Salesforce.com API. Than you need to provide your Salesforce.com credentials: User name (with sufficient permissions to access Web API). Password. Security token. To retrieve your Salesforce.com API security token, login to your Salesforce.com account and click Setup > My Personal Information > Reset Security Token.

Note: mission.do will not store or re-use your Salesforce.com credentials. They are only used once to temporarily retrieve your data. As a next step mission.do will use Web API calls and retrieve the following metadata from your most recently accessed Salesforce.com application (make sure to login to your Salesforce.com account and select the application you want to migrate before continuing; for example, if you want to migrate your Salesforce.com CRM app be sure to select the Sales app): Object Menus (Web and system menus cannot be extracted because Force.com does not expose them as metadata). Custom objects and most Standard objects, including their components: Field definitions (including formula fields) Relationships Page layout definitions (which are converted into mission.do Pages)

Note: Because mission.do and Salesforce.com use different languages for formulas, you will need to substantially re-write formulas after completion of the migration process. Only in the simplest cases can formulas be used as-is. Use checkboxes to mark objects, fields and relationships you want to import from Salesforce.com into your new mission.do Application. Next click the Create button to create a new mission.do Application from Salesforce.com. This will include:

How to mission.do - 343

Object definitions (including fields) Object Menus Relationships between imported objects

Pages (including sections and related lists)


Importing Data from Salesforce.com to mission.do

After automatically creating and configuring your new Application, mission.do will proceed to import the actual data from your Salesforce.com account (providing that youve selected this option). The data import is done in asynchronous fashion and you will receive an email with import results when the process is completed. Note: Please be aware that Salesforce.com limits number of API calls particular customer can make in 24 hours span. If youre receiving REQUEST_LIMIT_EXCEEDED error that means that your limit has been exceeded during import process. Notice that not only are all of your object definitions, fields, relationships and data migrated, but the exact layout of all of your application pages is maintained in your new mission.do application. At this point you can start working with your new Application just like any other mission.do app, by adding data, editing objects, pages, etc.

How to mission.do - 344

Appendix C: External Database Tables as mission.do Objects

How to mission.do - 345

Instructions
This appendix explains how mission.do can be used to integrate with database tables that existed prior to a mission.do Private Cloud installation. By pointing mission.do to any table in your database you can create an External Object definition in mission.do to represent that table. External Objects have almost all of the same features that native mission.do Objects have, yet the actual data remains stored in that same table, rather than in mission.do tables. In this way you can integrate mission.do will tables used by other Applications, or use this feature to quickly migrate legacy enterprise software to a cloud-native Application.
Dening an External Database

Instead of creating the mission.do database tables (schema in Oracle terms) in a new empty database, you can run the default mission.do SQL creation script in your existing database that contains the existing tables you want to leverage. Note that the mission.do SQL creation script will add 24 new tables without affecting existing tables. Note: All mission.do table names begin with an RB_ prefix. Once run, your database will contain both your existing tables as well as all of the tables required by mission.doUsing this approach to describe a new database, add new XML attribute isExternal: <Database name="RB_CUST1" isExternal="yes">..</Database> Marking a database as external allows creation of External Objects (see below) for mission.do customers (i.e. tenants) assigned to that database. Note: mission.do tables must reside in the same database where existing tables you want to integrate with reside because mission.do transactions are complex and often include multiple updates in several tables. Running these updates across more than one database has proven to be inefficient.
Dening an External Object

If your Customer zone (i.e. tenant) resides in a database marked as External you have an additional option to create Object definitions by mapping an existing table from that database. When creating a new Object definition, select the External Database option from the drop-down list. On the next screen select the table to use as the basis for your new External Object. This can be any table that resides in your database except the following:

How to mission.do - 346

mission.do table (name starts with RB_) System table (name starts with ) Table which is already used by an existing External Object

For the selected table, select the following: Unique numeric column to be used as ID field Text column to be used as Record Name field

Finally, specify the usual Object definition attributes: Singular Name Plural Name Integration name (derived by default from tables name) Optional description

Note: If your table does not have a unique numeric column or text column it cannot be used as for an External Object. In this case consider adding such a column beforehand (for instance, record number). Without a numeric ID mission.do cannot create relationships between object records. As a next step map columns in the selected table to new fields in the newly created External Object. This is similar to creation of fields while importing data from a CSV file, Excel, MS Access database or Salesforce.com object.

How to mission.do - 347

Each database column can be mapped to a field in newly created External object. These fields will be added to UI pages: View, New record, and Edit. If you do not map column to a new field you can create fields from unused columns later.

Adjusting SQL Queries

Although mission.do can automatically read the structure of a particular table, the actual design of the external database remains unknown to mission.do. For this reason External Objects have additional configuration steps which include adjusting SQL queries. To access and manipulate data records in External tables, mission.do needs SELECT, INSERT, UPDATE, and DELETE SQL queries. For native mission.do objects these queries are automatically generated and hidden from view. However, for External Objects these queries are generated by default and should be adjusted by you before using the External Object. Queries may include calls to stored procedures. Warning: To adjust SQL queries you must be familiar with both SQL and with details of your database implementation. If mission.do experiences a SQL error while working with External Objects an error will be displayed. Please adjust your queries to fix the problem. When definition of external object is created, mission.do will populate SQL queries with default queries. Please adjust these queries according to your database structure. SQL queries must use actual database column names. To supply data to database INSERT and UPDATE queries must use template tokens for mission.do fields. At runtime these tokens will be replaced by actual records values. This offers most flexible way to build queries which may include calls to stored procedures etc. Finally you must provide a query which will fetch an ID for new record. Oracle database may use call to sequence. Tip: Use View Table Columns button to select tables columns and corresponding template tokens. Use Preview Queries button to preview queries for selected record.

How to mission.do - 348

Creating New Fields

There is a fundamental difference between the way new fields are created for External Objects and native mission.do Objects. In the latter case new fields can be created either through enabling a new Object Attribute (such as Contact or Location) or directly by creating a field manually in the mission.do user interface. For External Objects mission.do is dealing with an existing table that has a structure which cannot be modified. For this reason new fields in External objects can only be created if: They rely on a column in your External Table which has not yet been mapped to a mission.do field in that External Object, or They do not require a database column in the External Table to store data: Formulas, Templates, Roll-Up Summary, Integration Links

Currently the ability to assign Object Attributes is disabled for External Objects (in the future we may allow enabling the Workflow attribute). As explained above, new fields for External Objects can be created only if that field either does not require a database column or points to an unused column in your External Table. The Fields configuration process is almost identical to native mission.do object fields. As usual, newly created fields on External Objects can be added to Pages, Views, Reports, and referenced anywhere normal object fields can be such as Formulas, Templates, Triggers, Validations, etc. Warning: Creation or deletion of a field in an External Table most likely will require adjustment in your SQL queries as described above. Foe your convenience the system will redirect you to the SQL Adjustment page after field is created or deleted.
How to mission.do - 349

Using External Objects

External Objects can be configured and used in almost the same way as native mission.do Objects. Some limitations do apply: Object attributes cannot be assigned The field creation process is limited as explained above Full-text search and search engine indexing is not available for External Object fields Other than these limitations all standard mission.do functionality is available for External Objects and their fields. This includes, but is not limited to: Configurable Pages Configurable Views Detailed Search and Filtering Email and Document Templates Triggers Input validation through Triggers and Field-level Validation Reports, Charts and Gauges Unique Indexes Client-side and Server-side API Usage REST and SOAP API Warning: External Objects functionality is currently in Beta. If you encounter issues please submit Support Requests to the mission.do team.

How to mission.do - 350

Você também pode gostar