CRM Client Script .setValue for lookup field

CRM Client Script .setValue for lookup field

Hello, 

What would be a correct way to setValue to a lookup field via client script? I have tried passing the id or the name value, with no luck. Is there a trick?

Thanks