Example of using constraints

If you want to set the condition for the existence of datalow the condition in which it should participate to set the aggregator, you must use the function Exist. When specifying the properties in the condition for the function Exist you must explicitly specify that this property aggregator:

<Имя агрегирующего свойства у детейла>.<Свойство агрегатора>.

Example of imposing restrictions on detaily using the properties of the aggregator

To identify erroneously entered data in the database: find all companies that have a software product created before the creation of the company.

 View view = Information.GetView("CompanyL", typeof(Company));
 View view2 = Information.GetView("SoftwareL", typeof(Software));
 view.AddDetailInView("Software", view2, true);
 var lcs = LoadingCustomizationStruct.GetSimpleStruct(typeof(Company), view);
 ExternalLangDef langDef = ExternalLangDef.LanguageDef;
 var detail = new DetailVariableDef(langDef.GetObjectType("Details"), "Software", view2, "Company");
 lcs.LimitFunction = langDef.GetFunction(langDef.funcExist, detail,
                                         new VariableDef(langDef.DateTimeType, Information.ExtractPropertyPath<Software>(x => x.DateCreation)),
                                         new VariableDef(langDef.DateTimeType, Information.ExtractPropertyPath<Software>(x => x.Company.DateCreation))));
 var dos = DataServiceProvider.DataService.LoadObjects(lcs);