This topic is locked
[SOLVED]

Dynamic Section Title - with field value

9/10/2022 2:14:31 PM
PHPRunner Tips and Tricks
U
ustunsoz author

In Edit/View pages sometimes you may need to assign field value as section title. This is how I achieve the task:

Following codes goes to 'Javascript onLoad event' of the relevant Edit/View page:

var ctlreqdep = Runner.getControl( pageid, 'requested_department');
var ctlresdep = Runner.getControl( pageid, 'responsible_department');

var section1 = pageObj.getSection(0);
section1.headerElement().find('a').html('<b>'+Runner.getCustomLabel("title_requested_dep")+ctlreqdep.getValue()+'</b>');

var section2 = pageObj.getSection(1);
section2.headerElement().find('a').html('<b>'+Runner.getCustomLabel("title_responsible_dep")+ctlresdep.getValue()+'</b>');

Table Fields: requested_department, responsible_department
Custom Labels: title_responsible_dep, title_requested_dep (you need to assign in Misc>Label Editor>Custom Labels)

M
Mark Kramer 9/10/2022

Nice! Thank you!