When defining a URL for a browser control, custom link or custom tab, how can I include a variable so that users see information that is relevant to their incident, contact, or organization?
Oracle B2C Service
When adding a browser control to a workspace or script, you can pass variables as URL parameters to prepopulate field values in the resulting page. You can also include variables when adding custom links to the Links menu.
When passed through a parameterized URL, each variable is replaced with the field value from the record (or associated record) that is currently being edited. Variables can be used to pass ID values for certain record types including incidents, answers, contacts, organizations, and staff accounts. They can also pass values from database fields, custom fields, or custom object fields.
To pass variables to a target page, build the URL using the standard query-string syntax, as follows:
The following sections provide descriptions and examples of variables that can be passed from records in Oracle B2C Service through parameterized URLs.
Note: This function is supported for menu, integer, text field, date, date-time, and yes/no field types. To successfully pass variables through a parameterized URL, the target page must be designed to process and/or display the variables you include. You can use PHP or another HTML-embedded scripting language to perform the task of populating the fields.
Passing Record IDs
The following variables can be used to pass the ID value of the current record.
- $p_acct_id Passes the account ID of the user currently logged in.
- $p_c_id Passes the contact ID of the contact you are currently editing or the contact associated with the incident you are currently editing.
- $p_org_id Passes the organization ID of the organization you are currently editing.
- $p_refno Passes the reference number of the incident you are currently editing.
- $p_a_id Passes the answer ID of the answer you are currently editing.
- $p_m_id Passes the meta-answer ID of the meta-answer or answer you are currently editing.
- $opportunity.op_id Passes the opportunity ID of the opportunity being edited
- $p_sid Passes the session id of the account
Example: The following URL passes the value of the current record's contact ID to a field named contact id.
Passing Database Field Values
The following variables can be used to pass database field values associated with the current record. Database field names and functions are described by the Data Dictionary (Configuration>Database>Data Dictionary). Except where indicated, database field values can be passed in Oracle B2C Service versions 8.0 and higher.
$contact.<field_name> Passes contact field values.
$org.<field_name> Passes organization field values
$incident.<field_name> Passes incident field values
$opportunity.<field_name> Passes opportunity field values
$p_sid Passes the session ID value
Example: In some cases, you can also specify an object within a field. The following URL passes the street portion of the contact address field to a field named street_addr.
Passing Custom Field Values
August 2012 and newer releases
You can pass information in the URL Query string using standard query string syntax of the form:
You can specify Oracle data in a URL <param_value> as follows:
Contact attributes as $contact.<fieldname>
Organization attributes as $org.<fieldname>
Incident attributes as $incident.<fieldname>
Answer attributes as $answer.<fieldname> (Note: only customer fields and system attributes are supported for answers. Standard fields are not supported.)
Opportunity attributes as $opportunity.<fieldname>
Session ID (account session id) as $p_sid
You can specify customer fields by name in the URL by replacing <param_name> with the name of the custom field you wish to use. For instance, $object_name.c$field_name.
For example, you could pass an incident custom field in a URL as follows:
For further information, refer to the online documentation for URL Parameters.
Passing Custom Object Field Values
The following variable can be used to pass the value of a custom object field based on the package name, object name, and field name.
To find the package name, object name, and field name to use in a custom object field variable, open the Data Dictionary (Configuration>Database>Data Dictionary). Custom object tables are listed in the format package_name$object_name. For example, if a custom object named WorkOrder resides in the CO package, it will be listed in the Data Dictionary as CO$WorkOrder. You can click the table to see a list of columns (fields) that can be passed in variables. For a column containing menu items, click the column to see the list of items along with the values that represent them.
Example: The following URL passes information about a field named PaymentType in an object named WorkOrder in the CO package to a field named payment_type.
System/Custom Attribute on the Incident object: System attributes can be passed using this syntax: $object_name.package_name$field_name, e.g. $incident.CO$FieldText
Passing variables to custom tabs in the Mailing Editor
You can also pass variables to custom tabs created in the Mailing Editor using the MAILING_EDITOR_TABS configuration setting (found under Rightnow User Interface > Miscellaneous). Any field from the mailings table may be passed as a parameter in URLs defined by this setting.
Example: The following URL uses a merge field to pass the mailing id to a custom page.
See the setting's description in the configuration editor for more information about its use.
For additional information, refer to the 'Workspace and Script Elements' section in the Online Help User Guide documentation for the version your site is currently running. To access Oracle B2C Service manuals and documentation online, refer to the Documentation for Oracle B2C Service Products.