You need to sign in to do that
Don't have an account?
Doondi
Trigger is giving me Id instead of Name?
Hi,
Below is my simple Trigger on two custom objects with MD relationship,
For Name I am getting Id, where as for Property__c I am getting correct Value.
below is my trigger
Below is my simple Trigger on two custom objects with MD relationship,
For Name I am getting Id, where as for Property__c I am getting correct Value.
below is my trigger
trigger CreateNewRecord on Deal__c (after insert, after update) { set<id> triggerIds = trigger.newMap.keyset(); List <Project__c> Project = [select id, Name, Deal__r.Property__r.Name from Project__c where id in :triggerIds]; for(Deal__c deal : Trigger.new) { if( deal.Type__c == 'New' ) Project.add(new Project__c ( Name = deal.Property__r.Name, // this field is giving ID instead of Name Property__c = deal.Property__c // This field is giving correct update. ) ); } insert Project; }
Please check the below Code:
Thanks
Jolly Birdi
All Answers
your code should be like this
Please check the below Code:
Thanks
Jolly Birdi
@Raj Vakati ThankYou too!! for your time.
please mark it as best answer and make it resolved.
Thanks,
Jolly Birdi