Solved

Exception: System.NullReferenceException: Object reference not set to an instance of an object.

  • 2 September 2022
  • 4 replies
  • 636 views

Userlevel 4
Badge +11

in one of our NON-PROD environments (luckily :-)), we encounter issue when updating a TASK record, always get below error the first time the record is updated.  The second time the same record is updated, it doesn’t get this exception error.

 

We noticed it from mobile side.  The first update is not transferred to mobile.  After the 2nd update, then the modification is visible in mobile.

 

Server log of fist update will show this exception.  The server log 2nd update doesn’t contain this exception.


Message: The following error was encounter when attempting to export a task record with the key task_id=[task_id].

Exception:

System.NullReferenceException: Object reference not set to an instance of an object.

   at Metrix.BusinessServer.BusinessPolicies.BusObjectPolicy.AddExportColumnData(MetrixDataRow rowIn, BusObject tableMetadataIn, XmlDocument& outboundMessageInOut, XmlElement& primaryNodeInOut, XmlElement& originalNodeInOut, BusObjExport exportRowIn, List`1& columnsAddedToMessageInOut, DataRowState dataRowStateIn)

   at Metrix.BusinessServer.BusinessPolicies.BusObjectPolicy.ExportData(MetrixDataRow rowIn, BusObjExport ExportRowIn, MetrixDataRow ParentRowIn, BusObject ParentMetaDataIn)


 

Any idea how to further tracing the issue?

 

~Juni

 

 

icon

Best answer by Saranga Amaraweera 2 September 2022, 16:08

View original

4 replies

Userlevel 7
Badge +22

Hi @JuniSihombing ,

Have you configured an extension table in relation to the task table? Most probably this could be a reason to generate this error while the system is trying to export data for the extension table (if table data is present). Could you check whether the extension table has been setup correctly in the metadata and whether the keys are matched with the extension table?

Userlevel 4
Badge +11

Hi @Saranga Amaraweera,

yes, there is extension table for TASK.

 

Here is the setup for it:

 

in TASK - Relation Def:

Do you see anything missing there? 

Userlevel 4
Badge +11

To avoid the exception, apparently all the existing task-ids must be imported to the extension table.

 

I did try to insert 1 existing task-id to the extension table, and did an update on the record, didn’t get the exception error.

 

Userlevel 4
Badge +11

Thanks for the hint, @Saranga Amaraweera!

Reply