Script That LOOKS UP Data

Script That LOOKS UP Data

Anonymous
Not applicable
1,352 Views
4 Replies
Message 1 of 5

Script That LOOKS UP Data

Anonymous
Not applicable

I'm writing a script that will look at a item field for a code that was enetered at the item creation. Based upon that code the script will "look up" some data in a table or something and use that data in the scripted routine (in this case it will be populating milestine dates).

 

What's the best way to have a script "look up" data? Via another workspace, external file ect.?

 

FYI The idea is that we classify our tasks/workflows by a code. That code indicates a certain period allowed before enetering the various workstates. For example: code A means you have 1 week to enter state "1", 1 week to enter state "2" etc. Code B means you have 2 weeks for each state, Code C......3 weeks and so on. This way when the item is created we can just pick a code and not have to fill in every detail for the milestones.

0 Likes
Accepted solutions (2)
1,353 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
Accepted solution

Orrin,

 

I would think this could be solved using an “if.. or” statement, or depending on the number of options a “case” statment could work as well.

0 Likes
Message 3 of 5

Anonymous
Not applicable

That would work too but would create some rather long code as I have dozens of cases to consider. Also, when I modify the data I don't want to have to scan through the script. I'd rather edit a table or something.

 

To be direct, how would I look up an item property in different workspace and pass that item/array to my current workspce via scripting?

0 Likes
Message 4 of 5

Anonymous
Not applicable
Accepted solution

Orrin,

 

You could have a separate Workspace that holds an index of sort, and based on the inputted information it could reference this workspace which in turn could direct the script to look for the proper information, be it a grid or another record. An example of this can be seen in the custom number gen with in the base tenant.

 

However in either case, I would look at reducing the automation as the time out possibility or fault locations on this could be quite painful for you in the long run.

0 Likes
Message 5 of 5

Anonymous
Not applicable

I followed your suggestion and it works well enough. My Java programmer likes it too so we will proceed that way.

 

Cheers!

0 Likes