The GetCompanyInfo Method
We modified the GetCompanyInfo method in the following ways:
-
Add a single, integer (%IntegerOpens in a new tab) input argument, id. This is the object ID of the Company we are looking for.
-
Change the return type of the method to CInfo.Company as we are returning an object instance from this method.
-
Add code to the method that opens an object instance (using the %OpenId method) from the database and returns it.
The result looks like this:
Method GetCompanyInfo(id As %Integer) As CInfo.Company [ WebMethod ]
{
Quit ##class(CInfo.Company).%OpenId(id)
}