Skip to content
DataMiner DoJo

More results...

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Search in posts
Search in pages
Search in posts
Search in pages
Log in
Menu
  • Blog
  • Questions
  • Learning
    • E-learning Courses
    • Open Classroom Training
    • Certification
      • DataMiner Fundamentals
      • DataMiner Configurator
      • DataMiner Automation
      • Scripts & Connectors Developer: HTTP Basics
      • Scripts & Connectors Developer: SNMP Basics
      • Visual Overview – Level 1
      • Verify a certificate
    • Tutorials
    • Video Library
    • Books We Like
    • >> Go to DataMiner Docs
  • Expert Center
    • Solutions & Use Cases
      • Solutions
      • Use Case Library
    • Markets & Industries
      • Media production
      • Government & defense
      • Content distribution
      • Service providers
      • Partners
      • OSS/BSS
    • DataMiner Insights
      • Security
      • Integration Studio
      • System Architecture
      • DataMiner Releases & Updates
      • DataMiner Apps
    • Agile
      • Agile Webspace
      • Everything Agile
        • The Agile Manifesto
        • Best Practices
        • Retro Recipes
      • Methodologies
        • The Scrum Framework
        • Kanban
        • Extreme Programming
      • Roles
        • The Product Owner
        • The Agile Coach
        • The Quality & UX Coach (QX)
    • DataMiner DevOps Professional Program
  • Downloads
  • More
    • Feature Suggestions
    • Climb the leaderboard!
    • Swag Shop
    • Contact
      • General Inquiries
      • DataMiner DevOps Support
      • Commercial Requests
    • Global Feedback Survey
  • PARTNERS
    • All Partners
    • Technology Partners
    • Strategic Partner Program
    • Deal Registration
  • >> Go to dataminer.services

Modifying table parameters with buttons

Solved707 views4th April 2024buttons Table initialisation
2
Ömer Eryaman [DevOps Advocate]476 28th March 2024 0 Comments

Hello,
Setup:

I created a table with 4 columns (see attachment)

thats the definition of the array:

private OfficecheckerQActionRow CreateEventRow(string primaryKey, string workersName,int status)
{
OfficecheckerQActionRow row = new OfficecheckerQActionRow
{
Officecheckerinstance_1001 = primaryKey,
Workersname_1002 = workersName,
Statusoftheworker_1003 = status,
};

return row;
}

with the 4th column "click ..  if u are in the Office"(param id:1004)
i want change the 3rd column "show .. worker in office" (param id:1003)

The button (id:1004) triggers a QAction with this code:

QAction 51 getting triggered by param 1004 (Btn)
public static void Run(SLProtocol protocol)
{
try
{

int outofficeparam = Convert.ToInt32(protocol.GetParameter(1003));

outofficeparam = 1;
protocol.SetParameter(1003, outofficeparam);

}
catch (Exception ex)
{
protocol.Log($"QA{protocol.QActionID}|{protocol.GetTriggerParameter()}|Run|Exception thrown:{Environment.NewLine}{ex}", LogType.Error, LogLevel.NoLogging);
}
}

How can i toggle the 3rd column during pressing the button to "in office" and "out of office"?
My 2nd Question is:
How can i display logs for debugging if the button triggered or values changed internal?

thank you in advance

Ömer Eryaman [DevOps Advocate] Selected answer as best 4th April 2024

1 Answer

  • Active
  • Voted
  • Newest
  • Oldest
2
Laurens Moutton [SLC] [DevOps Enabler]8.70K Posted 28th March 2024 6 Comments

Hi,

The primary key is not specified in the QAction when getting/setting parameter 1003. To know the primary key for the row that was clicked on, specify row="true" on the QAction and inside the QAction get the primary key by calling string key = protocol.RowKey(); . Then get/set parameter 1003 by calling protocol.GetParameterIndexByKey and protocol.SetParameterIndexByKey with the pid being the id of the table (not the column pid) and also include the primary key.

If the write parameter is the only thing that would be modifying parameter 1003 then the QAction could be omitted by using a togglebutton instead. Every time the write is clicked, the read will toggle to the other value, with setter="true" the value will be immediately set without the need of the QAction to process the write value. For more info see documentation here.

Logging can be consulted in the System Center.

Regards,

Ömer Eryaman [DevOps Advocate] Selected answer as best 4th April 2024
Ömer Eryaman [DevOps Advocate] commented 28th March 2024

