Difference between revisions of "GroupBuilderUserInfomationVariable class"

From Catglobe Wiki
Jump to: navigation, search
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
 
{{CGscriptClass_Template
 
{{CGscriptClass_Template
|Name=GroupBuilderUserInfomationVariable
+
|Name=<nowiki>GroupBuilderUserInfomationVariable</nowiki>
|Description=Represents a group builder variable for users with specific user information.
+
|Description=<nowiki>Represents a group builder variable for users with specific user information.</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=AddPhoneType|Parameters=
+
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>AddPhoneType</nowiki>|Parameters=
{{CGscriptParameters_Template|Type=string|Name=phonetype|Description=Add specific phone type}}
+
{{CGscriptParameters_Template|Type=string|Name=<nowiki>phonetype</nowiki>|Description=<nowiki>Add specific phone type</nowiki>}}
|Description=Add a new phone type}}
+
|Description=<nowiki>Add a new phone type</nowiki>}}
{{CGscriptMethods_Template|ReturnType=string|Name=GetPhoneType|Parameters=
+
{{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>GetPhoneType</nowiki>|Parameters=
{{CGscriptParameters_Template|Type=int|Name=index|Description=Index}}
+
{{CGscriptParameters_Template|Type=int|Name=<nowiki>index</nowiki>|Description=<nowiki>Index</nowiki>}}
|Description=Get phone type at the given index}}
+
|Description=<nowiki>Get phone type at the given index</nowiki>}}
{{CGscriptMethods_Template|ReturnType=array|Name=PossiblePhoneTypes|Description=Get all of the possible phone type}}
+
{{CGscriptMethods_Template|ReturnType=array|Name=<nowiki>PossiblePhoneTypes</nowiki>|Description=<nowiki>Get all of the possible phone type</nowiki>}}
{{CGscriptMethods_Template|ReturnType=bool|Name=RemovePhoneType|Parameters=
+
{{CGscriptMethods_Template|ReturnType=bool|Name=<nowiki>RemovePhoneType</nowiki>|Parameters=
{{CGscriptParameters_Template|Type=string|Name=phonetype|Description=Remove specific phone type}}
+
{{CGscriptParameters_Template|Type=string|Name=<nowiki>phonetype</nowiki>|Description=<nowiki>Remove specific phone type</nowiki>}}
|Description=Remove phone type. Return true if removed}}
+
|Description=<nowiki>Remove phone type. Return true if removed</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=string|Name=CountryIsoCode|HasGetter=1|HasSetter=1|Description=Get users with specific country}}
+
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>CountryIsoCode</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Get users with specific country</nowiki>}}
{{CGscriptProperties_Template|ReturnType=string|Name=CultureIsoCode|HasGetter=1|HasSetter=1|Description=Get users with specific culture}}
+
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>CultureIsoCode</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Get users with specific culture</nowiki>}}
{{CGscriptProperties_Template|ReturnType=string|Name=EmailDomain|HasGetter=1|HasSetter=1|Description=Find users with specific @domain at the end of the email address. Only used if HaveEmail is true}}
+
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>EmailDomain</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Find users with specific @domain at the end of the email address. Only used if HaveEmail is true</nowiki>}}
{{CGscriptProperties_Template|ReturnType=bool|Name=ExcludeInvalidEmail|HasGetter=1|HasSetter=1|Description=Exclude those users that bounced an email}}
+
{{CGscriptProperties_Template|ReturnType=bool|Name=<nowiki>ExcludeInvalidEmail</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Exclude those users that bounced an email</nowiki>}}
{{CGscriptProperties_Template|ReturnType=bool|Name=HaveEmail|HasGetter=1|HasSetter=1|Description=If true, find only users with email}}
+
{{CGscriptProperties_Template|ReturnType=bool|Name=<nowiki>HaveEmail</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>If true, find only users with email</nowiki>}}
{{CGscriptProperties_Template|ReturnType=bool|Name=HavePhoneNumber|HasGetter=1|HasSetter=1|Description=Find users with phonenumbers}}
+
{{CGscriptProperties_Template|ReturnType=bool|Name=<nowiki>HavePhoneNumber</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Find users with phonenumbers</nowiki>}}
{{CGscriptProperties_Template|ReturnType=string|Name=LanguageIsoCode|HasGetter=1|HasSetter=1|Description=Get users with specific language}}
+
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>LanguageIsoCode</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Get users with specific language</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=PhoneNumberCountryIsoCode|HasGetter=1|HasSetter=1|Description=Get users with phonenumber in the specific country}}
+
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>PhoneNumberCountryIsoCode</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Get users with phonenumber in the specific country</nowiki>}}
{{CGscriptProperties_Template|ReturnType=int|Name=PhoneNumberFrom|HasGetter=1|HasSetter=1|Description=Find users with a phonenumber in a specific range}}
+
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>PhoneNumberFrom</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Find users with a phonenumber in a specific range</nowiki>}}
{{CGscriptProperties_Template|ReturnType=int|Name=PhoneNumberTo|HasGetter=1|HasSetter=1|Description=Find users with a phonenumber in a specific range}}
+
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>PhoneNumberTo</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Find users with a phonenumber in a specific range</nowiki>}}
{{CGscriptProperties_Template|ReturnType=int|Name=PhoneTypeCount|HasGetter=1|Description=Number of specific phone types}}
+
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>PhoneTypeCount</nowiki>|HasGetter=1|Description=<nowiki>Number of specific phone types</nowiki>}}
{{CGscriptProperties_Template|ReturnType=int|Name=PointBalanceFrom|HasGetter=1|HasSetter=1|Description=Find users with a point balance atleast this amount}}
+
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>PointBalanceFrom</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Find users with a point balance atleast this amount</nowiki>}}
{{CGscriptProperties_Template|ReturnType=int|Name=PointBalanceTo|HasGetter=1|HasSetter=1|Description=Find users with a point balance no more than this amount}}
+
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>PointBalanceTo</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Find users with a point balance no more than this amount</nowiki>}}
{{CGscriptProperties_Template|ReturnType=int|Name=QuestionnaireResourceId|HasGetter=1|HasSetter=1|Description=Questionnaire to get users from}}
+
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>QuestionnaireResourceId</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Questionnaire to get users from</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> ===
 
