R29732 PosOperator - Load Pos Operator Code Next No

Code R29732
Entity Crm.Pos.Operators Entity
Name LoadPosOperatorCodeNextNo
Attribute PosOperatorCode
Layer Front-End
Events AttributeChanged(PosLocation)
Priority Normal
Modify YES
Applicable Legislations BG (PosLocation.EnterpriseCompany.Company)
Action If ((PosOperatorCode == NULL) && PosOperators [(PosLocation = PosOperator.PosLocation)].Count() <= 1*

, then set a value: PosOperatorCode = '0001'

, else set a value: PosOperatorCode = INCNUM (MAX (PosOperator.PosOperatorCode[(PosLocation = PosOperator.PosLocation)]))

* Note: The count includes the current POS Operator
Description

When selecting a POS Location for the current POS Operator, if the field 'PosOperatorCode' is not yet filled in, it is loaded a value, as follows:

  • if it is the first POS Operator with this POS Location selected in it, then in the 'PosOperatorCode' field is loaded number '0001'
  • if the POS Operators with the current POS Operator's POS Location are two or more, including the current POS Operator, then in the 'PosOperatorCode' field is loaded the maximum POS Operator Code of those POS Operators, increased by 1.

    The rule is executed only if the Applicable Legislation is BG.
Message
Introduced In Version 2019.1
Revocable NO

* For more information about the Business Rules Documentation Template and a short explanation of each column, see topic System Business Rules.