Need help to computed complimentary attribute

Hai I created one complimentary attribute in MEMBERS
Foundation members management module .
the complimentary attribute is dcode . I wand a computed complimentary attribute which as decode and Ref number .
if decode = PTA and
Ref = 5
new computed complimentary attribute as PTA-5
please help me by giving the formula to fet is output…
Thnaks …

Hey :slight_smile:

Yes it’s possible, but in fact not so easy…
in fact, in your pot, you speak about complementary attribute named “dcode” or "decode"

you can try this :

(($resql = $db->query('select p.ref, pe.decode from llx_product p, llx_product_extrafields pe where pe.fk_object=p.rowid and p.rowid='.($obj->id ? $obj->id : ($obj->rowid ? $obj->rowid : $object->id))))? (($objsql = $db->fetch_object($resql))?($objsql->decode.'-'.$objsql->ref):'n.a.') :'n.a.')

Good continuation

Thank you…for the help…this code is working …i made a small alteration and i get the id of a drown list …we need the exact value of the list…now de getting 11-9 11 is id of the dropdown list and 9 is the id whih is good to us …we neet to be like ALP-9 …we have values 1,ALP
2,EKM
3,IDK
4,KM
5,KSD
6,KLM
7,KTM
8,KZD
9,MLP
10,PKD
11,PTA
12,TVM
13,TSR
14,WYD

please help…

Hey :slight_smile:

Yes it’s possible, but in fact not so easy, and more difficult than your first request…

You need good (php and Dolibarr)'s knowledges to do this and the you will be able to do this by yourself

Good continuation

thanks for the awesome information.