Welcome to the new Schneider Electric Community

It's your place to connect with experts and peers, get continuous support, and share knowledge.

  • Explore the new navigation for even easier access to your community.
  • Bookmark and use our new, easy-to-remember address (community.se.com).
  • Get ready for more content and an improved experience.

Contact SchneiderCommunity.Support@se.com if you have any questions.

Close
Invite a Co-worker
Send a co-worker an invite to the Exchange portal.Just enter their email address and we’ll connect them to register. After joining, they will belong to the same company.
Send Invite Cancel
84547members
353802posts

Add record to DataTable externally

EcoStruxure Geo SCADA Expert Forum

Find out how SCADA systems and networks, like EcoStruxure Geo SCADA Expert, help industrial organizations maintaining efficiency, processing data for smarter decision making with IoT, RTU and PLC devices.

Solved
DavidSkilbeck
Lt. Commander
Lt. Commander
0 Likes
1
701

Add record to DataTable externally

Hi,

from the schema for CDBObject I see the below.

 

AddRecord Add Row Adds a new record to a data table. Control [retval] Record (Long) : Record ID of the new record in the data table.

 

The below code works. However, I thought I would be able to use - obj.Interface.AddRecord(RecordId); to return the record id of the new record.

But, it does not allow me. Unless I am going about the syntax wrong? Thanks,

 

 

obj.Interface.AddRecord();
RecordId = obj.Interface.RecordCount(RecordId);
RecordId = RecordId - 1;
obj.Interface.SetValue("TestField", RecordId, "Test");

 

 

Tags (1)

Accepted Solutions
AndrewScott
Commander
Commander

Re: Add record to DataTable externally

The correct syntax is:

 

RecordId = obj.Interface.AddRecord();
obj.Interface.SetValue("TestField", RecordId, "Test");

 

The record ID is returned by the AddRecord() method. 


Andrew Scott, Lead Engineer, AVEVA

See Answer In Context

Tags (1)
1 Reply 1
AndrewScott
Commander
Commander

Re: Add record to DataTable externally

The correct syntax is:

 

RecordId = obj.Interface.AddRecord();
obj.Interface.SetValue("TestField", RecordId, "Test");

 

The record ID is returned by the AddRecord() method. 


Andrew Scott, Lead Engineer, AVEVA
Tags (1)