AnsweredAssumed Answered

Script Parameter vs Named Objects

Question asked by ndveitch on Nov 10, 2017
Latest reply on Nov 10, 2017 by philmodjunk

Hi All,

 

I need to ask the communities opinion on whether to use script parameters or rather name my objects.

 

I have 2 layouts that displays data for my client that comes from the same base table. The information in the base table is split between 2 departments, but with the data being 90% similar, I have used one table to hold the data and 2 layouts to show the data depending on the department they want to see. At the top of the layout I have added a button bar to do the usual print/excel/pdf options and each button is a pop over that has another button bar in the pop over so that the user can print/excel/pdf the data either on the layout they are viewing or all the data for the whole table.

 

Up until now, I just needed to send one parameter to the script and that being either print/excel/pdf and then I use the PatternCount ( Get(LayoutName) ; "Dept1" ) > 0 to tell the script what layout they are on for the department name. Now I need to add to the option to print off related data regarding comments made per department record.

 

The script is going to be easy enough to do, but I was looking at the script, and I was wondering, I am currently passing my script the print/excel/pdf options as a parameter, but now I need to also send it whether the button pressed is for the current layout or the related data (comments) and I can either send the script a list of parameters and then used the GetValue() to set variables and run the script or I was wondering if it might be better to rather name the buttons, for example, button.Print.Comment or button.PDF.Dept, and then use the Get(ActiveLayoutObjectName)  to set the variables??

 

Would there be a benefit to rather using the named object, or should I just stick to sending script parameters?

Outcomes