Oracle Web Services On Demand Guide > Overview of Web Services On Demand > Field Types Supported by Oracle CRM On Demand >

Support for Web Link Fields


A Web link field is a custom field that allows you to place a hyperlink to an external Web site or Web-based application in a record in Oracle CRM On Demand. You can access Web link fields through Web Services v2.0 calls to retrieve the URL and the display text for the Web link field. You cannot create, update, or delete Web links through Web service calls.

Web services calls retrieve custom Web link field values in anchor tags with the following format:

<a href="www.link.com">Web Link Display Text</a>

However, in responses the URL and display text are encoded as shown in the following example:

<CustomWebLink0>&lt;a href="https&amp;#x3a;&amp;#x2f;&amp;#x2f;www.google.com&amp;#x2f;&amp;#x3f;gws_rd&amp;#x3d;ssl&amp;#x23;q&amp;#x3d;Oracle&amp;#x25;20Corporation"&gt;Find Oracle Corporation&lt;/a&gt;</CustomWebLink0>

In the href attribute value, the URL is HTML attribute value encoded. The anchor tag content corresponds to the Web link display text. The URL and display text must be extracted from the encoded values, as described in the following section.

NOTE:  Internally, concatenated fields are similar to Web link fields but have only display text and do not have a URL. Responses to queries for concatenated fields do not contain anchor tags; the evaluated display text is retrieved as the field value. For more information about concatenated fields, see Support for Concatenated Fields.

Example of Retrieving and Extracting Web Link Values

As an example, a contact can have a Web link field, CustomWebLink0, with the following configuration:

  • Display Text. Find %%%First_Name%%% %%%Last_Name%%%
  • URL. https://www.google.com/?gws_rd=ssl#q=%%%First_Name%%% %%%Last_Name%%%

For information about how to set up Web links in the UI, see Oracle CRM On Demand Online Help.

For a Web service QueryPage call for a Contact having Id = 1QA2-230MBG, First Name = Oracle, and Last Name = Corporation, the request and response are shown in Sample SOAP Request for a Custom Web Link Field and Sample SOAP Response for a Custom Web Link Field.

The CustomWebLink0 field value is retrieved as:

<CustomWebLink0>&lt;a href="https&amp;#x3a;&amp;#x2f;&amp;#x2f;www.google.com&amp;#x2f;&amp;#x3f;gws_rd&amp;#x3d;ssl&amp;#x23;q&amp;#x3d;Oracle&amp;#x25;20Corporation"&gt;Find Oracle Corporation&lt;/a&gt;</CustomWebLink0>

The display text and URL must then be extracted from the encoded values in the Web service response.

To extract Web link display text

  • From the field value, extract the Web link display text using the regular expression pattern "<a.*?>(.*?)</a>".

For the CustomWebLink0 example, the Web link display text is extracted as:

Find Oracle Corporation

To extract a Web link URL

  1. From the field value, extract the Web link URL using the regular expression pattern "href=\"(.*?)\"".

    For the CustomWebLink0 example, the following is extracted:

    https&#x3a;&#x2f;&#x2f;www.google.com&#x2f;&#x3f;gws_rd&#x3d;ssl&#x23;q&#x3d;Oracle&#x25;20Corporation

  2. The URL is HTML attribute value encoded, so to extract the actual URL, perform an unescape HTML operation.

    For the CustomWebLink0 example, the following URL is extracted:

    https://www.google.com/?gws_rd=ssl#q=Oracle%20Corporation

Sample SOAP Request for a Custom Web Link Field

The following is an example of a query request for the Web link field, CustomWebLink0:

<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">

<SOAP-ENV:Header/>

<S:Body>

<ns2:ContactQueryPage_Input xmlns="urn:/crmondemand/xml/Contact/Data" xmlns:ns2="urn:crmondemand/ws/ecbs/contact/" xmlns:ns3="urn:/crmondemand/xml/Contact/Query">

<ns3:ListOfContact pagesize="1">

   <ns3:Contact>

      <ns3:CustomWebLink0/>

      <ns3:Id>='1QA2-230MBG'</ns3:Id>

   </ns3:Contact>

</ns3:ListOfContact>

</ns2:ContactQueryPage_Input>

</S:Body>

</S:Envelope>

Sample SOAP Response for a Custom Web Link Field

The following response contains the encoded URL and display text for the Web link field, CustomWebLink0:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<SOAP-ENV:Header/>

<SOAP-ENV:Body>

<ns:ContactQueryPage_Output xmlns:ns="urn:crmondemand/ws/ecbs/contact/">

<ListOfContact xmlns="urn:/crmondemand/xml/Contact/Data" lastpage="true">

   <Contact>

      <Id>1QA2-230MBG</Id>

      <CustomWebLink0>&lt;a href="https&amp;#x3a;&amp;#x2f;&amp;#x2f;www.google.com&amp;#x2f;&amp;#x3f;gws_rd&amp;#x3d;ssl&amp;#x23;q&amp;#x3d;Oracle&amp;#x25;20Corporation"&gt;Find Oracle Corporation&lt;/a&gt;</CustomWebLink0>

   </Contact>

</ListOfContact>

</ns:ContactQueryPage_Output>

</SOAP-ENV:Body>

</SOAP-ENV:Envelope>

Oracle Web Services On Demand Guide, Version 25.0 (Oracle CRM On Demand Release 37) Copyright © 2018, Oracle and/or its affiliates. All rights reserved. Legal Notices.