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 Services v2.0 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><a
href="https&#x3a;&#x2f;&#x2f;www.google.com&#x2f;&#x3f;gws_rd&
#x3d;ssl&#x23;q&#x3d;Oracle&#x25;20Corporation">Find Oracle
Corporation</a></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.
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 the sample SOAP request and response in this topic..
The CustomWebLink0 field value is retrieved as:
<CustomWebLink0><a
href="https&#x3a;&#x2f;&#x2f;www.google.com&#x2f;&#x3f;gws_rd&
#x3d;ssl&#x23;q&#x3d;Oracle&#x25;20Corporation">Find Oracle
Corporation</a></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
From the field value, extract the Web link URL using the regular expression pattern "href=\"(.*?)\"".
For the CustomWebLink0 example, the following is extracted:
https://www.google.com/?gws_rd=ssl#q=Oracl e%20Corporation
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><a
href="https&#x3a;&#x2f;&#x2f;www.google.com&#x2f;&#x3f;g
ws_rd&#x3d;ssl&#x23;q&#x3d;Oracle&#x25;20Corporation">Find
Oracle Corporation</a></CustomWebLink0>
</Contact>
</ListOfContact>
</ns:ContactQueryPage_Output>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>