Difference between revisions of "GroupBuilderContactAmountVariable class"
Nguyenduyan (talk | contribs) (Created page with "{{CGscriptClass_Template |Name=GroupBuilderContactAmountVariable |Description=Represents a group builder variable for contact amount. |Constructors= {{CGscriptConstructors_Tem...") |
|||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
{{CGscriptClass_Template | {{CGscriptClass_Template | ||
− | |Name=GroupBuilderContactAmountVariable | + | |Name=<nowiki>GroupBuilderContactAmountVariable</nowiki> |
− | |Description=Represents a group builder variable for contact amount. | + | |Description=<nowiki>Represents a group builder variable for contact amount.</nowiki> |
− | |Constructors= | + | |InheritsFrom=GroupBuilderVariable|Constructors= |
− | {{CGscriptConstructors_Template|Description=Create new variable}} | + | {{CGscriptConstructors_Template|Description=<nowiki>Create new variable</nowiki>}} |
|Methods= | |Methods= | ||
− | {{CGscriptMethods_Template|ReturnType=Empty|Name=SetFixedDateLimited|Parameters= | + | {{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>SetFixedDateLimited</nowiki>|Parameters= |
− | {{CGscriptParameters_Template|Type=DateTime|Name=fromDate|Description=From date|Comma=,}}{{CGscriptParameters_Template|Type=DateTime|Name=toDate|Description=To date}} | + | {{CGscriptParameters_Template|Type=DateTime|Name=<nowiki>fromDate</nowiki>|Description=<nowiki>From date</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=DateTime|Name=<nowiki>toDate</nowiki>|Description=<nowiki>To date</nowiki>}} |
− | |Description=Set a fixed date limitation}} | + | |Description=<nowiki>Set a fixed date limitation</nowiki>}} |
− | {{CGscriptMethods_Template|ReturnType=Empty|Name=SetFloatingDateLimited|Parameters= | + | {{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>SetFloatingDateLimited</nowiki>|Parameters= |
− | {{CGscriptParameters_Template|Type=int|Name=nrDaysBefore|Description=Number of days before today to start|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=nrDays|Description=Number of days to include}} | + | {{CGscriptParameters_Template|Type=int|Name=<nowiki>nrDaysBefore</nowiki>|Description=<nowiki>Number of days before today to start</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=<nowiki>nrDays</nowiki>|Description=<nowiki>Number of days to include</nowiki>}} |
− | |Description=Set a floating date limitation}} | + | |Description=<nowiki>Set a floating date limitation</nowiki>}} |
− | {{CGscriptMethods_Template|ReturnType=Empty|Name=SetMailType|Parameters= | + | {{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>SetMailType</nowiki>|Parameters= |
− | {{CGscriptParameters_Template|Type=bool|Name=isEmail|Description=Include normal emails sent|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=isBulkmail|Description=Include bulk emails sent}} | + | {{CGscriptParameters_Template|Type=bool|Name=<nowiki>isEmail</nowiki>|Description=<nowiki>Include normal emails sent</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>isBulkmail</nowiki>|Description=<nowiki>Include bulk emails sent</nowiki>}} |
− | |Description=Include normal emails sent and/or bulkmails}} | + | |Description=<nowiki>Include normal emails sent and/or bulkmails</nowiki>}} |
− | {{CGscriptMethods_Template|ReturnType=Empty|Name=SetNotDateLimited|Description=Remove date limitation}} | + | {{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>SetNotDateLimited</nowiki>|Description=<nowiki>Remove date limitation</nowiki>}} |
− | {{CGscriptMethods_Template|ReturnType=string|Name=ToString|Description=The string representation of the object.}} | + | {{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>ToString</nowiki>|Inherited=object|Description=<nowiki>The string representation of the object.</nowiki>}} |
|Properties= | |Properties= | ||
− | {{CGscriptProperties_Template|ReturnType=int|Name=GroupResourceId|HasGetter=1|HasSetter=1|Description=Include only mails sent sent to people in this group}} | + | {{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>GroupResourceId</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Include only mails sent sent to people in this group</nowiki>}} |
− | {{CGscriptProperties_Template|ReturnType=bool|Name=IsBulkmail|HasGetter=1|Description=Include bulk emails sent}} | + | {{CGscriptProperties_Template|ReturnType=bool|Name=<nowiki>IsBulkmail</nowiki>|HasGetter=1|Description=<nowiki>Include bulk emails sent</nowiki>}} |
− | {{CGscriptProperties_Template|ReturnType=bool|Name=IsEmail|HasGetter=1|Description=Include normal emails sent}} | + | {{CGscriptProperties_Template|ReturnType=bool|Name=<nowiki>IsEmail</nowiki>|HasGetter=1|Description=<nowiki>Include normal emails sent</nowiki>}} |
− | {{CGscriptProperties_Template|ReturnType=bool|Name=IsFixedDateLimited|HasGetter=1|Description=Include all users within date range}} | + | {{CGscriptProperties_Template|ReturnType=bool|Name=<nowiki>IsFixedDateLimited</nowiki>|HasGetter=1|Description=<nowiki>Include all users within date range</nowiki>}} |
− | {{CGscriptProperties_Template|ReturnType=bool|Name=IsFloatingDateLimited|HasGetter=1|Description=Include all users within floating date range}} | + | {{CGscriptProperties_Template|ReturnType=bool|Name=<nowiki>IsFloatingDateLimited</nowiki>|HasGetter=1|Description=<nowiki>Include all users within floating date range</nowiki>}} |
− | {{CGscriptProperties_Template|ReturnType=bool|Name=IsNotDateLimited|HasGetter=1|Description=Include all users date wise}} | + | {{CGscriptProperties_Template|ReturnType=bool|Name=<nowiki>IsNotDateLimited</nowiki>|HasGetter=1|Description=<nowiki>Include all users date wise</nowiki>}} |
− | {{CGscriptProperties_Template|ReturnType=string|Name=ObjectTypeName|HasGetter=1|Description=The name of the type of object.}} | + | {{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=Operator|HasGetter=1|HasSetter=1|Description=Include those that received more, the exact or less emails than the target given}} | + | {{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>Operator</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Include those that received more, the exact or less emails than the target given</nowiki>}} |
− | {{CGscriptProperties_Template|ReturnType=int|Name=Target|HasGetter=1|HasSetter=1|Description=Include those that received more, the exact or less emails than the target given}} | + | {{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>Target</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Include those that received more, the exact or less emails than the target given</nowiki>}} |
− | {{CGscriptProperties_Template|ReturnType=int|Name=TargetResourceId|HasGetter=1|HasSetter=1|Description=Include only mails sent directly under this resource}} | + | {{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>TargetResourceId</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Include only mails sent directly under this resource</nowiki>}} |
− | {{CGscriptProperties_Template|ReturnType=TypeInformation|Name=TypeInformation|HasGetter=1|Description=Get information about this class.}} | + | {{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"> | ||
+ | //Create a new group | ||
+ | string groupName = "Test Group Builder: ContactAmountVariable"; | ||
+ | number groupTemplateResourceId=2066; | ||
+ | number parentResourceId = 11088827; | ||
+ | array group = Group_new(groupName, groupTemplateResourceId, parentResourceId); | ||
+ | Group_save(group); | ||
+ | number groupRId = group[GROUP_RESOURCE_ID ]; | ||
+ | |||
+ | //Create rule for the group | ||
+ | GroupBuilderRoot root = new GroupBuilderRoot (groupRId); | ||
+ | |||
+ | GroupBuilderContactAmountVariable ContactAmountVariable = new GroupBuilderContactAmountVariable (); | ||
+ | |||
+ | DateTime fromDate = new DateTime("2017/03/25"); | ||
+ | DateTime toDate = new DateTime("2017/03/31"); | ||
+ | ContactAmountVariable.SetFixedDateLimited(fromDate,toDate); | ||
+ | |||
+ | //number nrDaysBefore = 6; | ||
+ | //number nrDays=5; | ||
+ | //ContactAmountVariable.SetFloatingDateLimited(nrDaysBefore ,nrDays); | ||
+ | |||
+ | bool isEmail = true; | ||
+ | bool isBulkmail = false; | ||
+ | ContactAmountVariable.SetMailType(isEmail, isBulkmail); | ||
+ | |||
+ | //ContactAmountVariable.SetNotDateLimited(); | ||
+ | |||
+ | ContactAmountVariable.GroupResourceId =15560179; | ||
+ | ContactAmountVariable.TargetResourceId =15546533; | ||
+ | ContactAmountVariable.Operator=">"; | ||
+ | ContactAmountVariable.Target=1; | ||
+ | |||
+ | print(ContactAmountVariable.IsBulkmail );// false | ||
+ | print(ContactAmountVariable.IsEmail );// true | ||
+ | print(ContactAmountVariable.IsFixedDateLimited );// true | ||
+ | print(ContactAmountVariable.IsFloatingDateLimited );//false | ||
+ | print(ContactAmountVariable.IsNotDateLimited );// false | ||
+ | print(ContactAmountVariable.Operator );// > | ||
+ | print(ContactAmountVariable.Target );// 1 | ||
+ | print(ContactAmountVariable.GroupResourceId );// 15560179 | ||
+ | print(ContactAmountVariable.TargetResourceId );// 15546533 | ||
+ | |||
+ | GroupBuilderRule rule = new GroupBuilderRule (root); | ||
+ | rule.Add(ContactAmountVariable); | ||
+ | |||
+ | GroupBuilderRuleCollection ruleColection = root.RootRules; | ||
+ | ruleColection.Add(rule); | ||
+ | |||
+ | root.Save(); | ||
+ | </source> |
Latest revision as of 07:53, 2 July 2020
GroupBuilderContactAmountVariable
Represents a group builder variable for contact amount.
Parent class
Inherits from GroupBuilderVariable
Constructors
- () - Create new variable
Methods
- Empty SetFixedDateLimited(DateTime fromDate "From date", DateTime toDate "To date") - Set a fixed date limitation
- Empty SetFloatingDateLimited(int nrDaysBefore "Number of days before today to start", int nrDays "Number of days to include") - Set a floating date limitation
- Empty SetMailType(bool isEmail "Include normal emails sent", bool isBulkmail "Include bulk emails sent") - Include normal emails sent and/or bulkmails
- Empty SetNotDateLimited() - Remove date limitation
- (From object) string ToString() - The string representation of the object.
Properties
- int GroupResourceId { get; set; } - Include only mails sent sent to people in this group
- bool IsBulkmail { get; } - Include bulk emails sent
- bool IsEmail { get; } - Include normal emails sent
- bool IsFixedDateLimited { get; } - Include all users within date range
- bool IsFloatingDateLimited { get; } - Include all users within floating date range
- bool IsNotDateLimited { get; } - Include all users date wise
- string ObjectTypeName { get; } - The name of the type of object.
- string Operator { get; set; } - Include those that received more, the exact or less emails than the target given
- int Target { get; set; } - Include those that received more, the exact or less emails than the target given
- int TargetResourceId { get; set; } - Include only mails sent directly under this resource
- (From object) TypeInformation TypeInformation { get; } - Get information about this class.
Examples
//Create a new group
string groupName = "Test Group Builder: ContactAmountVariable";
number groupTemplateResourceId=2066;
number parentResourceId = 11088827;
array group = Group_new(groupName, groupTemplateResourceId, parentResourceId);
Group_save(group);
number groupRId = group[GROUP_RESOURCE_ID ];
//Create rule for the group
GroupBuilderRoot root = new GroupBuilderRoot (groupRId);
GroupBuilderContactAmountVariable ContactAmountVariable = new GroupBuilderContactAmountVariable ();
DateTime fromDate = new DateTime("2017/03/25");
DateTime toDate = new DateTime("2017/03/31");
ContactAmountVariable.SetFixedDateLimited(fromDate,toDate);
//number nrDaysBefore = 6;
//number nrDays=5;
//ContactAmountVariable.SetFloatingDateLimited(nrDaysBefore ,nrDays);
bool isEmail = true;
bool isBulkmail = false;
ContactAmountVariable.SetMailType(isEmail, isBulkmail);
//ContactAmountVariable.SetNotDateLimited();
ContactAmountVariable.GroupResourceId =15560179;
ContactAmountVariable.TargetResourceId =15546533;
ContactAmountVariable.Operator=">";
ContactAmountVariable.Target=1;
print(ContactAmountVariable.IsBulkmail );// false
print(ContactAmountVariable.IsEmail );// true
print(ContactAmountVariable.IsFixedDateLimited );// true
print(ContactAmountVariable.IsFloatingDateLimited );//false
print(ContactAmountVariable.IsNotDateLimited );// false
print(ContactAmountVariable.Operator );// >
print(ContactAmountVariable.Target );// 1
print(ContactAmountVariable.GroupResourceId );// 15560179
print(ContactAmountVariable.TargetResourceId );// 15546533
GroupBuilderRule rule = new GroupBuilderRule (root);
rule.Add(ContactAmountVariable);
GroupBuilderRuleCollection ruleColection = root.RootRules;
ruleColection.Add(rule);
root.Save();