Phones.CSP — %Request
Each CSP page contains a %request object. This object, an instance of the %CSP.Request class, contains a great deal of data. In particular, it contains any query string data appended to the URL of the page when the page is requested.
Here is an example View Phones hyperlink generated by Person.CSP:
<a href='Phones.CSP?ID=1'>View Phones</a>
The URL for the hyperlink, the value of the
hrefattribute, is Phones.CSP?ID=1. Clicking the hyperlink on Person.CSP requests Phones.CSP. The query string begins after the “?”. In this case it contains the name-value pair ID=1.
The query string data is available to Phones.CSP through the %request object. We will include the following line of code in Phones.CSP to retrieve the ID:
ID = %request->Get("ID")
To learn more about %Request, read Maintaining State: %CSP.Request, %CSP.Session, %CSP.Response in the CSP QuickStart Tutorial.