+ Start a Discussion
Arvind1Arvind1 

Problem in enabling Account as Partner in test method

Hi All,

 

I have a query in my apex class where I am querying Accounts which are enabled as Partner Accounts by checking IsPartner=true.

 

In my test method I am trying to insert an Account and enable it as Partner Account like:

Account partneraccount=new Account(Name='test1',ispartner=true); insert partneraccount;

 

 But I am getting an error like IsPartner not writable.

 

I am not getting how do I enable Account as partner in test method.

 

Any suggestion on this will be of a great help.

 

Thanks

Arvind

jdlforcejdlforce
Use RecordTypeId instead.