Question
auto increment primary key in the datatable
var week = me.GetWeekNumber({ date: when }); // Copied from Stack Overflow, didn't test its correctness
var month = when.getMonth(); // Zero-based
var year = when.getFullYear();
var correctmonth = month +1;
var query = me.CreateValuesWithData({ values: {
value: value,
Kategory: Kategory,
Department:Department,
Line: Line,
SKU : SKU,
KPI_Details: KPI_Details,
Target: Target,
Other_Target : Other_Target,
Other_value : Other_Value,
week: week,
month: correctmonth,
year: year
} });
query.id = me.ID;
var params = {
sourceType: undefined /* STRING */,
values: query /* INFOTABLE*/,
location: undefined /* LOCATION */,
source: undefined /* STRING */,
tags: undefined /* TAGS */
};
if(me.ID !== query.id){
stop();
}
var result = me.AddDataTableEntry(params);

when I refresh the page, it will auto increment one more empty row in the grid widget.
how to fix this problem?

