WITH

The data retrieval statement WITH is used to retrieve fields or subentry values of a singular entry to the database.

The following is a definition of the statement WITH.

WITH <Entry_reference_name> IN <Database entry reference> (* see below *) 
DO 
			<Template scripting part with declarations> 
OD 

The database entry reference has either of the following structures.

In case of a main entry:

<DID_three_letter_code>.<DID_defined_Main_Entry> 
 

In case of a subentry:

<Entry_reference_name>.<DID_defined_Sub_Entry>

Entry_reference_name is the name for the entry. It must start with an uppercase character followed by uppercase or lowercase characters, numbers, and/or underscores.

This name can be used to approach fields or subentries from the entry.

The DO ... OD part is executed once for each record found in the database. If no data is found, the DO ... OD part is skipped.

The following is an example of the main entry field value retrieval.

#BEGIN 
WITH Cust IN EXP.Customer 
DO 
# 
Dear Mr. @(Cust.Surname) 
# 
OD 
END# 

The following is an example of an access to a subentry and field value retrieval.

#BEGIN 
WITH Cust IN EXP.Customer 
DO 
WITH Part IN Cust.Partner 
				DO 
# 
@(Part.Surname) 
# 
				OD 
OD 
END#