You need to sign in to do that
Don't have an account?
Rahul Mahale
Data changed by trigger for field Status: data value too large: (value has been hidden)
Hello All,
I have written following code in apex class:
public class StudentSelection {
Public Static Void StudentSelectionCriteria(List<Student__c> StudentListNew){
for(Student__c S : StudentListNew){
if (S.Age__c<=30 && S.Experience__c>8){
S.Status__c='Selected';
}
else if(S.Age__c>30 && S.Experience__c<8){
S.Status__c='Not Selected';
}
}
}
}
Trigger :
trigger StudentSelectionTrigger on Student__c (before insert) {
if(Trigger.isBefore==True && Trigger.isInsert==True){
StudentSelection.StudentSelectionCriteria(Trigger.New);
}
}
Can you check while satisfying not selected condition i am gettin error:
StudentSelectionTrigger: data changed by trigger for field Status: data value too large: (value has been hidden)
Also can we use only else instead of if else??
I have written following code in apex class:
public class StudentSelection {
Public Static Void StudentSelectionCriteria(List<Student__c> StudentListNew){
for(Student__c S : StudentListNew){
if (S.Age__c<=30 && S.Experience__c>8){
S.Status__c='Selected';
}
else if(S.Age__c>30 && S.Experience__c<8){
S.Status__c='Not Selected';
}
}
}
}
Trigger :
trigger StudentSelectionTrigger on Student__c (before insert) {
if(Trigger.isBefore==True && Trigger.isInsert==True){
StudentSelection.StudentSelectionCriteria(Trigger.New);
}
}
Can you check while satisfying not selected condition i am gettin error:
StudentSelectionTrigger: data changed by trigger for field Status: data value too large: (value has been hidden)
Also can we use only else instead of if else??
Plese chek with below article.
https://help.formassembly.com/help/salesforce-error-data-value-too-large
Also, we use else condtion instead of if else
Many Thanks,
Shatrughna Salunke
The code is working well for me.
Datatypes used for the fields: Age-Formula, Experience-Number, and Status-Picklist.
Also, FYI- we cannot use only ' else ' instead of ' else if '. If you want to use only ' else ' then use the below code.
Conditional statements are not allowed if you are using only ' else '.
TriggerHelper:
Trigger:
Thanks & Regards,
Shams Tabrez