Axaptapedia is now maintained by AgileCadence For more information please click here.

Company

From Axaptapedia
Jump to: navigation, search

Company accounts are separated from each other in the database by the DataArea field in tables. This field is created when the SaveDataPerCompany property of a table is set to Yes. Data in tables can be shared between company accounts if the SaveDataPerCompany is set to No.

The following code demonstrates how to search for data within all companies on an installation.

Note: the example searches for a production order. <xpp>

static void SearchProductionOrder(Args _args) {

   DataArea    DataArea;
   ProdTable   prodTable;
   Boolean     isFound;
   ;
   while select DataArea where dataArea.isVirtual == NOYES::No
   {
       changecompany(Dataarea.Id)
       {
           prodTable = ProdTable::find("TO0006525");
           if (prodTable)
           {
               info(strfmt("Found order: %1 in Company: %2",prodTable.ProdId,dataArea.Id));
               isFound = true;
           }
       }
   }
   if(!isFound)
       info("Order not found in any companies");

}

</xpp>