GroupBuilderUserInfomationVariable class: Difference between revisions
From Catglobe Wiki
More actions
Nguyenduyan (talk | contribs)  Created page with "{{CGscriptClass_Template |Name=GroupBuilderUserInfomationVariable |Description=Represents a group builder variable for users with specific user information. |Constructors= {{C..."    | 
				Nguyenduyan (talk | contribs) No edit summary  | 
				||
| Line 34: | Line 34: | ||
{{CGscriptProperties_Template|ReturnType=TypeInformation|Name=TypeInformation|HasGetter=1|Description=Get information about this class.}}  | {{CGscriptProperties_Template|ReturnType=TypeInformation|Name=TypeInformation|HasGetter=1|Description=Get information about this class.}}  | ||
}}  | }}  | ||
=== <span style="color:#DF8621">'''Examples'''</span> ===  | |||
<source lang="javascript">  | |||
//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";antest.antest  | |||
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();  | |||
</source>  | |||
Revision as of 09:52, 20 April 2017
GroupBuilderUserInfomationVariable
Represents a group builder variable for users with specific user information.
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
 - 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
 - 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";antest.antest
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();