Is it possible to set duplex and tumble options in control script?

Is it possible to enable/disable the Duplex and Tumble features in the “Sheet Configuration” options dynamically via a control script?

The XML data I am receiving specifies if a form should be printed with duplex long-edge or short-edge and I need to set these values dynamically versus manually setting the options per section.

At this stage it is not possible to drive these options via a Control Script. You could create separate sections, set the required properties and enable/disable the respective section via Control Script. In the oncoming 1.8 release you will be able to toggle sections using a script wizard (saves you some coding). Scripting these settings is on our roadmap for a future version.

The following toggles the section based on a data field:

var printSections = merge.template.contexts.PRINT.sections;
printSections['Section 1'].enabled = false;
printSections['Section 2'].enabled = false;

if(record.fields.myfield == 'X'){
  printSections['Section 1'].enabled = true;
} else {
  printSections['Section 2'].enabled = true;
}

Erik

Hi Erik,

I have seen you mention this script wizard twice now and I can’t hold back anymore. Will this wizard only do section enable/disable or is there more to look forward too?

Regards,

S

Hi Sharne,

It was one of those features we had in the user interface of legacy PSM (via the Action option in the Layout properties). In Connect Designer all conditions and personalization are handled by scripts in the Scripts panel rather than setting it as an expression on the section or layout. Therefore it is introduced as a script wizard (v1.8). The Control Scripts approach is still working too, underwater the wizard generates a Control Script.

To create a conditional print section simply right click a section and choose Make Conditional… from the contextual menu (similar to making a paragraph conditional). The wizard provides a simple interface to setup a condition. When the condition returns true the section is either included or omitted from the output based on the specified Action. The opposite Action is applied when the condition returns false. The Value(s) fields allows you to state multiple values which acts as an OR. Enter each value on a new line.

In addition a small indicator is shown in the Print Contexts folder located in the resources panel to mark the state for each Print section.

Erik

Hi Erik,

Thanks for the info. Steering Connect in this direction will help users that are not coders. That is why I wanted to see what else this wizard entails for colleagues that don’t code. It is a nice little addition just like the option to select the checkbox to hide a detail table if empty. These little additions also help us coders because it is simply a click or two away as apposed to typing out a script.

PS. I vaguely remember PPS7 but I know it had an On Change option in its conditions. Will an On Change condition be added to Conditional Scripts? It was a very helpful function. Do you know how to trigger something like disabling a section when a field changes in Connects current state?

Regards,

S

Hi Sharne,

Unfortunately we don’t have a way to keep track of changed fields in Connect Designer at this stage. Can you elaborate on the use case?

Best,

Erik

Hi Erik,

I have a section that acts as a splitter page that also contains variable data. If an On Change function existed in Connect I would not need the Workflow metadata scripts or control script in my template thus saving processing time and template management. This splitter section would print/enable when the postal code changed.

With a On Change function it would also be nice to have a function that would count/increment while the postal code has not changed and when it does the counter resets. This would help calculating how many of the same postal code there is in a database without more Workflow scripts. I’m sure many would like these abilities.

Thanks for taking the time to reply to my queries.

Regards,

S