Skip to main content
added 2 characters in body
Source Link
Ratan Paul
  • 22.8k
  • 14
  • 55
  • 99

I have below Apex trigger code which fails to enter first if condition which it should do. Can someone suggest me a way out if by maps or other kind of developments? Please Please note " System.debug('@@@ABV_VALIDATION_2');"

System.debug('@@@ABV_VALIDATION_2');

this line is not executing , hence not entering the if-clause .

Apex Trigger

trigger ABV_Validation_Check on Call2_vod__c (after update) {

for (Call2_vod__c Calling: Trigger.new){
System.debug('@@@ABV_VALIDATION_1');
if ((Calling.Parent_Call_vod__r.Status_vod__c == 'Submitted_vod') && (Calling.Account_vod__r.Account_Record_Type_Name_ABT__c != 'Prescriber') && (Calling.Account_vod__r.Account_Record_Type_Name_ABT__c != 'Non-Prescriber with ABS') && (Calling.Attendee_Associated_Prescriber_CIA__c==null) && (Calling.Attendees_vod__c== 0) && (Calling.Is_Parent_Call_vod__c==0))
 {  System.debug('@@@ABV_VALIDATION_2');
 
  if((Calling.RecordType.DeveloperName.contains('HCP_Detail_Call_CIA')) || (Calling.RecordType.DeveloperName.contains('HCP_Detail_Call_Prescriber')))
   {System.debug('@@@ABV_VALIDATION_3');
   calling.addError('trigger Says: Associated Account is required and must be a Prescriber');}

 }
       }
}

I have below Apex trigger code which fails to enter first if condition which it should do. Can someone suggest me a way out if by maps or other kind of developments? Please note " System.debug('@@@ABV_VALIDATION_2');" this line is not executing , hence not entering the if-clause .

Apex Trigger

trigger ABV_Validation_Check on Call2_vod__c (after update) {

for (Call2_vod__c Calling: Trigger.new){
System.debug('@@@ABV_VALIDATION_1');
if ((Calling.Parent_Call_vod__r.Status_vod__c == 'Submitted_vod') && (Calling.Account_vod__r.Account_Record_Type_Name_ABT__c != 'Prescriber') && (Calling.Account_vod__r.Account_Record_Type_Name_ABT__c != 'Non-Prescriber with ABS') && (Calling.Attendee_Associated_Prescriber_CIA__c==null) && (Calling.Attendees_vod__c== 0) && (Calling.Is_Parent_Call_vod__c==0))
 {  System.debug('@@@ABV_VALIDATION_2');
 
  if((Calling.RecordType.DeveloperName.contains('HCP_Detail_Call_CIA')) || (Calling.RecordType.DeveloperName.contains('HCP_Detail_Call_Prescriber')))
   {System.debug('@@@ABV_VALIDATION_3');
   calling.addError('trigger Says: Associated Account is required and must be a Prescriber');}

 }
       }
}

I have below Apex trigger code which fails to enter first if condition which it should do. Can someone suggest me a way out if by maps or other kind of developments? Please note

System.debug('@@@ABV_VALIDATION_2');

this line is not executing , hence not entering the if-clause .

Apex Trigger

trigger ABV_Validation_Check on Call2_vod__c (after update) {

for (Call2_vod__c Calling: Trigger.new){
System.debug('@@@ABV_VALIDATION_1');
if ((Calling.Parent_Call_vod__r.Status_vod__c == 'Submitted_vod') && (Calling.Account_vod__r.Account_Record_Type_Name_ABT__c != 'Prescriber') && (Calling.Account_vod__r.Account_Record_Type_Name_ABT__c != 'Non-Prescriber with ABS') && (Calling.Attendee_Associated_Prescriber_CIA__c==null) && (Calling.Attendees_vod__c== 0) && (Calling.Is_Parent_Call_vod__c==0))
 {  System.debug('@@@ABV_VALIDATION_2');
 
  if((Calling.RecordType.DeveloperName.contains('HCP_Detail_Call_CIA')) || (Calling.RecordType.DeveloperName.contains('HCP_Detail_Call_Prescriber')))
   {System.debug('@@@ABV_VALIDATION_3');
   calling.addError('trigger Says: Associated Account is required and must be a Prescriber');}

 }
       }
}
deleted 4 characters in body
Source Link
Testing_SFDC
  • 3k
  • 10
  • 64
  • 144

I have below Apex trigger code which fails to enter first if condition which it should do. Can someone suggest me a way out if by maps or other kind of developments? Please note "**" System.debug('@@@ABV_VALIDATION_2');**";" this line is not executing , hence not entering the if-clause .

Apex Trigger

