cancel
Showing results for 
Search instead for 
Did you mean: 

Check if a cell is "Open" in SAC Script with IF statement

pfaffy
Discoverer
0 Kudos
141

Hi all

I want to check the DataLockingState of a cell with an "IF statement".

var lockstate = tbl_locktable.getPlanning().getDataLocking().getState(sel);
if (sv_lockstate === "Open" ) {
....
}

Because "automatical conversion is not supported" in SAC I would like to convert the string "Open"  to type "DataLockingState"?  How can I do this?

Thank you for any help

Best Regards

Frank

 

View Entire Topic
SarauShen
Product and Topic Expert
Product and Topic Expert

Hi Frank,

Instead of string "Open", you should use the data type DataLockingState.Open.  

The sample codes are below:

var sels = Table_1.getSelections();
var lockstate = Table_1.getPlanning().getDataLocking().getState(sels[0]);
if (lockstate === DataLockingState.Open ) {
console.log("open");
}

pfaffy
Discoverer
0 Kudos
That's it... Thank you so much...