frequently asked questions

All your questions in one place.

Retrieve the content of a given indexed field

This function returns the content of a given field from a given Table if a given value exists in a specified field.

Syntax

GetValue(<vValueToSearch>, <cFieldToSearch>, <cFieldToReturn>, cTableToSearch>, [nCompanyID], [nYear])

 

Parameter

Description

vValueToSearch

Specifies the value to be searched for.

cFieldToSearch

Specifies the Field in which the value vValueToSearch has to be searched for.

cFieldToReturn

Specifies the field whose content has to be returned.

cTableToSearch

Specifies the table in which both the fields cFieldToSearch and cFieldToReturn are located.

nCompanyID

Optional: allows to specify a different Company folder MUST NOT be specified if the same Fiscal Year.

nYear

Optional: allows to specify a different Fiscal Year MUST NOT be specified if the same Fiscal Year.

Remark:

The syntax of this function is almost the same as GetValueSQL.

 

The difference between these two functions consists in the fact that :

 

GetValueSQL() is faster than GetValue() if cFieldToSearch and cFieldToReturn are not both covered by indexes.

 

GetValue() is slightly faster than GetValueSQL() if cFieldToSearch and cFieldToReturn are both covered by indexes.

Example

*/ Show the 1st address line for an address whose Company Name is "Company Name".

GetValue("Company Name", "ad_societe", "ad_rue1", "adresses")

Did you find this article useful?

0 out of 0 found this helpful