2 answers

Hello Mastram,To bind values using relationship fields you should use the putSObject method instead. Here is an example:
Please refer to:https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_sobject.htm⌗apex_methods_system_sobject (http://https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_sobject.htm⌗apex_methods_system_sobject)Hope to have helped!Regards.Don't forget to mark your thread as 'SOLVED' with the answer that best helps you.Interaction__c test = new Interaction__c();
test.put('Points__c', 43);
test.putSObject('Contact__r', new Contact( LastName='contact'));
system.debug(test.Contact__r.LastName);