Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X
Dear Developers,
I am trying to use the method in the subject, but I am unable to. Checking the documentation, this is the signature:
public void UpdateDataTableEntry(TagCollection tags,
Location location,
java.lang.String source,
java.lang.String sourceType,
InfoTable values)
throws java.lang.Exception
And all the fields besides tags and values are optional. I am wondering what optional does mean in this case (null value?) as this is the only signature available. I have built the values like this, as an example:
InfoTable values = new InfoTable();
ValueCollection row = new ValueCollection();
row.SetIntegerValue("id", id);
values.addRow(row);
and I am not sure about what is the purpose of the tags in this case.
Thank you!
Solved! Go to Solution.
I solved this one myself, I was passing the row in an incorrect way and it resulted empty:
DataShapeDefinition dsd = new DataShapeDefinition();
dsd.addFieldDefinition(new FieldDefinition("id", "NUMBER"));
InfoTable values = new InfoTable(dsd);
ValueCollection row = new ValueCollection();
row.SetNumberValue("id", id);
values.addRow(row.clone());
TagCollection tags = new TagCollection();
someTable.AddDataTableEntry(tags, null, null, null, values);
I solved this one myself, I was passing the row in an incorrect way and it resulted empty:
DataShapeDefinition dsd = new DataShapeDefinition();
dsd.addFieldDefinition(new FieldDefinition("id", "NUMBER"));
InfoTable values = new InfoTable(dsd);
ValueCollection row = new ValueCollection();
row.SetNumberValue("id", id);
values.addRow(row.clone());
TagCollection tags = new TagCollection();
someTable.AddDataTableEntry(tags, null, null, null, values);
Hi Raccone
As my understanding, you can identify the optional parameter business meaning only if we pass the required parameter type (such as string type, infotable type).
Based on help center introduction regarding Data Table Services, provide below demo for understanding the meaning of the parameters (even though below table is the output of another service):
Below is my demo fragment for values:
var values = Things["VendingMachineInventoryTable"].CreateValues(); //or var values=me.CreateValues();
values.productID = ProductID; //STRING
values.currentInvQty = Current; //NUMBER
values.vendPosition = Position; //NUMBER [Primary Key]
values.positionCapacity = Capacity; //NUMBER
values.productPrice = Price; //NUMBER
Best Wishes!
Teresa