Sagecrm.com Sage CRM 7.3 Eoin Shanley 17 February 2015 Sage CRM Bootcamp 2015.
The Mobile CRM Conference 2015 September 14-15, 2015 in Boston, MA Take Your CRM to the Next Level.
-
Upload
gary-henderson -
Category
Documents
-
view
218 -
download
2
Transcript of The Mobile CRM Conference 2015 September 14-15, 2015 in Boston, MA Take Your CRM to the Next Level.
The Mobile CRM Conference 2015September 14-15, 2015 in Boston, MA
Take Your CRM to the Next Level
Business logic is the brain
Business logic
• Validate email address, postal code, telephone number
• Time duration is calculated (Actual End – Actual Start)
• A field is hidden / not editable based on a condition
• Populate fields on a child entity based on the parent
• Modify the Order Products to add a special discount• Find out how many appointments have been made
against an Account…
Dynamics CRM business logic
All business logic captured within• JavaScript• Workflows• UI scripts… has to be rewritten (recreated) for Mobile CRM
Data plugins will fire • Upon synchronization• Immediately in Online mode
Business logic in Resco Mobile CRM
Rules• Form• View• Calendar & Map
JavaScript• Form•HTML UI components
Rules
Mobile application scripts written directly in Woodford
Form • Events • Commands
ViewCalendarMap
Simple scripting language
Conditions (if …)Steps• Assignment• Get GPS Position• Say Text• …
Form Rules
Available on Edit FormExecuted on Form events / actions3 types• onLoad• onChange• onSave
Specialty –• onChange is executed during loading• Value is changing from nothing to something
onLoad
Triggered when the form is loaded (form is opened)
Typically:• Initialization of values• Initialization of the form
Specialty• isFormEditable – makes whole for not editable
onChange
Triggered when a field on the form has changed
Typically:• Validation checks• Setting of values• Items visibility
Specialty• ChangedItem – contains currently changed item• IsLoaded – if the form has finished loading
onSave
Triggered when the form is being saved
Typically:• Final check before saving
Specialty• ErrorMessage – prevents saving • WarningMessage – user decides whether to save or not
Note – setting values in Save is ignored
Form rules objects
• Entity – entity fields (data)• Form – items available on the detail tabs• Tabs – all the tabs• Variables – local variables• Shared variables – variables shared between the rules• Configuration – current user, URL, is online, …• Relationship – if form opened via associated view• Specialties
Use case – hide e-mail field
Account, Don’t Allow Emails field
If Don’t Allow Emails• Make Email field not available on the form
Use case – hide e-mail field
Use case – e-mail address validation
Email Address on the Contact form
Don’t allow saving a contact with incorrect email address• Inform the user with a message• Highlight the problematic field
Use case – e-mail address validation
Use case – field from parent entity
Contact has parent Account (parent company)Show Account’s website on the Contact formThe field should be not editable• Change is not reflected on the parent
Use case – field from parent entity
onChange – execution notes
Setting a value in the onChange ruletriggers the onChange rule again!
‘field = value’ will trigger onChange
Execution stops when the same value is being set• onChange isn’t called when new value is the same as
original value
Typical problem – DateTime.setNow
Form commands
Define commands (actions) for formCan use predefined• Change State & Status• Delete• Email link• Favorite• PrintReport• Scan (Contact, Lead)• Conversions
Or define own custom command
Form commands rules
On Execute• What should happen when a command is executed
On Can Execute• When a command should be available• Command.isEnabled
Script the same as on Form rulesBoth scripts can control standard & custom commands
Use case – load parent’s address
Contact – Parent Account
Custom command : Copy Address From Parent• Should copy Address fields• Available only if Address fields are empty
Use case – load parent’s address
Use case – only allow deleting of inactive recs.Contact Delete
Status Field (Active / Inactive)• Only show delete command if Contact is inactive
Use case – only allow deleting of inactive recs.
View rule
Similarly to Form rules there are also View rules
View rules can set• Row template• Variable – ‘virtual item’
Modifying entity properties won’t work!
Row templates
View - multiple row templates • Different rows (lines)
different look
Row script (view rule)• Which row template is used
TemplateIndex• Which template to use for
current line
Use case – highlighting big OpportunitiesOpportunity view
Different look for different Opportunities• Highlight the ones with revenue more than $100.000
Use case – highlighting big Opportunities
View rule on Map
Row definition contains Map pin• Flip view to map• Global Map
Map pin requires • Latitude & Longitude
View rule is respected on the map• Different pins for different
items
Use case – big Opportunities on Map
The same Opportunity view
Show Opportunities on a map based on their Account address• Different Pin different revenue
Use case – big Opportunities on Map
Calendar rule
Color of items (Color property)Possibility to reschedule by drag & drop (IsReadOnly)
Note!Entity object contains all the properties• If you want to use some – must be enabled in Select
Fields
Use case – Appointments with high priorityStandard Calendar• Appointments• Priority field
Show Calendar items in • Red if priority high• Green if normal• Blue = low
Use case – Appointments with high priority
Rules - summary
Form • Events
• onLoad• onChange• onSave
• Commands• onExecute• onCanExecute
View & MapCalendar
Rules – can do
• Access entity values • Access form / view / calendar properties• Load parent entity (via lookup)• Create variables & show them• Access GPS• Access configuration• Display a Message• …
Rules – can’t do
• Load children entities (for cycle)• Execute fetch (retrieve records)• Create, modify & save entities (except on form)
What if you need more?
Offline HTML & JavaScript Bridge
JavaScript Bridge can
• Load children entities (for cycle)• Execute fetch (retrieve records)• Create, modify & save entities• Access metadata• Create (local) files• …
What is Offline HTML?Flexible way to extend MobileCRM
Offline HTML• HTML pages (.html, .js, .css, .jpg, *)• Included into Mobile Project• Available offline for mobile app
Offline HTML is used for• Extending the Mobile CRM app UI• Adding business logic• Replacing the app’s UI completely
Offline HTML in Resco Mobile CRM
The HTML pages are displayed in a web browser window (IFrame)
Uses device’s browser• iOS – Safari• Android – Chrome• Windows – Internet Explorer
The IFrame can be placed on• Form (as tab)• Hidden – not visible• Containing only business logic
Resco JavaScript BridgeJSBridge.js - Component provided by RescoAllowing the HTMLs (JavaScript) to interact with Resco app
• Native UI• Data Layer (Fetch, Entities)• Other (Application, Configuration, Metadata, …)
You have to include it in your HTML / JS
Latest version available always here• http://www.resco.net/MobileCRM/downloads/JSBridge.js
Comprehensive reference of all functions & classes• http://www.resco.net/MobileCRM/support-jsbridge.aspx
Architecture
Offline HTML Pages
Resco JavaScript Bridge
Local DB…
& more
Business logic on Form with JSBridge
1. Create an HTML page with business logic in JavaScript2. Add that page as IFrame (tab) on a form3. Make the IFrame hidden
Work with:• onChange, onSave handler• onLoad – not present (body onload)• CreateCommand, onCommand, CommandEnabled
JSBridge – important classes
Dynamic Entity represents entity instance• createNew, load, save, properties[“fieldname”]
FetchXML for queries• construct, execute & process results
EntityForm for form interaction• onChange, onSave, form items, form properties, …
Rules vs. JavaScript? Which & when ?
Do you need to:• Load multiple records• Create, modify & save records• Perform computation on arbitrary number of fields• Process strings (extract part of a text field)
Go for JavaScript bridge
Everything else -> start with Rules
Shortcomings of JSBridge
Limited inter-form / multi-tab communicationNot available on views / listsNo global object
Asynchronous everywhere!
JavaScript Bridge objects different to Dynamics CRM
Thank you.
Help us improve!Rate this session in the resco.next app
TAKES
1 MINUTE