Object General Reference Syntax
When writing code, you will often need to reference objects and related objects.
There is a particular logical syntax for referencing objects.
Objects are directly referenced by their numeric ID.
While not required, placing #: before any object IDs makes things clearer to read by identifying the number as an Object ID as apposed to any other values.
It is also needed if you are considering creating the application for use by another organisation from the original. e.g. #:1000
Apart from directly referencing objects, you can use a query to locate one or many objects.
These queries might be as simple as "X" to reference child object X, or they could be relatively long.
For longer queries, and queries used multiple times, it is easier to hold them on an object of their own and reference them.
So the system knows that you are referencing a query, you need to precede it with an @ symbol. e.g. @#:1001
When accessing objects using a query, they will always be referenced relative to the Current Object ID (COID).
For example, if the current object is an Invoice and the payment method is stored as Child Object X, the query will simply be "X" to reference Child Object X relative to the Invoice Object. If you want the query to work relative to a different object then you can precede the query with the Object ID followed by a colon.
e.g. #:1234:C would be the children of object 1234
In the example code below, the object (1623, a list) has children which the loop will iterate through. For each iteration, C1 of that object will be displayed along with C1 of the Child X Object.
{FOR_EACH(#:1234:C)}
    {OBJ_DATA(0, C1)} - {OBJ_DATA(X, C1)}<br>
{END_FOR_EACH}