=== <span style="color:#DF8621">'''Examples'''</span> ===
 
<source lang="javascript">
 
<source lang="javascript">
Line 52: Line 53:
  
 
userInfomationVariable.HaveEmail=true;
 
userInfomationVariable.HaveEmail=true;
userInfomationVariable.EmailDomain="b.c"
+
userInfomationVariable.EmailDomain="b.c";
 
userInfomationVariable.ExcludeInvalidEmail=true;  
 
userInfomationVariable.ExcludeInvalidEmail=true;  
  

Latest revision as of 05:52, 2 July 2020

GroupBuilderUserInfomationVariable


Represents a group builder variable for users with specific user information.

Parent class

Inherits from GroupBuilderVariable

Constructors

  • () - Create new variable

Methods

  • Empty AddPhoneType(string phonetype "Add specific phone type") - Add a new phone type
  • string GetPhoneType(int index "Index") - Get phone type at the given index
  • array PossiblePhoneTypes() - Get all of the possible phone type
  • bool RemovePhoneType(string phonetype "Remove specific phone type") - Remove phone type. Return true if removed
  • (From object) string ToString() - The string representation of the object.

Properties

  • string CountryIsoCode { get; set; } - Get users with specific country
  • string CultureIsoCode { get; set; } - Get users with specific culture
  • string EmailDomain { get; set; } - Find users with specific @domain at the end of the email address. Only used if HaveEmail is true
  • bool ExcludeInvalidEmail { get; set; } - Exclude those users that bounced an email
  • bool HaveEmail { get; set; } - If true, find only users with email
  • bool HavePhoneNumber { get; set; } - Find users with phonenumbers
  • string LanguageIsoCode { get; set; } - Get users with specific language
  • string ObjectTypeName { get; } - The name of the type of object.
  • string PhoneNumberCountryIsoCode { get; set; } - Get users with phonenumber in the specific country
  • int PhoneNumberFrom { get; set; } - Find users with a phonenumber in a specific range
  • int PhoneNumberTo { get; set; } - Find users with a phonenumber in a specific range
  • int PhoneTypeCount { get; } - Number of specific phone types
  • int PointBalanceFrom { get; set; } - Find users with a point balance atleast this amount
  • int PointBalanceTo { get; set; } - Find users with a point balance no more than this amount
  • int QuestionnaireResourceId { get; set; } - Questionnaire to get users from
  • (From object) TypeInformation TypeInformation { get; } - Get information about this class.


Examples

//Create a new group
string groupName = "Test Group Builder: userInfomationVariable  ";
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 (15560790);
GroupBuilderUserInfomationVariable userInfomationVariable  = new GroupBuilderUserInfomationVariable  ();
userInfomationVariable.QuestionnaireResourceId = 55109;
userInfomationVariable.CountryIsoCode="dk";
userInfomationVariable.CultureIsoCode = "da-DK";
userInfomationVariable.LanguageIsoCode ="da-DK";

userInfomationVariable.HaveEmail=true;
userInfomationVariable.EmailDomain="b.c";
userInfomationVariable.ExcludeInvalidEmail=true; 

array allPhoneTypes = userInfomationVariable.PossiblePhoneTypes();
print(allPhoneTypes);// {NotIdentified,Home1,Home2,Mobile1,Mobile2,Business1,Business2,HomeFax,BusinessFax,Main1,Main2,Fax1,Fax2}

userInfomationVariable.HavePhoneNumber=true;
string phonetype ="NotIdentified";
userInfomationVariable.AddPhoneType(phonetype);
userInfomationVariable.PhoneNumberCountryIsoCode="dk";

userInfomationVariable.PointBalanceFrom = 100;
userInfomationVariable.PointBalanceTo = 200;

GroupBuilderRule rule = new GroupBuilderRule (root);
rule.Add(userInfomationVariable); 
GroupBuilderRuleCollection ruleColection = root.RootRules;
ruleColection.Add(rule); 
root.Save();