function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ 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.