Avatar

Level 4

Hi @David__Garcia ,

I don't think the CounterValue function can be used inside JavaScript. You may use querydef to fetch the value 

var query = xtk.queryDef.create(
<queryDef schema="xtk:counter" operation="select">
<select>
<node expr="@name"/>
<node expr="@value"/>
</select>
<where>
<condition expr="@name= 'nmsSeedMember'"/>
</where>
</queryDef>
);

var resultSet = query.ExecuteQuery();
for each (var row in resultSet.*) {
logInfo(row.@name + " = " + row.@value )
}

Or you can use SOAP API to get incremented value of counter using this function.