Form edit user constraints (AdvLimit)
In the generated application forms there is the possibility of imposing user restrictions on the lists. User restrictions allow you to configure rules according to which the filtered objects in the list. Consider the following example:
“Note: it is assumed that the application already generated”
Form set custom restrictions
Suppose we have a list of 5 clients that filled in the following way, and we want to select all customers, registered in Perm:
To do this, you must open the edit form of custom constraints, and to introduce a corresponding limitation on the field
Прописка. Check very primitive - check the string for the presence of the substring “Perm”.
Once the limit is filled, you must click “
Сохранить and применить” after returning the form you need to update the list so that it applied a restriction.
As you can see, the number of Customers was reduced to 3 people: only those who have in the field
Прописка was a substring of Perm.
To return the list to its original state, you must reset the current limit by clicking the “
Example settings FilterSettings
FilterSettings allow you to customize the available to overlay user restrictions field of the object. Consider this example:
Here is the setup form list of Credits. Suppose we want to filter the list and bring those loans that had at least one repayment in the amount exceeding 100 000.
Open the form to create custom constraints:
In the tree fields of the object the Credit is all his masters, and a private field, but there was none of detailov. So it appeared to detaily, you must create a FilterSetting through AdmConsole.
- Download AdmConsole
AdmConsole.exe.cofig, need to specify the path to the database of our application in key CustomizationString
<add key="CustomizationStrings" value="SERVER=localhost;Trusted_connection=yes;DATABASE=credits;" />
- When you first launch the app, select the folder Assembly cache, you can specify the path to the folder where the project is going, but it is preferable to create a separate folder.
- The folder cache must be copied:
- DLL with objects
- DLL with Forms
- IIS.WinUI.AdvancedFSCtrl.dll - located in the folder AdmConsole.exe
Специальные forms настройки->
- Create a new configuration by clicking on the button
Создать, will open the creation form settings.
- On the form:
- We introduce
- Choose build from the drop down list
- Choose the type
- Choose view
- Go to the tab
Заполнить. “Note: if you press the button
Заполнитьthe message “No changes of datalow”, you must save the configuration and try again”
- Save the setup and exit AdmConsole
Now you need to configure it to do so in list form
Кредитов needs to be applied this setting filters. Options:
- A setting in VS designer
- Setting code. “Note: if you can not open the project in Visual Studio, but want to still use this setting, you must do the following:
- Open the folder with the projects forms
- Find the file КредитL.cs and open it with any text editor (e.g. Notepad)
- Find a method GetDpdForm()
- Record in brackets programmer
КредитL.GetDpdForm() endthe following line of code:
form.FilterSettingName = "Loans";
- Save the file”
Now after assembling the apps come in the form of loans and open the form to create custom constraints:
As you can see, there is a possibility of imposing restrictions on detail Loan. Create a condition that filters all loans with maturity of more than 100,000. Press
Сохранить and применить and update the list on the form, you will receive: