Difference between revisions of "EmailTemplate TemplateGetAllFromParent"

From Catglobe Wiki
Jump to: navigation, search
(Created page with "Category:Email_and_SMS_Functions {{HelpFiles}} ==== EmailTemplate_TemplateGetAllFromParent ==== Return an array containing all email templates An array which contains e...")
 
 
Line 31: Line 31:
 
for(number i=0;i< emailTemplates.Count;i++)  
 
for(number i=0;i< emailTemplates.Count;i++)  
 
  {
 
  {
print(emailTemplates[i].CreatedDate);
+
print(emailTemplates[i].CreatedDate);
print(emailTemplates[i].ModifiedDate);
+
print(emailTemplates[i].ModifiedDate);
print(emailTemplates[i].ObjectTypeName);
+
print(emailTemplates[i].ObjectTypeName);
print(emailTemplates[i].ParentResourceId);
+
print(emailTemplates[i].ResourceId);
print(emailTemplates[i].ResourceId);
+
print(emailTemplates[i].ParentResourceId);
print(emailTemplates[i].ParentResourceId);
+
print(emailTemplates[i].SubjectDefaultLanguage);
print(emailTemplates[i].SubjectDefaultLanguage);
+
if(i==emailTemplates.Count-1){
if(i==emailTemplates.Count-1){
+
emailTemplates[i].SubjectDefaultLanguage = "SUBTEST";
emailTemplates[i].SubjectDefaultLanguage = "SUBTEST";
+
emailTemplates[i].Save();
emailTemplates[i].Save();
+
print(emailTemplates[i].SubjectDefaultLanguage);
print(emailTemplates[i].SubjectDefaultLanguage);
+
}
}
 
  
 
  print("==============================");
 
  print("==============================");
Line 51: Line 50:
 
2016-03-24 02:36:43
 
2016-03-24 02:36:43
 
EmailTemplate
 
EmailTemplate
15532172
 
 
15532546
 
15532546
 
15532172
 
15532172
Line 59: Line 57:
 
2016-05-31 03:09:38
 
2016-05-31 03:09:38
 
EmailTemplate
 
EmailTemplate
15532172
 
 
15537524
 
15537524
 
15532172
 
15532172
Line 67: Line 64:
 
2016-10-27 08:54:55
 
2016-10-27 08:54:55
 
EmailTemplate
 
EmailTemplate
15532172
 
 
15544386
 
15544386
 
15532172
 
15532172

Latest revision as of 10:12, 27 October 2016


EmailTemplate_TemplateGetAllFromParent

Return an array containing all email templates

An array which contains email templates objects. for infomation click here;


Syntax

EmailTemplate_TemplateGetAllFromParent(parentResourceId);

Arguments

  • parentResourceId: is number. It is parent resource id where contains email templates

Return value

array

Examples

EmailTemplate email = new EmailTemplate(15537524);
number parentRsId = email.ParentResourceId;

array emailTemplates=EmailTemplate_TemplateGetAllFromParent(parentRsId);

for(number i=0;i< emailTemplates.Count;i++) 
 {
 print(emailTemplates[i].CreatedDate);
 print(emailTemplates[i].ModifiedDate);
 print(emailTemplates[i].ObjectTypeName);
 print(emailTemplates[i].ResourceId);
 print(emailTemplates[i].ParentResourceId);
 print(emailTemplates[i].SubjectDefaultLanguage);
 if(i==emailTemplates.Count-1){
 emailTemplates[i].SubjectDefaultLanguage = "SUBTEST";
 emailTemplates[i].Save();
 print(emailTemplates[i].SubjectDefaultLanguage);
 }

 print("==============================");
 }
//result:

2016-03-24 02:25:18
2016-03-24 02:36:43
EmailTemplate
15532546
15532172
Invitation til unders&oslash;gelse
==============================
2016-05-31 03:05:25
2016-05-31 03:09:38
EmailTemplate
15537524
15532172
Invitation til unders&oslash;gelse
==============================
2016-10-26 03:57:45
2016-10-27 08:54:55
EmailTemplate
15544386
15532172
SubNew
SUBTEST
==============================