FolderResourceTemplate class
Revision as of 07:47, 2 July 2020 by Administrator (talk | contribs)
FullCustomColumnSettings
Settings that affect the rebuild of a full column custom column.
Parent class
Inherits from object
Methods
- (From object) string ToString() - The string representation of the object.
Properties
- string ObjectTypeName { get; } - The name of the type of object.
- (From object) TypeInformation TypeInformation { get; } - Get information about this class.
- int UpdatedNumberOfRows { get; } - Amount of rows needed to return.
- bool WorkOnFullColumnDuringPartialRebuild { get; set; } - If false(default) then during rebuild when accessing another column then only the new rows are returned. Otherwise return the full dataset. Only has effect if set before first reference to column and before returning final result.
Examples
//Example for creating a new FolderResourceTemplate
FolderResourceTemplate folderRT = new FolderResourceTemplate("folderRT name");
folderRT.LocalizedNames={"da-DK":" name in DK", "en-US":" name in US"};
folderRT.DefaultLanguage("da-DK");
folderRT.Save();
//Example for working with an existing FolderResourceTemplate
number folderResourceTemplateRId = 15547989;
ResourceTemplateHelper rth = new ResourceTemplateHelper ();
FolderResourceTemplate folderRT = rth.GetTemplate(folderResourceTemplateRId);
folderRT.ResourceTimeregEnabled=false;
folderRT.Save();
print(folderRT.ResourceName);//folderRT name
print(folderRT.ResourceId);//15547989
//Example for creating new properties
number folderResourceTemplateRId = 15547989;
ResourceTemplateHelper rth = new ResourceTemplateHelper ();
FolderResourceTemplate folderRT = rth.GetTemplate(folderResourceTemplateRId);
new ResourceTemplatePropertyNumber ("propertyNameTypeNumber",false,"description",folderRT);
new ResourceTemplatePropertyBoolean ("propertyNameTypeBoolean",true,"description",folderRT);
new ResourceTemplatePropertyString ("propertyNameTypeString",false,"description",folderRT);
new ResourceTemplatePropertyDateTime ("propertyNameTypeDateTime",false,"description",folderRT);
new ResourceTemplatePropertySingle ("propertyNameTypeSingle",true,"description",folderRT);
new ResourceTemplatePropertyMulti ("propertyNameTypeMulti",false,"description",folderRT);
ResourceTemplatePropertyResource propertyResource = new ResourceTemplatePropertyResource ("propertyNameTypeResource", false, "", folderRT);
propertyResource.AddAllowedResourceType(Resource_Type_Folder,{2071,15504791});
folderRT.SaveProperties();
//Example for working with existing properies
number folderResourceTemplateRId = 15547989;
ResourceTemplateHelper rth = new ResourceTemplateHelper ();
FolderResourceTemplate folderRT = rth.GetTemplate(folderResourceTemplateRId);
array arrayProperty = folderRT.Properties;
ResourceTemplatePropertyNumber propertyNumber = arrayProperty[0];
propertyNumber.IsDecimal=true;
ResourceTemplatePropertyString propertyString = folderRT.Properties.First(function (object p){return p.Label=="propertyNameTypeString";});
propertyString.Required =true;
ResourceTemplatePropertyResource propertyResource = folderRT.Properties.First(function (object p){return p.Label=="propertyNameTypeResource";});
propertyResource.RemoveAllowedResourceType(Resource_Type_Folder);
propertyResource.AddAllowedResourceType(Resource_Type_Report);
folderRT.SaveProperties();