Is there any way to get table rows in GQI as we have in automation script?
IDmsTable table = elementData.GetTable(Convert.ToInt32(paramTableId));
var primarykeyNames = table.GetPrimaryKeys().ToArray();
for (int i = 0; i < primarykeyNames.Length; i++)
{
var columnData = table.GetColumn<string>(Convert.ToInt32(tableColumnParamId));
if (columnData != null)
{
var columnDataValue = columnData.GetValue(primarykeyNames[i], KeyType.PrimaryKey);
if (columnDataValue != null && !string.IsNullOrEmpty(columnDataValue) && double.TryParse(columnDataValue, out var value))
{
var columnKeyNameData = table.GetDisplayKey(primarykeyNames[i]);
and also columnKeyName data
You can use the exact same API in a GQI extension by following these steps:
- Add the Skyline.DataMiner.Core.DataMinerSystem.Common NuGet package to your project.
- Implement the IGQIOnInit interface for you ad hoc data source/custom operator.
- Use the DMS property on the OnInitInputArgs to get a reference to the GQIDMS object.
- Use the GetConnection method to get a reference to the SLNet connection.
- Use the GetDms extension method on the SLNet connection and store it in a private field somewhere to use it in any life cycle method.
From there you can then request your IDmsElement, IDmsTable, etc. exactly as you would in an automation script.