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

IDmsTable method GetPrimaryKeys returning zero

Solved509 views2nd April 2025
3
Amar Genjac [SLC] [DevOps Advocate]204 24th September 2024 0 Comments

Hi Community,

I'm having issues with the method GetPrimaryKeys from the IDmsTable. I'm trying to retrieve the primary keys from the table but I keep getting 0 as the output. I'm not sure if that it is intended use of the method or am I mistaken. Workaround that I did was to call GetData from the IDmsTable which then returned the primary keys correctly.

Thanks.

Amar Genjac [SLC] [DevOps Advocate] Selected answer as best 2nd April 2025

2 Answers

  • Active
  • Voted
  • Newest
  • Oldest
0
Amar Genjac [SLC] [DevOps Advocate]204 Posted 24th September 2024 4 Comments

Hi Geovanny, I cannot put screenshot in the comment on your comment, so I'll start a new comment section. I'm trying to do it through the automation script. This is the way I was trying to do it:

The first approach is the one that is working and actually getting me the primary keys, while the second one is the one I have troubles with. I'm not sure what I could be doing wrong here.

EDIT: As there were no more updates/suggestions, if anyone comes across this issue again, feel free to use the workaround above 🙂

Thanks.

Amar Genjac [SLC] [DevOps Advocate] Selected answer as best 2nd April 2025
Geovanny Galeano [SLC] [DevOps Advocate] commented 24th September 2024

I just did a small test and for me this code does return the primary keys.
IDms thisDms = engine.GetDms();
var element = thisDms.GetElement(“Dummy 1″);
var table = element.GetTable(100);
var keys = table.GetPrimaryKeys();

engine.GenerateInformation($”Length of keys {keys.Length}”);

In cube information event
Length of keys 10 (Script ‘AutomationScript1’)

Can you check that your elements.First() does have a reference to the element that you are trying to manipulate. Maybe print the element name in a information event, after that i would check the TablePID to make sure its the correct one.

Also what version of dataminer are you using?

Amar Genjac [SLC] [DevOps Advocate] commented 25th September 2024

Already did all of that before asking here, I was getting back the correct table and the ID of the table. Also, in regards to the .First();, it is working fine in the above method in the screenshot, so really there is no reason for it not to work few lines below. For the dataminer version, it is 10.4.7.0-14517. Thanks!

Geovanny Galeano [SLC] [DevOps Advocate] commented 30th January 2025

Hi Amar, did you get this working, by any chance?

Amar Genjac [SLC] [DevOps Advocate] commented 30th January 2025

Hi Geovanny, unfortunately no, I couldn't make this to work. But I used a workaround that I've put in the comment above.

0
Geovanny Galeano [SLC] [DevOps Advocate]725 Posted 24th September 2024 0 Comments

Hi Amar,

Could you post a screenshot of your code to see how you are doing it?

Also are you doing this from inside a connector or an automation script?

Regardless no matter from where you are doing it the GetPrimaryKeys() should be returning a string[] with the keys of that table. As long as that table has rows. I'm assuming there is something wrong with your set up of the Idms object.

Geovanny Galeano [SLC] [DevOps Advocate] Answered question 24th September 2024
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 | 3 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