trigger ABV_Validation_Check on Call2_vod__c (after update) {

for (Call2_vod__c Calling: Trigger.new){
System.debug('@@@ABV_VALIDATION_1');
if ((Calling.Parent_Call_vod__r.Status_vod__c == 'Submitted_vod') && (Calling.Account_vod__r.Account_Record_Type_Name_ABT__c != 'Prescriber') && (Calling.Account_vod__r.Account_Record_Type_Name_ABT__c != 'Non-Prescriber with ABS') && (Calling.Attendee_Associated_Prescriber_CIA__c==null) && (Calling.Attendees_vod__c== 0) && (Calling.Is_Parent_Call_vod__c==0))
 {  System.debug('@@@ABV_VALIDATION_2');
 
  if((Calling.RecordType.DeveloperName.contains('HCP_Detail_Call_CIA')) || (Calling.RecordType.DeveloperName.contains('HCP_Detail_Call_Prescriber')))
   {System.debug('@@@ABV_VALIDATION_3');
   calling.addError('trigger Says: Associated Account is required and must be a Prescriber');}

 }
       }
}

I have below Apex trigger code which fails to enter first if condition which it should do. Can someone suggest me a way out if by maps or other kind of developments? Please note "** System.debug('@@@ABV_VALIDATION_2');**" this line is not executing , hence not entering the if-clause .

Apex Trigger

trigger ABV_Validation_Check on Call2_vod__c (after update) {

for (Call2_vod__c Calling: Trigger.new){
System.debug('@@@ABV_VALIDATION_1');
if ((Calling.Parent_Call_vod__r.Status_vod__c == 'Submitted_vod') && (Calling.Account_vod__r.Account_Record_Type_Name_ABT__c != 'Prescriber') && (Calling.Account_vod__r.Account_Record_Type_Name_ABT__c != 'Non-Prescriber with ABS') && (Calling.Attendee_Associated_Prescriber_CIA__c==null) && (Calling.Attendees_vod__c== 0) && (Calling.Is_Parent_Call_vod__c==0))
 {  System.debug('@@@ABV_VALIDATION_2');
 
  if((Calling.RecordType.DeveloperName.contains('HCP_Detail_Call_CIA')) || (Calling.RecordType.DeveloperName.contains('HCP_Detail_Call_Prescriber')))
   {System.debug('@@@ABV_VALIDATION_3');
   calling.addError('trigger Says: Associated Account is required and must be a Prescriber');}

 }
       }
}

I have below Apex trigger code which fails to enter first if condition which it should do. Can someone suggest me a way out if by maps or other kind of developments? Please note " System.debug('@@@ABV_VALIDATION_2');" this line is not executing , hence not entering the if-clause .

Apex Trigger

trigger ABV_Validation_Check on Call2_vod__c (after update) {

for (Call2_vod__c Calling: Trigger.new){
System.debug('@@@ABV_VALIDATION_1');
if ((Calling.Parent_Call_vod__r.Status_vod__c == 'Submitted_vod') && (Calling.Account_vod__r.Account_Record_Type_Name_ABT__c != 'Prescriber') && (Calling.Account_vod__r.Account_Record_Type_Name_ABT__c != 'Non-Prescriber with ABS') && (Calling.Attendee_Associated_Prescriber_CIA__c==null) && (Calling.Attendees_vod__c== 0) && (Calling.Is_Parent_Call_vod__c==0))
 {  System.debug('@@@ABV_VALIDATION_2');
 
  if((Calling.RecordType.DeveloperName.contains('HCP_Detail_Call_CIA')) || (Calling.RecordType.DeveloperName.contains('HCP_Detail_Call_Prescriber')))
   {System.debug('@@@ABV_VALIDATION_3');
   calling.addError('trigger Says: Associated Account is required and must be a Prescriber');}

 }
       }
}
Source Link
Testing_SFDC
  • 3k
  • 10
  • 64
  • 144

Apex trigger to throw error message

I have below Apex trigger code which fails to enter first if condition which it should do. Can someone suggest me a way out if by maps or other kind of developments? Please note "** System.debug('@@@ABV_VALIDATION_2');**" this line is not executing , hence not entering the if-clause .

Apex Trigger

trigger ABV_Validation_Check on Call2_vod__c (after update) {

for (Call2_vod__c Calling: Trigger.new){
System.debug('@@@ABV_VALIDATION_1');
if ((Calling.Parent_Call_vod__r.Status_vod__c == 'Submitted_vod') && (Calling.Account_vod__r.Account_Record_Type_Name_ABT__c != 'Prescriber') && (Calling.Account_vod__r.Account_Record_Type_Name_ABT__c != 'Non-Prescriber with ABS') && (Calling.Attendee_Associated_Prescriber_CIA__c==null) && (Calling.Attendees_vod__c== 0) && (Calling.Is_Parent_Call_vod__c==0))
 {  System.debug('@@@ABV_VALIDATION_2');
 
  if((Calling.RecordType.DeveloperName.contains('HCP_Detail_Call_CIA')) || (Calling.RecordType.DeveloperName.contains('HCP_Detail_Call_Prescriber')))
   {System.debug('@@@ABV_VALIDATION_3');
   calling.addError('trigger Says: Associated Account is required and must be a Prescriber');}

 }
       }
}