AgileApps Support Wiki Pre Release

Difference between revisions of "Get a Record ID"

From AgileApps Support Wiki
imported>Aeric
imported>Aeric
m (Text replace - '{domain}' to '{{domain}}')
Β 
(18 intermediate revisions by the same user not shown)
Line 2: Line 2:


To get a record ID:
To get a record ID:
To get an [[Object]] ID:
# Visit https://{{domain}}/networking/rest/record/{objectName}?fieldList=id&pageSize=1<br>The first record is returned.
# Visit https://{domain}/networking/rest/record/{objectName}?fieldList=id<br>A list of records is returned.
# Alternatively, add a [[REST_API:Filter_Expressions_in_REST_APIs|Filter Expression]] to the URL to retrieve a specific record.
# Use the content of the first <tt><id></tt> tag
# In the XML response, use the content of the <tt><id></tt> tag.


::'''''-or-'''''
::'''''-or-'''''


# Visit '''Designer > Data > Objects > {Object}'''
:1. Go to a [[List View]] tab.
# Use your browser's page-inspection tools to retrieve the ID of a record by examining one of the folder icons in the list:
Β 
#:
:2. Use your browser's page-inspection tools to examine one of the folder icons [[File:FolderIcon.png]] in the view:
#* In Chrome, as well as in Firefox with the FireBug plugin:
Β 
#*# Right click the folder icon and choose ''Inspect Element''. Β 
::* In Chrome, or in Firefox with the FireBug plugin:
#* In all browsers, display the page source and search for the folder image ("graphics/view.png").Β 
::** Right click the folder icon and choose ''Inspect Element''.
#:
::** Display the page source and search for the folder image: <tt>graphics/view.png</tt>
# You are now displaying a call that looks like this:
Β 
#:<tt><nowiki><a href="javascript:lj_showDetailPane('...',</nowiki>​</tt>
:3. You are now positioned at an image tag that displays the folder icon, surrounded by an anchor tag (<tt><a></tt>). That part of the HTML code looks like this:
#:'''<tt>'Service?t=498&id={recordID}</tt>'''
<blockquote>
#:<tt>&object_id=...&a=view&policyaction=view');"></tt>
<tt><nowiki><a href="javascript:lj_showDetailPane('...',</nowiki>​</tt><br>
#::<tt><nowiki><img border="0" title="Details " alt="Details" src="graphics/view.png"></nowiki>​</tt>
<tt>'Service?t=498<b>&id={recordID}</b>&object_id=...&a=view&policyaction=view');"></tt><br>
#:<tt></a>​</tt>
&nbsp; &nbsp; &nbsp; <tt><nowiki><img border="0" title="Details " alt="Details" src="graphics/view.png"></nowiki>​</tt><br>
#:
<tt></a>​</tt>
# Extract value of the record ID from the <tt>id=</tt> parameter.
</blockquote>
Β 
:4. In the <tt>href</tt> attribute, in the JavaScript call, there is an <tt>id</tt> parameter (highlighted above). The part after the equals sign is the record ID.
<noinclude>
Β 
[[Category:Development]]
</noinclude>

Latest revision as of 19:16, 25 April 2014

Typically, record IDs are of interest to programmers, who get them in the return values of API calls. But it can also be desirable to get a known value for testing.

To get a record ID:

  1. Visit https://{yourDomain}/networking/rest/record/{objectName}?fieldList=id&pageSize=1
    The first record is returned.
  2. Alternatively, add a Filter Expression to the URL to retrieve a specific record.
  3. In the XML response, use the content of the <id> tag.
-or-
1. Go to a List View tab.
2. Use your browser's page-inspection tools to examine one of the folder icons FolderIcon.png in the view:
  • In Chrome, or in Firefox with the FireBug plugin:
    • Right click the folder icon and choose Inspect Element.
    • Display the page source and search for the folder image: graphics/view.png
3. You are now positioned at an image tag that displays the folder icon, surrounded by an anchor tag (<a>). That part of the HTML code looks like this:

<a href="javascript:lj_showDetailPane('...',​
'Service?t=498&id={recordID}&object_id=...&a=view&policyaction=view');">
      <img border="0" title="Details " alt="Details" src="graphics/view.png">​
</a>​

4. In the href attribute, in the JavaScript call, there is an id parameter (highlighted above). The part after the equals sign is the record ID.