1. Home
  2. Administrators
  3. Formulas
  4. JavaScript functions
  5. Find and detailFind functions – Find a value in a Dropdown List

Find and detailFind functions – Find a value in a Dropdown List

Through the Find and detailFind functions, fields of the Drop Down List to Another Category (LDAOC) type can be defined by means of a formula.

A formula in this type of field must return one of three possible results:

  1. A number corresponding to the ID of a document.
  2. A text corresponding to the code of a document.
  3. The result of a call to the Find function.
  4. The result of a call to the detailFind function.
Document.find(Order,[Condición] )

The function returns the first document found according to the specified order and conditions.

Document.detailFind(Field_list, Order,[Condición] )

The function returns the first document found in a detail tab of the current document, according to the specified order and conditions.

Where:

Field_list : is the name of the Drop-Down List in the child category, where the document of the parent category is selected. Its syntax is that of a tag type< @CodeCategory:Group:Field> . For example, in the Country category, we can search among its Provinces by entering the value in Campo_lista:

'<@PRV:Data:Country>'

Order : is an ordering text string. Indicates by which field or fields we want to order the results. The syntax must include the name of one or more fields separated by commas. After each of them we will specify the ASC or DESC clause to indicate the ordering sense. For example, to find the first Province of the Country in alphabetical order, Order should have the value:

'< @PRV:Properties:Name> ASC'

Condition : is an optional parameter with a T-SQL condition text string of the same type used in Dropdown Lists. It allows us to filter the search results. For example, to search only among the Provinces of this Country that begin with Al , we would use the value for Condition:

"<@PRV:Properties:Name> LIKE 'Al%'"

If the Country were Spain , the value in this list would automatically show Álava .

Updated on 21 de November de 2023
Was this article helpful?

Related Articles