Thank you very much for the explanation, I just figure it out to modify a value in a table with QActions (an exercise for myself), later I want to write a C# toggle function by my own if the worker in and out of office.

I am still struggling to modify the value cause in the definition of the “bool SetParameterIndexByKey(int iID, string key, int iY, object value);” is very confusing which ID he needs.
iID says the ID of the table param 
————————————
My table: Param 1000

————————————
That’s my code for now:
————————————- QAction
string key = protocol.RowKey();
int outofficeparam = Convert.ToInt32(protocol.GetParameterIndexByKey(1003,key,2));
Console.WriteLine(“getting office param”);
Console.WriteLine(“this is param what we got”,outofficeparam);
outofficeparam = 1;

protocol.SetParameterIndexByKey(1003, key,2,outofficeparam);
Console.WriteLine(“after set”); 
————————————
I wanted to ask how can I print the values that I got in Dataminer?
Like in C# with “Writeline()”

Laurens Moutton [SLC] [DevOps Enabler] commented 29th March 2024

As iID is the id of the table and iY is the 1-based position of the column, the call should be protocol.SetParameterIndexByKey(1000, key, 3, outofficeparam);
“Console” cannot be used in a QAction. To write out logging, this can be done with a protocol.Log message. See help here: https://docs.dataminer.services/develop/api/types/Skyline.DataMiner.Scripting.SLProtocol.Log.html#Skyline_DataMiner_Scripting_SLProtocol_Log_System_String_

Ömer Eryaman [DevOps Advocate] commented 3rd April 2024

Thank you for your answer again,

I just realized that if I press the button inside the table, it doesn’t do anything
I attempted to display information to check if the Row key has a value or the button is triggered
“protocol.ShowInformationMessage(“try to modify param”);”
the message it’s not appearing.

I created a button (id:123) outside the table and execute the same QAction the notification appears
after that, i print the “key” the value is empty:

————————————–
string key = protocol.RowKey();
protocol.ShowInformationMessage(key);
————————————–

how can i print values and messages in the Information events (dataminer Cube) ?

Laurens Moutton [SLC] [DevOps Enabler] commented 3rd April 2024

-When the QAction does not get executed for the button inside the table then it is most probably because the row=”true” attribute is not defined on the QAction.
-About the protocol.RowKey() that is empty for the button outside of the table: this is normal as a rowkey is only available for something in a table, when it is outside of the table then there is no row.
-For the information events: I don’t immediately know how to do this from a QAction as QActions typically write out logging and not spam the information events. I suggest if this needs to be known that a new question is created for this as this seems to be going off topic from the original question.

Ömer Eryaman [DevOps Advocate] commented 3rd April 2024

Okay thank you very much

its works now
how can i close the ticket?

Show 1 more comments
Please login to be able to comment or post an answer.

My DevOps rank

DevOps Members get more insights on their profile page.

My user earnings

0 Dojo credits

Spend your credits in our swag shop.

0 Reputation points

Boost your reputation, climb the leaderboard.

Promo banner DataMiner DevOps Professiona Program
DataMiner Integration Studio (DIS)
Empower Katas

Recent questions

Correlation Engine: “Test rule” doesn’t result in a hit, despite functional rule 1 Answer | 3 Votes
When using the Setter = true attribute, will the copy action always be executed first? 1 Answer | 2 Votes
Multiple Set on Table parameters for DVE’s 1 Answer | 2 Votes

Question Tags

adl2099 (115) alarm (62) Alarm Console (82) alarms (100) alarm template (83) Automation (223) automation scipt (111) Automation script (167) backup (71) Cassandra (180) Connector (109) Correlation (69) Correlation rule (52) Cube (150) Dashboard (194) Dashboards (188) database (83) DataMiner Cube (57) DIS (81) DMS (71) DOM (140) driver (65) DVE (56) Elastic (83) Elasticsearch (115) elements (80) Failover (104) GQI (159) HTTP (76) IDP (74) LCA (152) low code app (166) low code apps (93) lowcodeapps (75) MySQL (53) protocol (203) QAction (83) security (88) SNMP (86) SRM (337) table (54) trending (87) upgrade (62) Visio (539) Visual Overview (345)
Privacy Policy • Terms & Conditions • Contact

© 2025 Skyline Communications. All rights reserved.

DOJO Q&A widget

Can't find what you need?

? Explore the Q&A DataMiner Docs

[ Placeholder content for popup link ] WordPress Download Manager - Best Download Management Plugin