Skip to main content

This version of the product is no longer supported, and this documentation is no longer updated regularly. See the latest version of this content.Opens in a new tab

The CreateCompaniesMethod

We modified the CreateCompanies method in the following ways:

  1. 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.

  2. 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.

  3. 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)
}
FeedbackOpens in a new tab