Page 1 of 1
Locking an element using TI
Posted: Tue Jan 13, 2009 8:11 am
by Chengooi
I have searched thru TI Help to find out if there is any syntax to lock an element or elements using TI nothing specific to what I am after, does anyone know?
The one in Help requires security grouping but really what I am after was having to be able to send a parameter using TI specifying what element to lock and "bang" it's locked!

Re: Locking an element using TI
Posted: Tue Jan 13, 2009 9:09 am
by David Usherwood
I don't believe this is available - wish it were.
I use rules in cell security cubes, driven by (normal) control cubes. I've read suggestions that cell security gives a performance hit but I think this is manageable if the rules therein are kept simple.
Re: Locking an element using TI
Posted: Tue Jan 13, 2009 12:11 pm
by glaurens
This works, and as you can see, I used the planning sample database, add a few additional parameters, and Bob's your uncle...
Prolog tab:
cubelockoverride(1);
if(lock = 1);
cellputs('admin', '}elementproperties_plan_time', 'JAN-2004', 'lock');
else;
cellputs('', '}elementproperties_plan_time', 'JAN-2004', 'lock');
endif;
G
Re: Locking an element using TI
Posted: Tue Jan 13, 2009 1:44 pm
by David Usherwood
Nice one.
Cubelockoverride is in the list of reserved words but is _not_ (from a brief check) documented in the (9.1) help. Which version are using, and is it documented in that version?
Update - found it in the 9.0 documentation. Think it disappeared when they tore up the locking model for 9.1+. However most of our clients are on 9.0 so very relevant.
Re: Locking an element using TI
Posted: Wed Mar 11, 2009 9:21 pm
by Chengooi
Hi Glaurens
I have tried your code :
cubelockoverride(1);
if(lock = 1);
cellputs('admin', '}elementproperties_plan_', 'JAN-2004', 'lock');
else;
cellputs('', '}elementproperties_plan_time', 'JAN-2004', 'lock');
endif;
I could not saved the TI process as it keep prompting the variable lock undefined, then I went on to define teh variable and it does not allow me to saved, do you have a sample of what /how lock shoudl be define?
also just the line cubelockoverride(1);
it run successfully, but how does it know which cube and element to lock?
Re: Locking an element using TI
Posted: Mon Jul 20, 2015 7:01 am
by roy2087
To Lock an Element (Version Element).
Step 1 :
Data Source Tab:
Cube View [}ElementProperties_0v_Version->Default]
Step 2 :
Variable Tab
vVersion -> String -> Other
vMode -> String -> Other
Value -> String -> Other
Step 3 :
Parameters Tab
pVersion -> String
Step 4 :
Prolog Tab
vMode = 'LOCK';
cellputs('admin', '}elementproperties_0v_Version',pVersion,vMode);
To UnLock an Element (Version Element).
Step 1 : Same as Lock Version.
Step 2 : Same as Lock Version.
Step 3 : Same as Lock Version.
Step 4 :
Prolog Tab
cubelockoverride(1);
vMode = 'LOCK';
Unlock_Version = CellGetS( '}elementproperties_0v_Version',pVersion,vMode);
IF
(
Unlock_Version @= 'Admin'
);
CellPutS('', '}elementproperties_0v_Version',pVersion,vMode);
ENDIF;
Re: Locking an element using TI
Posted: Mon Jul 20, 2015 7:22 am
by lotsaram
roy2087 it makes no sense to use a cube view as data source to lock/unlock an element. To make the process generic datasource should be NONE you just need 3 parameters; dimension, element and lock or unlock.
All code can be on the prolog, you can test for the existence of the }ElementProperties_<dimension> cube and if it doesn't exist then create it before doing any CellPutS.
Re: Locking an element using TI
Posted: Mon Jul 27, 2015 8:39 am
by roy2087
Hi lotsaram ,
Thanks for the advice.
I have made the necessary changes in my TI process.
Modified TI Code for Locking an element(Version Dimension) is as follows:-
Datasource Tab -> None
Advanced tab -> Parameters Tab -> pVersion (String)
Prolog Tab (Code Below)
IF
(
CubeExists('}elementproperties_0v_Version') = 1
);
Check_Version = CellGetS('}elementproperties_0v_Version',pVersion,vMode);
else;
CubeCreate('}elementproperties_0v_Version','0v_Version','}ElementProperties');
ENDIF;
IF
(
Check_Version @= 'Admin'
);
cubelockoverride(1);
CellPutS('admin', '}elementproperties_0v_Version',pVersion,vMode);
ELSE;
CellPutS('admin', '}elementproperties_0v_Version',pVersion,vMode);
ENDIF;
Re: Locking an element using TI
Posted: Mon Jul 27, 2015 9:04 am
by BariAbdul
Code: Select all
ELSE;
CellPutS('admin', '}elementproperties_0v_Version',pVersion,vMode);
ENDIF;
I think admin should be blank '' after else.Thanks
Re: Locking an element using TI
Posted: Mon Jul 27, 2015 10:51 am
by roy2087
Hi Bari Abdul ,
Explanation is as follows:-
*************************************************************************************************************************
#This code is used to get the current status of the version element.
#To get the intersection value in the cube.
IF
(
CubeExists('}elementproperties_0v_Version') = 1
);
Check_Version = CellGetS('}elementproperties_0v_Version',pVersion,vMode);
else;
CubeCreate('}elementproperties_0v_Version','0v_Version','}ElementProperties');
ENDIF;
#If , the intersection is 'Admin' and if the user has entered 'Admin' in the Parameter
#(pVersion) then execute the If - Statement.
IF
(
Check_Version @= 'Admin'
);
cubelockoverride(1);
CellPutS('admin', '}elementproperties_0v_Version',pVersion,vMode);
#Else , the Intersection has returned Blank('') , then WRITE 'Admin' in the Interection .
ELSE;
CellPutS('admin', '}elementproperties_0v_Version',pVersion,vMode);
ENDIF;
*************************************************************************************************************************
Regards,
Roy.
Re: Locking an element using TI
Posted: Mon Jul 27, 2015 11:04 am
by BariAbdul
Thanks Roy.
Re: Locking an element using TI
Posted: Fri Jan 27, 2017 7:38 pm
by jduplessis
I've used the same approach as listed in this thread however, I'm having some odd behavior.
As and Admin and Data Admin running the TI locks or unlocks the version as expected. But running the TI as a member of a group that is not Admin or Data Admin causes the value in the element properties cube to toggle but the version does not actually unlock.
We've tried unlocking the Security Access property of the TI but this seems to have no affect. Any ideas?