Page 1 of 1
Avoiding duplicate elements in TI script
Posted: Tue Sep 04, 2012 3:23 pm
by svchowdary83
how to prepare the TI script:
user to add in new cost element . when the user enters a new code, the system will have to check through all the elements if the code exist,the system will prompt the user to enter a different code to avoid duplication. If there is no such code, the system will create a new element with the necessarily attributes and alias.
Here cost element is the Dimension name
Its urgent ,can anybody help me on this
Re: Inserting New Elements based some condition by using TI
Posted: Tue Sep 04, 2012 4:07 pm
by asutcliffe
svchowdary83 wrote:how to prepare the TI script:
user to add in new cost element . when the user enters a new code, the system will have to check through all the elements if the code exist,the system will prompt the user to enter a different code to avoid duplication. If there is no such code, the system will create a new element with the necessarily attributes and alias.
Here cost element is the Dimension name
Its urgent ,can anybody help me on this
How far have you managed to get? Writing a TI process to add an element and set a few attributes is pretty straightforward. Take a look at the "DimensionElementInsert" and "AttrPutS" functions if you've not already.
However, prompting a user for a different element name if it already exists isn't really possible in TI alone. One approach I've used is to get the user to enter the element name and attribute values in a simple spreadsheet. Using the "DimIx" worksheet function and a bit of conditional formatting, you can provide feedback to the user if the element already exists. These values can then be passed to a TI process as parameters and the process triggered via an action button.
Note, it isn't possible to create a new element with the same name as an existing one. So if all you're worrying about is avoiding "duplication", you might not need to worry.