AsynchronousLogging LogRecord doesn't understand NULLs?

Hi,

I have tried to insert DB record using AsynchronousLogging.LogRecord - and this went to error:

The INSERT statement conflicted with the FOREIGN KEY constraint "......_REASONID". The conflict occurred in database "....", table "...._REASON", column 'ID'.

That field is entity reference, yes, but it's optional, and the same log shows that it's 0 (which should mean NULL):

REASONID='0'

So I suppose the function attempts to insert 0 when it should be NULL but it doesn't understand it.

Is this known issue? Is there any workaround? (Except changing the field type to Long integer and losing strong relation)

Hi,

If you force the value to "NullIdentifier()" in your logic the error is the same?


Regards,

Ricardo

Ricardo Pereira wrote:

Hi,

If you force the value to "NullIdentifier()" in your logic the error is the same?


Regards,

Ricardo

No, adding assignment to NullIdentifier() didn't help, error is still the same.

Just to be sure, this is how I did it:

I'm running into the same issue.  I have a non-mandatory field that LogRecord must be sending as a 0.  I'm receiving the Foreign Key Constraint error on the Id column of the referenced table.  Maybe this is a limitation of LogRecord