You need to sign in to do that
Don't have an account?
Pooja Singh 21
Unable to get a field's value of Master object from Custom Detail object.
Hi All,
I have written a small trigger which does not display the value from Line 6.
trigger TypeOfLienForNVOnProperty on Property__c (before insert, before update, after insert, after update) {
for(Property__c p : Trigger.new){
if(p.Property_State__c != null && p.Property_State__c != '' && p.Property_State__c == 'NV'){
system.debug('Value in State-->' + p.Property_State__c);
system.debug('Value in Type of Loan-->' + p.Opportunity__r.Type_of_Loan__c);
if(p.Opportunity__r.Type_of_Loan__c != null && p.Opportunity__r.Type_of_Loan__c != 'Principal & Interest'){
system.debug('Value in Type of Loan-->' + p.Opportunity__r.Type_of_Loan__c);
p.addError('For Nevada, only "Principal & Interest" is allowed as Type of Lien.');
}
}
Please help to let me know where I did wrong.
I have written a small trigger which does not display the value from Line 6.
trigger TypeOfLienForNVOnProperty on Property__c (before insert, before update, after insert, after update) {
for(Property__c p : Trigger.new){
if(p.Property_State__c != null && p.Property_State__c != '' && p.Property_State__c == 'NV'){
system.debug('Value in State-->' + p.Property_State__c);
system.debug('Value in Type of Loan-->' + p.Opportunity__r.Type_of_Loan__c);
if(p.Opportunity__r.Type_of_Loan__c != null && p.Opportunity__r.Type_of_Loan__c != 'Principal & Interest'){
system.debug('Value in Type of Loan-->' + p.Opportunity__r.Type_of_Loan__c);
p.addError('For Nevada, only "Principal & Interest" is allowed as Type of Lien.');
}
}
Please help to let me know where I did wrong.
if its resolved your issue,please mark as best answer so it will help to other who will serve same problem.
Thanks!
All Answers
if its resolved your issue,please mark as best answer so it will help to other who will serve same problem.
Thanks!