You need to sign in to do that
Don't have an account?
RAJU_DEEP
Update the record
Hello,
I am having two custom object (dml1__c and dml2__c). The relation between these two object is Lookup Relationship. I want to update the record within the click. Here is the code which i tried.
public void updateDml2(){ List<dml2__c> d2 = [SELECT name, Last_Name__c, Other__c, dml1__r.name, dml1__r.Summary__c FROM dml2__c WHERE name =: dName]; for(dml2__c dm2 : d2){ dm2.Last_Name__c = lName; dm2.Other__c = sum; dm2.dml1__r.Summary__c = sum; update dm2; } }
In the above code when I click the update button the record is updated successfully in dml2__c custom object but the record of dml1__c custom object remains unchanged. Is there any way to do this correctly or guide where I am going wrong.
Any help will be highly appreciable.
Thanks
Raju
All Answers
Hello,
Thanks for your reply, I tried your suggested code and it is working successfully.
Regards & Thanks,
Raju