LogRecord with none mandatory Foreign Key

  

Hi guys, Im having a trouble when dealing with LogRecord from AsynchronousLogging Extension.

I have this entity with 2 Foreign Keys, neither of them are mandatory. 

When I try to create a record using LogRecord( To Object(...) ) with NullIdentifier() value in this 2 FKs, I receive a FOREIGN KEY constraint error in service center. On the other hand when I use Create action directly from entity, it simply works fine.

I assume that this error is raised when I convert the record to object with null value in this 2 FKs.

Hope you guys can help me.

Best Regards,

Tomás Dionísio.

Hi Tomás,

I was able to reproduce this issue. It seems that when records are inserted through the LogRecord action, the platform is not converting "NullIdentifier()" to actual NULL, which is what is done in the entity's Create action precisely so that you don't get this error message.

It looks like a bug to me.

Aurelio Junior wrote:

Hi Tomás,

I was able to reproduce this issue. It seems that when records are inserted through the LogRecord action, the platform is not converting "NullIdentifier()" to actual NULL, which is what is done in the entity's Create action precisely so that you don't get this error message.

It looks like a bug to me.

Hello Aurelio
I found out that if you delete those Foreign Keys's Indexes from your entity, it seems to solve this issue :)


Thanks tho,

Best Regards.