cancel
Showing results for 
Search instead for 
Did you mean: 

Script in Application plan

Nathalie_Maille
Champ on-the-rise
Champ on-the-rise

In a manual application plan in Perceptive, one of my field is assigned to a predefined list.  I would like to know if it is possible to read what value was chosen in the list from a script when indexing the document?

When defining the indexes in the manual application plan designer, I added a simple vb script to display the content of the field

 

msgbox(Field1)

 

But it is always empty even when I pick an item from the list.

 

It works if the field is literal but not with a list.

 

Any suggestions?

 

Nathalie

7 REPLIES 7

BrandonCrespino
Employee
Employee

Hi @Nathalie Maillet - One option is to use the Client API to get the current viewer keys. This will give you the value for all the fields set in the viewer. You can parse the output and use however you want in the logic of your script:

 

Set INObj = GetObject(, "imagenow6.CtrlPanel")' Prerequisite to get the opened viewers instance IDcurViewer = INObj.INGetTopViewerInstance()msgbox INObj.INGetCurrentViewerKeys(curViewer)' Returns DocKeys string from specified Viewer. "^Drawer^Field1^Field2^Field3^Field4^Field5^Doctype^Docname^"

Nathalie_Maille
Champ on-the-rise
Champ on-the-rise

Hi Brandon,

 

Thanks for the quick response!

 

Sounds like a good solution, but I don't know where to use that code? Do I add it in a script in the application plan Field attribute window where you can add a vb script?

 

Nathalie

Hi @Nathalie Maillet  - That is correct. It can be applied to any field as a script. You will obviously have to add more logic in the script related to what is needing to be validated. If you need any guidance on what is needed just let me know what you are trying to check for with the script and I can provide some examples.

Nathalie_Maille
Champ on-the-rise
Champ on-the-rise

Hi Brandon,

 

Thanks a lot for your help.

 

When I copy your code in a vb Script and test it, I get the error :

Script error detected at line 1, position 0.

Description: Un composant ActiveX ne peut pas créer un objet : 'GetObject'