2

Is there any issue or Limitation with Global Picklist while its being deployed from One ORG to another.

I had some Custom Fields and a Global Picklist field. I have written a Trigger on Case to populate a Description field based on the Global Picklist value selected. Everything works fine in my DevORG-A with Unit test and Code Coverage 100%. But when I was trying to deploy the Global Picklist & its values from one Devorg-A to Devorg-B using ChangeSet the Unit Test having trouble. I am able to validate and Deploy with Default options, but whenever I try to 'Run All' Tests for checking Code Coverage in Devorg-B its failing.

Error "System.DmlException: Insert failed. First exception on row 0; first error: INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST, bad value for restricted picklist field: Apple IPhone: [ProductList_Consumer__c]"

I was able to only fix it by Deleting the Global Picklist from Devorg-B and again recreating it.

  • Check whether the Global Value Set values match in both orgs. Also check if the field using the global value set is restricted to those picklust values, then make sure the value specified in one of your test methods matches a valid value from the global value set. – Boris Bachovski Jun 8 '17 at 6:56
  • @BorisBachovski Thanks for reply. Yes I have checked the both mentioned above. Also since the flag value for global picklist is restricted always we cant uncheck, I found an idea raised in portal for uncheck for flexibility. – Robert Thomas Jun 8 '17 at 7:05
  • Based on your error message there must be a test method in one of your test classes which is trying to set either null or another picklist value into that field, which is not part of the Global Value Set. You'll have to dig that out and update the code to set an appropriate value. – Boris Bachovski Jun 8 '17 at 7:07
  • I tried this is in some Fresh ORG and code is very simple and I checked couple of times. I found a similar case reported by another guy called John opfocus.com/… – Robert Thomas Jun 8 '17 at 7:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.