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");
Solved! Go to Solution.
The correct syntax is:
RecordId = obj.Interface.AddRecord();
obj.Interface.SetValue("TestField", RecordId, "Test");
The record ID is returned by the AddRecord() method.
The correct syntax is:
RecordId = obj.Interface.AddRecord();
obj.Interface.SetValue("TestField", RecordId, "Test");
The record ID is returned by the AddRecord() method.
Discuss challenges in energy and automation with 30,000+ experts and peers.
Find answers in 10,000+ support articles to help solve your product and business challenges.
Find peer based solutions to your questions. Provide answers for fellow community members!