Skip to content
Snippets Groups Projects
displayValueProcess.js 701 B
Newer Older
import("Bulkmail_lib");
import("system.text");
import("Employee_lib");
import("system.vars");
import("system.util");
import("system.result");
import("system.neon");
import("DocumentTemplate_lib");

// if this was done for every row, like in a lookup, the performance would be very bad
S.Listl's avatar
S.Listl committed
if (vars.get("$sys.viewmode") == neon.FRAME_VIEWMODE_DATASET && vars.get("$field.content")) 
S.Listl's avatar
S.Listl committed
    var template = new DocumentTemplate(util.encodeBase64String(vars.get("$field.content")), vars.get("$field.templateType"), undefined, true)
    
    var contactId = EmployeeUtils.getCurrentContactId();
    var preview = template.getReplacedContentByContactId(contactId, false, true);
Johannes Hörmann's avatar
Johannes Hörmann committed
    
S.Listl's avatar
S.Listl committed
    result.string(preview);
Johannes Hörmann's avatar
Johannes Hörmann committed
}