Introduction
The OpenUrl Action Template in CRM.pad enables opening an URL from CRM.pad directly into the device's browser. It supports the use of additional parameters, such as the current record, parent records, field values, etc.
Using the Action Template
Like any Action Template, OpenUrl can be used in a variety of ways throughout the product, depending on your specific needs. For example, the template is in use by default in the RedirectPage button. If you wish to modify this URL, please follow these steps:
- Log in to the crm.designer
- Navigate to the RedirectPage button
- Click on the Action and as Action Template use the OpenURL parameter
Inputs and Parameters
As detailed in The OpenUrl manual page, the template supports a variety of inputs, including the following:
- FieldGroup: Name of the Field Group where the required functions were assigned in the List control, or the Search & List configuration that references this field group. Please refer to the Field Groups section in Understanding Expand Views for a more detailed explanation.
- RecordId: Normally set to 'Record' (the current record).
- encoding: Different options are supported for the encoding; please refer to the manual for more information.
- url: The main input, which supports using different parameters related to the Field Group, as well as the current Rep.
URL Parameters
URLs of the OpenUrl action template support the use of braces ('{}')for enclosing optional parameters that can in turn be mapped to fields in the Field Group specified in the FieldGroup input argument.
When used in this way, the opening and closing braces and the enclosed characters will be replaced by the associated values. For example, the URL yelp://search?location={$town}
will be resolved as yelp://search?location=123
. Here, {$town}
is replaced with the value '(123)' of the field that has the town function assigned in the List Control. If the optional parameter has not been defined in the field function, the URL will not be correctly resolved, and an error message will be displayed, or no action will be taken.
A special case is {recid0}
, which will return the current record's RecId/UID, while {recid1}
will instead return the parent record's Id. Similarly, the current Rep can be invoked with $curRep
(without braces). Please refer to OpenUrl for more information.
Special characters
Unsafe and reserved characters that can be used in the OpenUrl action
CRM.pad uses an iOS library function [NSURL URLWithString:urlString] to validate URLs before they are opened. In general, URLs that are opened through the OpenURL action template should adhere to the recommendations of RFC 1738 (Uniform Resource Locators (URL)). For that reason, escape characters should be used in place of unsafe characters in URLs as shown in the table below:
Unsafe character | Name of unsafe character | Escape characters |
---|---|---|
Empty space | Empty space | %20 |
" | Straight quotation mark | %22 |
< > | Left angle bracket and right angle bracket | %3C and %3E |
# | Number sign | %23 |
% | Percent | %25 |
{ } | Opening and closing braces | %7B and %7D |
| | Pipe | %7C |
\ | Backslash | %5C |
^ | Caret | %5E |
~ | Tilde | %7E |
[ ] | Opening and closing brackets | %5B and %5D |
` | Grave accent | %60 |
Escape characters for reserved characters in the text
The following is a list of reserved characters that must be substituted with the escaped counterpart:
Reserved character | Name of a reserved character | Escape characters |
---|---|---|
; | Semicolon | %3B |
/ | Slash mark | %2F |
? | Question mark | %3F |
: | Colon | %3A |
@ | At sign | %40 |
= | Equal sign | %3D |
& | Ampersand | %26 |