You need to sign in to do that
Don't have an account?

System.DmlException: Update failed. First exception on row 0 with id 0066F00000jPi87QAC; first error: INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST, bad value for restricted picklist field:
Dear All,
Please could someone provide help on the below issue :
I'm facing this issue despite the fact that , I have uncheck the option "Strictly enforce picklist values" on the dependent field. Following is the code which throws this error in PRODUCTION Org , however the passes the testing in SANDBOX :
@istest(SeeAllData=true) private class TestEmailAlertsForQoute { static testmethod void test() { Test.startTest(); Account acc = new Account(name='acc1'); insert acc; Opportunity oppr = new Opportunity(); oppr.AccountId = acc.ID; oppr.Annual_Contract_Value_ACV__c = 111; oppr.BU__c = 'MJ'; oppr.CloseDate = Date.today(); oppr.Contract_Opportunity_Estimate_CoE__c = 111; oppr.Total_Contract_Value_TCV__c = 111; oppr.Name = 'SubmitforQuoteApproval'; oppr.StageName = 'Prospecting'; oppr.Date_on_Opportunity_Prospecting_Stage__c = Date.today(); insert oppr; oppr.Region__c ='North'; oppr.Responsible_Sales_Rep__c ='Siddharth Bhatia'; update oppr; Quote quot1 = new Quote (); quot1.Name = 'TestPropForSandbox2016-10'; quot1.Status ='Draft'; quot1.OpportunityId = oppr.id ; insert quot1; quot1.Status = 'Acceptance by Client'; update quot1 ; Test.stopTest(); } }
Any help resolving the error : System.DmlException: Update failed. First exception on row 0 with id 0066F00000jPi87QAC; first error: INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST, bad value for restricted picklist field: Siddharth Bhatia: [Responsible_Sales_Rep__c]
Stack Trace: Class.TestEmailAlertsForQoute.test: line 24, column 1
Regards,
Debendra
September 27, 2016
Please could someone provide help on the below issue :
I'm facing this issue despite the fact that , I have uncheck the option "Strictly enforce picklist values" on the dependent field. Following is the code which throws this error in PRODUCTION Org , however the passes the testing in SANDBOX :
@istest(SeeAllData=true) private class TestEmailAlertsForQoute { static testmethod void test() { Test.startTest(); Account acc = new Account(name='acc1'); insert acc; Opportunity oppr = new Opportunity(); oppr.AccountId = acc.ID; oppr.Annual_Contract_Value_ACV__c = 111; oppr.BU__c = 'MJ'; oppr.CloseDate = Date.today(); oppr.Contract_Opportunity_Estimate_CoE__c = 111; oppr.Total_Contract_Value_TCV__c = 111; oppr.Name = 'SubmitforQuoteApproval'; oppr.StageName = 'Prospecting'; oppr.Date_on_Opportunity_Prospecting_Stage__c = Date.today(); insert oppr; oppr.Region__c ='North'; oppr.Responsible_Sales_Rep__c ='Siddharth Bhatia'; update oppr; Quote quot1 = new Quote (); quot1.Name = 'TestPropForSandbox2016-10'; quot1.Status ='Draft'; quot1.OpportunityId = oppr.id ; insert quot1; quot1.Status = 'Acceptance by Client'; update quot1 ; Test.stopTest(); } }
Any help resolving the error : System.DmlException: Update failed. First exception on row 0 with id 0066F00000jPi87QAC; first error: INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST, bad value for restricted picklist field: Siddharth Bhatia: [Responsible_Sales_Rep__c]
Stack Trace: Class.TestEmailAlertsForQoute.test: line 24, column 1
Regards,
Debendra
September 27, 2016
That is because you are passing picklist value that is not exist or defined.
Make sure that spelling of 'Siddharth Bhatia'.
Let me know if it helps.
If it helps make it as best answer.
Thanks.
I've validated the value in the picklist and this is defined & Correct in spelling as well - Please advise further.
Thanks.
Regards,
Debendra
Please share the snapshot of Responsible_Sales_Rep__c picklist values.
Thanks.
Do you have any record types?
Make sure that assighned record type for Oppr in test class has access to picklist value 'Siddharth Bhatia'.
Let me know if it helps.
Thanks.
I can't find attachement related to dependent picklist values.
That may be the cause to.
Please attach it one more time
THanks.