• James Merson
  • NEWBIE
  • 20 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 7
    Replies
I have several apex class tests that are failing because we switched our state and country address fields to picklists.  I tried to correct it in the code but am still getting the same error:

System.DmlException: Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, There's a problem with this country, even though it may appear correct. Please select a country from the list of valid countries.: [BillingCountry] 
Stack Trace: Class.Z_PaymentMethodCaptureControllerTest.createTestAccount: line 276, column 1 Class.Z_PaymentMethodCaptureControllerTest.testAppendMessages: line 185, column 1

When creating the account as part of the test, I code it to input United States, a value in our picklist field for BillingCountry.  

Tried to research answers but am coming up dry.  Any help out there?
This may be a stretch but I'm hoping for someone to help me write a trigger.

We have a lookup field on accounts that filters on related contacts.  Based on a series of conditions being met when a record is edited, we'd like to insert into that field the Contact ID for the related contact with title = Owner.

Conditions to be met are:
Steps_to_Close__c = "Enrolled" - picklist field
Number_of_clients__c = 0 - number field
Franchise_Association__c = Null or "HCA" - picklist field

Field to update:
PM__c to be equal to the contact ID for the related contact whose title = "Owner.

Hoping someone can help a guy with not many resources....

James
I have several apex class tests that are failing because we switched our state and country address fields to picklists.  I tried to correct it in the code but am still getting the same error:

System.DmlException: Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, There's a problem with this country, even though it may appear correct. Please select a country from the list of valid countries.: [BillingCountry] 
Stack Trace: Class.Z_PaymentMethodCaptureControllerTest.createTestAccount: line 276, column 1 Class.Z_PaymentMethodCaptureControllerTest.testAppendMessages: line 185, column 1

When creating the account as part of the test, I code it to input United States, a value in our picklist field for BillingCountry.  

Tried to research answers but am coming up dry.  Any help out there?
This may be a stretch but I'm hoping for someone to help me write a trigger.

We have a lookup field on accounts that filters on related contacts.  Based on a series of conditions being met when a record is edited, we'd like to insert into that field the Contact ID for the related contact with title = Owner.

Conditions to be met are:
Steps_to_Close__c = "Enrolled" - picklist field
Number_of_clients__c = 0 - number field
Franchise_Association__c = Null or "HCA" - picklist field

Field to update:
PM__c to be equal to the contact ID for the related contact whose title = "Owner.

Hoping someone can help a guy with not many resources....

James