Skip to content

Latest commit

 

History

History
34 lines (25 loc) · 2.07 KB

PX1048.md

File metadata and controls

34 lines (25 loc) · 2.07 KB

PX1048

This document describes the PX1048 diagnostic.

Summary

Code Short Description Type Code Fix
PX1048 For the RowInserting and RowSelecting events, only the DAC instance that is passed in the event arguments can be modified in the event handler. Error Unavailable

Diagnostic Description

For the RowInserting and RowSelecting events, only the DAC instance that is passed in the event arguments can be modified in the event handler. Modifications to other DAC instances that are done in the RowInserting event handler can lead to data inconsistency. Modifications to other DAC instances that are done in the RowSelecting event handler can lead to unpredictable system behavior.

To prevent the error from occurring, you should remove from the event handler the code that assigns a value to a DAC field and rework the related business logic. You can move the code from the RowInserting event handler to the RowInserted event handler.

Example of Incorrect Code

protected virtual void SOOrder_RowInserting(PXCache sender, PXRowInsertingEventArgs e)
{
    var order = e.Row as SOOrder;
    if (order == null) return;

    var doc = Orders.Current;
    doc.OrderDate = order.OrderDate; // The PX1048 error is displayed for this line.
    Orders.Update(doc);
}

Related Articles