Jim
Jim

Reputation: 423

Sitecore ECM - Change Target Audience Opt In Role

Does anyone know how to update a Sitecore Target Audience Opt in role, via code? I want to change this based on a condition. I have tried:

audience.OptInList.InnerRole = myRole;

But the InnerRole is readonly. I had a look through the developer docs at SDN but couldn't find a way to do this. Is there something I am missing? Does anyone know how to set this?

EDIT: I am using Sitecore 6.5 with rev 121009 ECM 1.3.2

Upvotes: 0

Views: 338

Answers (1)

Ivan Korshun
Ivan Korshun

Reputation: 321

Should be something like this:

audience.OptInList = ContactList.FromName(yourRoleName);

It replaces opt-in role of the Target Audience item.

Upvotes: 3

Related Questions