Download presentation
Presentation is loading. Please wait.
Published byGary Henderson Modified over 9 years ago
1
The Mobile CRM Conference 2015 September 14-15, 2015 in Boston, MA Take Your CRM to the Next Level
2
A to Z of portable business logic Technical Advanced Track Juraj Mojik duro@resco.net
4
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 …
5
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
6
Rules Form View Calendar & Map JavaScript Form HTML UI components
7
Mobile application scripts written directly in Woodford Form Events Commands View Calendar Map
8
Conditions (if …) Steps Assignment Get GPS Position Say Text …
9
Available on Edit Form Executed on Form events / actions 3 types onLoad onChange onSave Specialty – onChange is executed during loading Value is changing from nothing to something
10
Triggered when the form is loaded (form is opened) Typically: Initialization of values Initialization of the form Specialty isFormEditable – makes whole for not editable
11
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
12
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
13
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
14
Account, Don’t Allow Emails field If Don’t Allow Emails Make Email field not available on the form
16
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
18
Contact has parent Account (parent company) Show Account’s website on the Contact form The field should be not editable Change is not reflected on the parent
20
Setting a value in the onChange rule triggers 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
21
Define commands (actions) for form Can use predefined Change State & Status Delete Email link Favorite PrintReport Scan (Contact, Lead) Conversions Or define own custom command
22
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 rules Both scripts can control standard & custom commands
23
Contact – Parent Account Custom command : Copy Address From Parent Should copy Address fields Available only if Address fields are empty
25
Contact Delete Status Field (Active / Inactive) Only show delete command if Contact is inactive
27
Similarly to Form rules there are also View rules View rules can set Row template Variable – ‘virtual item’ Modifying entity properties won’t work!
28
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
29
Opportunity view Different look for different Opportunities Highlight the ones with revenue more than $100.000
31
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
32
The same Opportunity view Show Opportunities on a map based on their Account address Different Pin different revenue
34
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
35
Standard Calendar Appointments Priority field Show Calendar items in Red if priority high Green if normal Blue = low
37
Form Events onLoad onChange onSave Commands onExecute onCanExecute View & Map Calendar
38
Access entity values Access form / view / calendar properties Load parent entity (via lookup) Create variables & show them Access GPS Access configuration Display a Message …
39
Load children entities (for cycle) Execute fetch (retrieve records) Create, modify & save entities (except on form)
42
Load children entities (for cycle) Execute fetch (retrieve records) Create, modify & save entities Access metadata Create (local) files …
43
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
44
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
45
Resco JavaScript Bridge JSBridge.js - Component provided by Resco Allowing 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
46
Architecture Resco JavaScript Bridge Local DB … & more
47
1.Create an HTML page with business logic in JavaScript 2.Add that page as IFrame (tab) on a form 3.Make the IFrame hidden Work with: onChange, onSave handler onLoad – not present (body onload) CreateCommand, onCommand, CommandEnabled
48
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, …
49
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
50
Limited inter-form / multi-tab communication Not available on views / lists No global object Asynchronous everywhere! JavaScript Bridge objects different to Dynamics CRM
51
Thank you. Help us improve! Rate this session in the resco.next app TAKES 1 MINUTE
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.