Skip to main content

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