3

I am unable to get the allowed actions for a RTF field. any suggestions to allow or deny actions would be of great help.

OrganizationalItemItemsFilterData filter = new OrganizationalItemItemsFilterData();
foreach (XElement element in client.GetListXml(itemId, filter).Nodes())
{                    
    SchemaFieldsData schemaFieldsData = client.ReadSchemaFields(element.Attribute("ID").Value, false, null);
    for (int i=0; i<schemaFieldsData.Fields.Length;i++)
    {
        ItemFieldDefinitionData firstField = schemaFieldsData.Fields[i];                                              
        if (firstField.GetType().Name.Equals("XhtmlFieldDefinitionData"))
        {
        }
6

I believe this is managed in the SchemaData of the schema your item uses, rather than the ItemFieldDefinitionData. If you don't know the schema ID your item will use you can use something like

var schemaId = element.Attribute("SchemaId");

to retrieve it. Once you have this Schema ID,

var schemaData = (SchemaData)client.ClientInstance.Read(schemaId, null);

will return the SchemaData for the item you have found.

The property schemaData.xsd allows you to get and set the source XML for the schema itself.

In your case you'd be looking to update the "DisallowedActions" element contained within the node corresponding to your "XhtmlFieldDefinitionData" field.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.