The CreateCompaniesMethod
We modified the CreateCompanies method in the following ways:
-
Add a single, integer (%IntegerOpens in a new tab) input argument, count. This is the number of Company objects we are going to create and store within the database.
-
Change the return type of the method to %IntegerOpens in a new tab as we are returning the number of objects created and saved by this method.
-
Add code to the method that invokes the Populate method (to create and save objects using random data).
The result looks like:
Method CreateCompanies(count As %Integer) As %Integer [ WebMethod ]
{
Quit ##class(CInfo.Company).Populate(count)
}