Extrafield - Choose from table

Hello everybody,

I have added a custom field to my commercial proposals and invoices.
So far everything worked fine for the beginning with a field of type “Choose from table / Wähle von Tabelle”
and “socpeople:lastname” as a query string.

Now I need to extend the query so that there are ownly shown those contacts in the selection list which
belong to the partner who is chosen for the document.
To get the list that I need in this additional field I would use the following SQL-Statement:

SELECT llx_socpeople_extrafields.bb_obj, llx_socpeople.town, llx_socpeople.firstname, llx_socpeople.lastname, llx_socpeople.poste 
FROM llx_socpeople, llx_socpeople_extrafields, llx_propal 
WHERE llx_propal.rowid = $ID$ AND llx_socpeople.fk_soc = llx_propal.fk_soc AND llx_socpeople.rowid = llx_socpeople_extrafields.fk_object

In the moment I don’t understand how the syntax in the configuration of the additional field works.
Could somebody explain the syntax with : | :: to me? This would be very nice.
I was looking for a better documentation of this dolibarr-Syntax but I didn’t find anything.

Pièces jointes :

I need it too, its very hard.

I know this is old, but did anyone find a solution? I need to generate an Address from Contacts.

I’m not sure if these are as ‘advanced’ as you require, but I have used these to find contact options based on the customer selected for and order/shipment

At Order level:
socpeople:lastname:rowid::fk_soc=($SEL$ fk_soc FROM llx_commande where rowid=$ID$)
At Shipment Level:
socpeople:lastname:rowid::fk_soc=($SEL$ fk_soc FROM llx_expedition where rowid=$ID$)

This seems to work for combining fields:
socpeople:concat(lastname,firstname):rowid::fk_soc=($SEL$ fk_soc FROM llx_expedition where rowid=$ID$)

Thanks @DarJP
I tried your first one for Sales Order with the following error:
image
Bad string syntax to evaluate (mode 2, found call of a function or method without using the direct name of the function): socpeople:lastname:rowid::fk_soc=($SEL$ fk_soc FROM llx_commande where rowid=$ID$)

Ideas?

Other 2 produced the same error.

Will this provide a String (to be printed on ODT)?

Thanks