Automatic value of multiple links

I have table Documents where I need to choose Contract and Customer (both are linked)

In table Contract I have link to Customer too…

When I am creating new record in Document I wanna simpy choose Contract and get Customer automatically. How can I do it?

I have this JS… It works but doesn’t save any value. Why?

// Only new records (not edited)
        if (doo.model.ver == -1) {
            // SETTING CUSTOMER FROM CONTRACTS
                var Contract = doo.model.DOC_contract.value;
                if (Contract) {doo.model.DOC_customer.value = Contract.CON_client;}
        }

I’ve tried setValue instead but it stops working also… Thanks for help.

Hi Thomas,
setValue is definitely the correct way

Chapter Setting the lookup value
Please contact as at support@tabidoo.cloud if you believe this is an issue on our side.
Regards
Michal

Well I am not sure how to set value of linked input.

// Only new records (not edited)
        if (doo.model.ver == -1) {
            // SETTING CUSTOMER FROM CONTRACTS
                var Contract = doo.model.DOC_contract.value;
                if (Contract) {doo.model.DOC_customer.setValue(Contract.CON_client);}
        }

doesnt work…

Please contact us at support@tabidoo.cloud.
We will probably need to check the application.
Regards
Michal