FormBuilder v1
The simplest way to add a field without knowing its description:
- Find a form where it already exists
- To find out the form file name, you can run
engymod(true);in the browser console, and at the bottom of the form you will see the full path to the used file, as well as additional useful information - Find the required file in the XML manager and copy the field
How to add an Extra Field to a client
Absolutely the same principle for describing fields as regular ones, BUT in the name you need to add extraField_. For example, extraField_hobby - will create an extraField called hobby
Behavior/logic
ifExpression
For all components, you can set an expression whose result will affect the field visibility (true/false with maximum priority).
How to create an expression
- The form must have an expressions element, if it doesn't exist, you need to create
form > expressions. There are no configuration attributes. - Declare the expression
<expression name="example"> expression </expression>in theform > expressionsblock - Use the expression via
ifExpression="example"in components (as well as in masks<mask>)
Example:
<form name="loanapp">
<expressions>
<expression name="principalParts_show_fields"><![CDATA[
formModel['_principalParts_edit'] === true
]]></expression>
<expression name="principalParts_show_bar"><![CDATA[
formModel['_principalParts_edit'] !== true
]]></expression>
</expressions>
<layout>
<blade view="Contracts::form/principalParts-bar" ifExpression="principalParts_show_bar" name="creditFieldReq.principalParts"/>
<array name="creditFieldReq.principalParts" ifExpression="principalParts_show_fields">
<fields>
<field name="creditFieldReq.principalParts._.id" type="hidden"/>
<field name="creditFieldReq.principalParts._.trancheNo" type="integer"/>
<field name="creditFieldReq.principalParts._.part" type="float"/>
</fields>
</array>
</layout>
</form>- name - any name by which the expression result will be obtained
- To prevent special characters from breaking anything, it is recommended to always use the wrapper
<![CDATA[ expression ]]>
Available variables for expression:
- formModel - Current form state
More detailed information about expressions in Expressions.md
Field types (type)
select
Static set (options)
<field label='Клиент фокусник?' name='extraField_isMagician' type='select'>
<options>
<option value="yes">Да</option>
<option value="no">Нет</option>
<option value="mb">Возможно</option>
<option value="">Не заполнено</option>
</options>
</field><option value="">Не заполнено</option> - optional. In the current implementation, it will be displayed if the field is static (not editable), visually the field will appear as if it is filled (in static mode). If it's not present, there will be a gray text Нет данных. For consistent styling, it's better not to fill in the default value, but in case it's really needed.
List of available Enums
ProcessTypeKind
LegalEntityTypeKind
VerifiedKind
ActionTypeKind
ActorTypeKind
AmountMovingDirectionKind
ClosedContractStatusKind
ContractStatusKind
ClientTypeKind
DateCalcMethodKind
DepositTypeKind
FeeChargeBaseKind
FeeChargeMomentKind
InterestCalcMethodKind
InterestChargeMethodKind
InterestPaymentPeriodicityKind
InterestRateTypeKind
LoanStatusKind
LoanTypeKind
MaritalStatusKind
PaymentTypeKind
PaymentTypes
PenaltyTypeKind
PrincipalDistribMethodKind
RepaymentSequenceKind
ScoringRuleStepTypeFieldKind
ScoringRuleStepTypeKind
ScoringRecommendationKind
SelectBooleanKind
SexKind
StepTypeFieldKind
ValueTypeKind
WithdrawalTypes
ActionsReqSign
ForepaymentConsiderationMethodKind
CreditLineTypeKind
PersonTypeKind
CustomStatusKind
List of available directories
Account
AmountType
CashOffice
SettlementAccount
Branch
Subdivision
Donor
LoanCategory
CreditOfficer
ContractAgent
ContractCollector
MergedShopAddress
ActivityTypes
AmountTypes
Banks
Branches
CashOffices
CollateralTypes
ContractCollectors
Countries
CreditOfficers
CreditProductGroups
CreditProducts
Currencies
DepositProducts
Donors
Educations
LegalEntities
Liabilities
Professions
Regions
Subdivisions
Users
CreditPurposes
GettingMoneyMethods
LoanDeniedRejections
LoanProcessingStatuses