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

I am new to apex coding and have this piece of code where I need to prepopulate a Sub account with address from parent account, this works for all fields except Country and State Picklists, any help would be greatly appreciated.
this.SBAAcctLst.add(new SBARelation(0, new Account(RecordTypeId = accRtSBAId,Owner_Fulfillment_Account__c=null, Phone_Type__c='Work',
ShippingStreet=NSBAAcctLst[0].NSBA.ShippingStreet,
ShippingCity=NSBAAcctLst[0].NSBA.ShippingCity,
ShippingState=NSBAAcctLst[0].NSBA.ShippingState,
ShippingCountry=NSBAAcctLst[0].NSBA.ShippingCountry,
ShippingPostalCode=NSBAAcctLst[0].NSBA.ShippingPostalCode), this));
ShippingStreet=NSBAAcctLst[0].NSBA.ShippingStreet,
ShippingCity=NSBAAcctLst[0].NSBA.ShippingCity,
ShippingState=NSBAAcctLst[0].NSBA.ShippingState,
ShippingCountry=NSBAAcctLst[0].NSBA.ShippingCountry,
ShippingPostalCode=NSBAAcctLst[0].NSBA.ShippingPostalCode), this));
By default, ShippingState and ShippingCountry are not picklists,but text fields.
Are you sure you haven't got some custom fields that you should populate?
Give a look at your object Schema (using schemaBuilder or on Setup->Objects) and double check what fields you are actually using on those picklists.
Good Luck!