Set-based operations in Dynamics 365 Dynamics 365 Finance and Operations. Cannot insert the value NULL into column 'Name', table 'TableName'; column does not allow nulls. UPDATE/INSERT fails.

When a set-based operation is used (e.g., update_recordset or insert_recordset), and an error occurs with the message "Cannot insert the value NULL into column 'Name', table 'TableName'; the column does not allow NULLs. UPDATE/INSERT fails", it means that no corresponding record was found in the joined table, so a null value was fetched and tried to be inserted into the table's column. 

It can happen if values are obtained from outer-joined data sources when there is no corresponding record in the outer-joined table, and thus a null value is retrieved.

Another case is when values are obtained from views, and those views contain calculated columns whose values can be "empty".

The solution can be using "inner join" with update_recordset and insert_recordset commands, or by using a standard "while select" clause with a view that has calculated columns.

For example, if the view is used and the code below throws the mentioned error: "Cannot insert the value NULL into column 'Name', table 'TableName'; the column does not allow NULLs. UPDATE fails"

TableForecast     tableForecast;

OperationSumView  operationSumView;

update_recordset tableForecast

    setting ItemId    = operationSumView.ItemId,
            ItemName  = operationSumView.ItemName
join ItemId, ItemName from operationSumView
    where operationSumView.RefRecId == tableForecast.RecId;

It is an example of how it can be changed to avoid the error.

while select forupdate tableForecast

join ItemId, ItemName from operationSumView
   where operationSumView.RefRecId == tableForecast.RecId
{
   tableForecast.ItemId    = operationSumView.ItemId;
   tableForecast.ItemName  = operationSumView.ItemName;
   tableForecast.update();
}

Dynamics 365 Finance and Operations: How to overwrite system fields.

In some cases, we need to modify the values of system fields. Below is a code example of how to do this. The key points are the "OverwriteSystemFieldsPermission" and "overwriteSystemFields" commands:

public void insert()

{
   // Assert and enable the system overwrite permission and metadata property.
   new OverwriteSystemfieldsPermission().assert();

   this.overwriteSystemfields(true);

   this.setAuditFieldsAnonymous();

   super();

   // Revert and disable the system overwrite permission and metadata property.
   this.overwriteSystemfields(false);
   CodeAccessPermission::revertAssert();
}

public void update()

{
   // Assert and enable the system overwrite permission and metadata property.
   new OverwriteSystemfieldsPermission().assert();

   this.overwriteSystemfields(true);
   this.setAuditFieldsAnonymous();
     
   super();
 
   // Revert and disable the system overwrite permission and metadata property.
   this.overwriteSystemfields(false);
   CodeAccessPermission::revertAssert();
}

public void setAuditFieldsAnonymous()

{
   utcdatetime  now = DateTimeUtil::utcNow();
   SysDictField createdByField;
   SysDictField createdDateTimeField;
   SysDictField modifiedByField;
   SysDictField modifiedDateTimeField;

   createdByField = new SysDictField(tableNum(Table), 

                                    fieldNum(Table, CreatedBy));
   createdDateTimeField = new SysDictField(tableNum(Table), 
                                           fieldNum(Table, CreatedDateTime));
   modifiedByField = new SysDictField(tableNum(Table), 
                                      fieldNum(Table, ModifiedBy));
   modifiedDateTimeField = new SysDictField(tableNum(Table), 
                                            fieldNum(Table, ModifiedDateTime));
           

   if (createdByField.isSQL())

   {
      this.(fieldNum(Table, CreatedBy)) = '';
   }

 

   if (modifiedByField.isSQL())
   {
      this.(fieldNum(Table, ModifiedBy)) = '';
   }

 

   if (modifiedDateTimeField.isSql())
   {
      this.(fieldNum(Table, ModifiedDateTime)) = now;
   }

 

   if (this.RecId == 0 && createdDateTimeField.isSql())
   {
      // CreatedDateTime is only set on insert.
      this.(fieldNum(Table, createdDateTime)) = now;
   }
}

Lifecycle Services (LCS) portal retirement announcement

Based on announcements regarding Microsoft Dynamics 365 Finance & Operations, February 16, 2026, marks a major shift in how environments are managed, with the transition of key capabilities from Lifecycle Services (LCS) to the Power Platform Admin Center (PPAC). 

Creating all new D365 Finance and Operations (F&O) cloud implementation projects will be routed through the Power Platform Admin Center (PPAC), rather than created in the LCS, which has been the traditional approach for years. As a result, environment actions, support motions, and governance checks will be moved to be in PPAC, not assumed from LCS.

Environment actions, support motions, and governance checks will be moved to be in PPAC, not assumed from LCS.

Existing projects, on-premises deployments, Commerce, and AX 2012 upgrades will continue to use LCS for the time being. To migrate existing LCS projects to PPAC, Microsoft provides a guide.

Set-based operations in Dynamics 365 Dynamics 365 Finance and Operations. Cannot insert the value NULL into column 'Name', table 'TableName'; column does not allow nulls. UPDATE/INSERT fails.

When a set-based operation is used (e.g., update_recordset or insert_recordset), and an error occurs with the message " Cannot insert t...