Difference between revisions of "FullCustomColumnSettings class"

From Catglobe Wiki
Jump to: navigation, search
(Created page with "{{CGscriptClass_Template |Name=<nowiki>FullCustomColumnSettings</nowiki> |Description=<nowiki>Settings that affect the rebuild of a full column custom column.</nowiki> |Method...")
 
 
(7 intermediate revisions by 2 users not shown)
Line 2: Line 2:
 
|Name=<nowiki>FullCustomColumnSettings</nowiki>
 
|Name=<nowiki>FullCustomColumnSettings</nowiki>
 
|Description=<nowiki>Settings that affect the rebuild of a full column custom column.</nowiki>
 
|Description=<nowiki>Settings that affect the rebuild of a full column custom column.</nowiki>
|Methods=
+
|InheritsFrom=object|Methods=
{{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>ToString</nowiki>|Description=<nowiki>The string representation of the object.</nowiki>}}
+
{{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>ToString</nowiki>|Inherited=object|Description=<nowiki>The string representation of the object.</nowiki>}}
 
|Properties=
 
|Properties=
 
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>ObjectTypeName</nowiki>|HasGetter=1|Description=<nowiki>The name of the type of object.</nowiki>}}
 
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>ObjectTypeName</nowiki>|HasGetter=1|Description=<nowiki>The name of the type of object.</nowiki>}}
{{CGscriptProperties_Template|ReturnType=TypeInformation|Name=<nowiki>TypeInformation</nowiki>|HasGetter=1|Description=<nowiki>Get information about this class.</nowiki>}}
+
{{CGscriptProperties_Template|ReturnType=TypeInformation|Name=<nowiki>TypeInformation</nowiki>|HasGetter=1|Inherited=object|Description=<nowiki>Get information about this class.</nowiki>}}
 
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>UpdatedNumberOfRows</nowiki>|HasGetter=1|Description=<nowiki>Amount of rows needed to return.</nowiki>}}
 
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>UpdatedNumberOfRows</nowiki>|HasGetter=1|Description=<nowiki>Amount of rows needed to return.</nowiki>}}
 
{{CGscriptProperties_Template|ReturnType=bool|Name=<nowiki>WorkOnFullColumnDuringPartialRebuild</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>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.</nowiki>}}
 
{{CGscriptProperties_Template|ReturnType=bool|Name=<nowiki>WorkOnFullColumnDuringPartialRebuild</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>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.</nowiki>}}
 
}}
 
}}
 +
=== <span style="color:#DF8621">'''Examples'''</span> ===
 +
<span style="color:#DF8621">Example for make a "Date" custom column (full column) base on "CreateDate"</span>
 +
<source lang="javascript">
 +
array param = Workflow_getParameters();
 +
//Dictionary localCache = param[0];
 +
FullCustomColumnSettings fs = param[1];
 +
array result = {};
 +
for(i for 0; fs.UpdatedNumberOfRows) {
 +
    if (CreatedDate[i] == empty){
 +
result.Add(empty);
 +
}
 +
else{
 +
result.Add(CreatedDate[i][DateTime_Year]*10000 + CreatedDate[i][DateTime_Month]*100 + CreatedDate[i][DateTime_Day]);
 +
 +
}
 +
return result;
 +
</source>
 +
[[File:2020-07-01_9-54-59.png]]
 +
 +
<span style="color:#DF8621">Example for using local cache on custom columns</span>
 +
<source lang="javascript">
 +
//Script on Main column
 +
array param = Workflow_getParameters();//preserved between customcols
 +
Dictionary localCache = param[0];
 +
array aMonth;
 +
array aYear;
 +
array result;
 +
for(i for 0; Id.Count) {
 +
aMonth.Add(12);
 +
aYear.Add(2050);
 +
result.Add(i);
 +
}
 +
localCache["month"]= aMonth;
 +
localCache["year"]= aYear;
 +
return result;
 +
</source>
 +
[[File:MainCol.png]]
 +
 +
<source lang="javascript">
 +
//On slave column "Year" and "Month" just make a return from "mainCol"
 +
return mainCol["month"];
 +
return mainCol["year"];
 +
</source>
 +
[[File:2020-08-04_16-17-32.png]]
 +
 +
And data result on column main and 2 slave columns Month and Year:
 +
 +
[[File:2020-08-04_17-05-14.jpg]]

Latest revision as of 09:34, 18 March 2024

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 make a "Date" custom column (full column) base on "CreateDate"

array param = Workflow_getParameters();
//Dictionary localCache = param[0];
FullCustomColumnSettings fs = param[1];
array result = {};
for(i for 0; fs.UpdatedNumberOfRows) {
    if (CreatedDate[i] == empty){
		result.Add(empty);
	}
	else{
		result.Add(CreatedDate[i][DateTime_Year]*10000 + CreatedDate[i][DateTime_Month]*100 + CreatedDate[i][DateTime_Day]);
	}   
}
return result;

2020-07-01 9-54-59.png

Example for using local cache on custom columns

//Script on Main column
array param = Workflow_getParameters();//preserved between customcols
Dictionary localCache = param[0];
array aMonth;
array aYear;
array result;
for(i for 0; Id.Count) {
	aMonth.Add(12);
	aYear.Add(2050);
	result.Add(i);
}
localCache["month"]= aMonth;
localCache["year"]= aYear;
return result;

MainCol.png

//On slave column "Year" and "Month" just make a return from "mainCol"
return mainCol["month"];
return mainCol["year"];

2020-08-04 16-17-32.png

And data result on column main and 2 slave columns Month and Year:

2020-08-04 17-05-14.jpg