CultureName is ignored when generating documents or substituting template variables

Status: Reported

Description
  1. Create a SuperOffice document template with the {date} template variable
  2. Generate a document using this template - notice that the date is formatted according to your local date format settings
  3. Use the following script to generate the document using the document template you generated:
 
#setLanguageLevel 3;
 
NSListAgent listAgent;
NSDocumentAgent documentAgent;
 
Integer documentTemplateId = 0;
Integer contactId = 0;
 
NSDocumentEntity documentEntity = documentAgent.CreateDefaultDocumentEntity();
 
NSDocumentTemplate documentTemplate = listAgent.GetDocumentTemplate(documentTemplateId);
documentEntity.SetDocumentTemplate(documentTemplate);
 
documentEntity.SetName("sample_bug_culture" + getCurrentDateTime().toString("YY4MM2DD2_HH24MI2SS2") + ".docx");
documentEntity.SetHeader("sample_bug_culture" + getCurrentDateTime().toString());
documentEntity.SetDate(getCurrentDateTime());
 
 
documentEntity = documentAgent.SaveDocumentEntity(documentEntity);    
 
Map customTags;
 
documentAgent.CreateNewPhysicalDocumentFromTemplateWithCustomTags2(contactId, 0, 0, documentEntity.GetDocumentId(), 0, 0, 0, customTags, "nl-NL");

 

Observed that: the date in the document is not formatted using the nl-NL culture, or any other culture you pass in that method.
Expected that: the formatting of a specific would work when using the script.
Detaljer
Problem id 37238
Registreret 21 dec. 2022
Sidst ændret 11 jul. 2024
Alvorsgrad Medium
Område Sales
Status Reported
Mål for frigivelse
Type Bug