thong127

Help with script

Discussion created by thong127 on Oct 6, 2015
Latest reply on Oct 6, 2015 by keywords

Hello All,

 

I have a script to view or save my Materials base on their category.

 

Allow User Abort [off]

If Get(ScriptParameter) = "API"

Show Custom Dialog ["View or Save"; Do you want to View Only or Save as Excel?

If Get [(LastMessageChoice)] = 1

Perform Script API

Go to Layout ["Materials List View' (Materials)

End If

If Get [(LastMessageChoice)] = 2

Perform Script API

Go to Layout ["Materials List View" (Materials)

Perform Script [Prep to export]

End If

If Get [(LastMessageChoice)] = 3

Go to Layout[original layout]

End If


If Get(ScriptParameter) = "Bottles"

Show Custom Dialog ["View or Save"; Do you want to View Only or Save as Excel?

If Get [(LastMessageChoice)] = 1

Perform Script Bottles

Go to Layout ["Materials List View' (Materials)

End If

If Get [(LastMessageChoice)] = 2

Perform Script Bottles

Go to Layout ["Materials List View" (Materials)

Perform Script [Prep to export]

End If

If Get [(LastMessageChoice)] = 3

Go to Layout[original layout]

End If

 

f Get(ScriptParameter) = "Capsules"

Show Custom Dialog ["View or Save"; Do you want to View Only or Save as Excel?

If Get [(LastMessageChoice)] = 1

Perform Script Capsules

Go to Layout ["Materials List View' (Materials)

End If

If Get [(LastMessageChoice)] = 2

Perform Script Capsules

Go to Layout ["Materials List View" (Materials)

Perform Script [Prep to export]

End If

If Get [(LastMessageChoice)] = 3

Go to Layout[original layout]

End If


.....and so on


My Custom Dialog box set up is below


Default Button (View) ; Button 2 ( Save) ; Button 3 (Cancel)


Can you please help me simplify my script.


Thank you so much


Thong


 


Outcomes