Error while using Kanban schedule board

When trying to firm the kanbans by dragging a Kanban card to a date on the Kanban schedule board, the below error is occurring.

The weird thing noticed was, when image is getting inserted into SysImageTable, the dataareaid is 'DAT" rather than “XX” (company dataareaid).

how to fix this?

Thanks,

Lakshmi

SysImageTable is not a company specific table. Look at the SaveDataPerCompany on that table. It is set to No, so the data will not be stored per company.
The error (cannot create a record) is due to the violation of unique index.

  1. but there is no violation of unique index. no such data pre-exists in the table.
    Also the code is run only once (during debugging) and at the first insertion, this error is thrown.
    why then unique index violation error is thrown?
  2. Also during record insertion, dataareaid is shown as ‘DAT’ but I am running the code in’XX’ dataareaid. This is the only weird thing I noticed. Is this reason for this error?
  3. is there any other way of finding out the violation problem?
  1. Does that mean you don’t have any data in that table before? Check if any of the fields (in that unique index) are not being filled.
  2. That is not weird. As already told the table is not company specific table.
  3. You need to debug.

Here is the table index

SysImageTable.png

name field is always unique. language and theme are blank for all records.

below is the code where a record is getting inserted

I am getting clueless here as everything looks fine for me. but an error msg is thrown

Any ideas???

The newGuid() function will generate a unique identifier. Not sure what is happening in your case.
For testing can you check, if that same GUID exists before the insert (use a select ).

The newly generated GUID does not exist in the table before insert.
Here is the modified code:

if(SysImageTable::find(imgName,images.Language,images.Theme))
info(‘Record already exists’);
else
{
if(images.validateWrite())
images.insert();
}

there is no existing record and the cursor goes to the ELSE statements.
Validatewrite() is true so, It tries to insert but throws the same error.

Do you know where these image settings exist? Is there any setup issue from kanban side or images side that’s making it throw the error.?

we may have to think about this differently to figure out why that error occurs.

I haven’t worked with the kanban functionality before. I am not even sure, why would it create a record in SysImageTable table.

Never mind, i can see the below call in \Forms\KanbanBoardSchedule\Methods\kanbanJobScheduleUpdated
SysTaskRecorder_Eventing::fire_UserSpecified(strFmt("@SYS4002409", kanbanJobId, plannedPeriod), kanbanJobSchedule);

Can you just try executing this job?
static void test(Args _args)
{
SysImageTable images;
str imgName;
guid imgNameSuffix;
#SysTaskRecorderMacro

imgNameSuffix = newguid();
imgName = #imgImagePrefix + guid2str(imgNameSuffix);

images.Name = imgName;
images.insert();
}

Same error.

The index violation problem is with recid.

In systemsequences table (dat ) company, there is a record for sysimagetable (tabid = 843). the nextVal field value must always be one greater than the maximum recid value of sysImagetable. i.e. newly inserted record will have nextVal recid.

in my system, the value is less than the maximum recid. so a record already exists in sysimagetable with a value less than maximum recid.
for e.g. max recid in SysImagetable is 5637155861. But in Systemsequences table, if nextVal is 5637149086. Then a new record cannot be inserted because a record with recid 5637149086 already exists in SysImageTable.

I have updated the nextval as required and it solved the problem.

Thanks Kranthi for all effort you have taken in understanding and debugging the issue.

That is unusual. The RecId generation is handled by the kernel.
Glad, you were able to identify the issue.