Difference between revisions of "ActivityHistorySearch class"
(One intermediate revision by the same user not shown) | |||
Line 2: | Line 2: | ||
|Name=<nowiki>ActivityHistorySearch</nowiki> | |Name=<nowiki>ActivityHistorySearch</nowiki> | ||
|Description=<nowiki>Search for activites by users.</nowiki> | |Description=<nowiki>Search for activites by users.</nowiki> | ||
− | |Constructors= | + | |InheritsFrom=object|Constructors= |
{{CGscriptConstructors_Template|Parameters= | {{CGscriptConstructors_Template|Parameters= | ||
{{CGscriptParameters_Template|Type=int|Name=<nowiki>groupResourceId</nowiki>|Description=<nowiki>Resource Id a group containing all users to fetch data for</nowiki>}} | {{CGscriptParameters_Template|Type=int|Name=<nowiki>groupResourceId</nowiki>|Description=<nowiki>Resource Id a group containing all users to fetch data for</nowiki>}} | ||
|Description=<nowiki>Create new default search parameters for communication history. Default is to find no kinds since forever</nowiki>}} | |Description=<nowiki>Create new default search parameters for communication history. Default is to find no kinds since forever</nowiki>}} | ||
{{CGscriptConstructors_Template|Parameters= | {{CGscriptConstructors_Template|Parameters= | ||
− | {{CGscriptParameters_Template|Type= | + | {{CGscriptParameters_Template|Type=Array of ints|Name=<nowiki>userResourceIds</nowiki>|Description=<nowiki>Resource Ids of users to fetch data for</nowiki>}} |
|Description=<nowiki>Create new default search parameters for communication history. Default is to find no kinds since forever</nowiki>}} | |Description=<nowiki>Create new default search parameters for communication history. Default is to find no kinds since forever</nowiki>}} | ||
|Methods= | |Methods= | ||
Line 14: | Line 14: | ||
{{CGscriptParameters_Template|Type=DateTime|Name=<nowiki>from</nowiki>|Description=<nowiki>Date to start searching from, if empty since forever</nowiki>}} | {{CGscriptParameters_Template|Type=DateTime|Name=<nowiki>from</nowiki>|Description=<nowiki>Date to start searching from, if empty since forever</nowiki>}} | ||
|Description=<nowiki>Set date to start searching from</nowiki>}} | |Description=<nowiki>Set date to start searching from</nowiki>}} | ||
− | {{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>}} | ||
Line 25: | Line 25: | ||
{{CGscriptProperties_Template|ReturnType=bool|Name=<nowiki>SearchForQuestionnaireActivity</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Get/Set include questionnaire activit in the result</nowiki>}} | {{CGscriptProperties_Template|ReturnType=bool|Name=<nowiki>SearchForQuestionnaireActivity</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Get/Set include questionnaire activit in the result</nowiki>}} | ||
{{CGscriptProperties_Template|ReturnType=bool|Name=<nowiki>SearchForSMS</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Get/Set include non-bulk SMS in the result</nowiki>}} | {{CGscriptProperties_Template|ReturnType=bool|Name=<nowiki>SearchForSMS</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Get/Set include non-bulk SMS in the result</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>}} |
}} | }} | ||
+ | === <span style="color:#DF8621">'''Examples'''</span> === | ||
+ | |||
+ | <source lang="javascript"> | ||
+ | //get mail, bulkmail history | ||
+ | array userRid = {15210}; | ||
+ | ActivityHistorySearch search = new ActivityHistorySearch(userRid); | ||
+ | search.SearchForMails = true; | ||
+ | search.SearchForBulkMails = true; | ||
+ | search.SearchForSMS = false; | ||
+ | search.SearchForBulkSMS = false; | ||
+ | search.SearchForCati = false; | ||
+ | search.SearchForDialedCati = false; | ||
+ | search.SearchForJournal = false; | ||
+ | search.SearchForQuestionnaireActivity = false; | ||
+ | DateTime dateFrom = new DateTime ("2016/1/30"); | ||
+ | search.SetSearchStartPeriod(dateFrom); | ||
+ | ActivityHistory result = search.Execute(); | ||
+ | result.OrderByDate(); | ||
+ | for(number i = 0; i< result.Count; i++) | ||
+ | { | ||
+ | result.SetCurrent(i); | ||
+ | print(result.ParentResourcePath ); | ||
+ | } | ||
+ | </source> |
Latest revision as of 07:34, 2 July 2020
ActivityHistorySearch
Search for activites by users.
Parent class
Inherits from object
Constructors
- (int groupResourceId "Resource Id a group containing all users to fetch data for") - Create new default search parameters for communication history. Default is to find no kinds since forever
- (Array of int userResourceIds "Resource Ids of users to fetch data for") - Create new default search parameters for communication history. Default is to find no kinds since forever
Methods
- ActivityHistory Execute() - Find all the activities
- Empty SetSearchStartPeriod(DateTime from "Date to start searching from, if empty since forever") - Set date to start searching from
- (From object) string ToString() - The string representation of the object.
Properties
- string ObjectTypeName { get; } - The name of the type of object.
- bool SearchForBulkMails { get; set; } - Get/Set include bulkmails in the result
- bool SearchForBulkSMS { get; set; } - Get/Set include bulk SMS in the result
- bool SearchForCati { get; set; } - Get/Set include cati in the result
- bool SearchForDialedCati { get; set; } - Get/Set include cati calls that the users initiated in the result
- bool SearchForJournal { get; set; } - Get/Set include journal entries in the result
- bool SearchForMails { get; set; } - Get/Set include non-bulkmails in the result
- bool SearchForQuestionnaireActivity { get; set; } - Get/Set include questionnaire activit in the result
- bool SearchForSMS { get; set; } - Get/Set include non-bulk SMS in the result
- (From object) TypeInformation TypeInformation { get; } - Get information about this class.
Examples
//get mail, bulkmail history
array userRid = {15210};
ActivityHistorySearch search = new ActivityHistorySearch(userRid);
search.SearchForMails = true;
search.SearchForBulkMails = true;
search.SearchForSMS = false;
search.SearchForBulkSMS = false;
search.SearchForCati = false;
search.SearchForDialedCati = false;
search.SearchForJournal = false;
search.SearchForQuestionnaireActivity = false;
DateTime dateFrom = new DateTime ("2016/1/30");
search.SetSearchStartPeriod(dateFrom);
ActivityHistory result = search.Execute();
result.OrderByDate();
for(number i = 0; i< result.Count; i++)
{
result.SetCurrent(i);
print(result.ParentResourcePath );
}