web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Custom Field - D365F&O Subscription Billing

(0) ShareShare
ReportReport
Posted on by 27
We are seeking help urgently please

CRM Integration Project
***********************

Module: Subscription Billing
Customisation: Added 3 new fields
                             1. ReleaseDate
                             2. CostOfSale
                             3. VendorAccount

Added these 3 fields in SubBillScheduleLineEntity, SubBillScheduleLineStaging, SubBillScheduleLine
Able to see the mapping in DMF, entity refresh done.

Issue: Unable to update the custom fields from DMF and API

Workout: Added 3 buffer fields to entity to hold the values to update, SubReleaseDate, SubVendAccount, SubCostOfSale


Extended the data entity class added logic to the update method(updateEntityDataSource)  as below,

public boolean updateEntityDataSource(DataEntityRuntimeContext _entityCtx, DataEntityDataSourceRuntimeContext _dataSourceCtx)
{
    boolean retloc;
    SubBillScheduleLineEntity lineEntityloc = _entityCtx.getEntityRecord();
    SubBillScheduleLine lineupd;

    retloc = next updateEntityDataSource(_entityCtx, _dataSourceCtx);
       
    select firstonly lineupd where lineupd.SUBBILLBILLINGSCHEDULENUMBER == lineEntityloc.ScheduleNumber
        && lineupd.LINENUM == lineEntityloc.LINENUM;

    if(lineupd)
    {
        ttsbegin;
        lineupd.selectforupdate(true);
        lineupd.ReleaseDate = lineEntityloc.SubReleaseDate;
        lineupd.VendAccount = lineEntityloc.SubVendAccount;
        lineupd.CostOfSale = lineEntityloc.SubCostOfSale;
        lineupd.doupdate();
        ttscommit;
    }
    return retloc;
}


 
  • Also added the mapping fields(mapEntityToDataSource) in the below method.
     
public void mapEntityToDataSource(DataEntityRuntimeContext _entityCtx, DataEntityDataSourceRuntimeContext _dataSourceCtx)
{
    next mapEntityToDataSource(_entityCtx, _dataSourceCtx);

    this.SubReleaseDate = this.ReleaseDate;
    this.SubVendAccount = this.VendAccount;
    this.SubCostOfSale = this.CostOfSale;
}
 
  • After this code update, Custom fields are updated from DMF and API. But facing another issue as both the custom and standard fields together in the API and DMF are not updating and throwing the error as below.

DMF Error - Results. Import to target failed due to an update conflict as more than one process is trying to update the same record at the same time. Please try again.

API Error -
      "message":"Write failed for table row of type 'SubBillScheduleLineEntity'. Infolog: Info: Cannot edit a record in Billing schedule line (SubBillScheduleLine).\nAn update conflict occurred due to another user process deleting the record or changing one or more fields in the record..","type":"Microsoft.Dynamics.Platform.Integration.Services.OData.

Below is the API Body, trying to update the fields,

--batch_1234

Content-Type: multipart/mixed; boundary=changeset_567

--changeset_567
Content-Type: application/http
Content-Transfer-Encoding: binary

PATCH /data/SubBillBillingScheduleLines(dataAreaId=’XXXX’,ScheduleNumber=XXXX-SUB000007',LineNum=1)?cross-company=true HTTP/1.1
Content-ID: 1
Accept: application/json
Content-Type: application/json
{
"ReleaseDate": "2026-02-15",
  "CostOfSale": 15,
  "VendAccount": "XXXX_VEN-000000002",
  "LineNum": 1,
"CustomerRef": "Testing on 03Feb",
“Quantity”: 25,
“UnitPrice”: 25

}
--changeset_567--
--batch
 
Categories:
I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    302,293 Super User 2025 Season 2 on at
    Moved the question from the Dynamics 365 General to the Dynamics 365 Finance forum.
     
  • Suggested answer
    André Arnaud de Calavon Profile Picture
    302,293 Super User 2025 Season 2 on at
    Hi Anne-Marie,
     
    I wonder if the custom fields are added to the source/target table or are existing fields. In case these are part of a data source in the data entity, it should be possible to add the fields, rather than virtual columns. Can you share more details about the source tables, the custom fields and what exactly was configured as table or data entity extension?
     
    Anyway, in the data entity method, you should not find and update records in case they are also part of the data entity. In that case, you only need to fill the buffers with the correct field values. 
  • Anne Marie G Profile Picture
    27 on at
     
    Thank you very much for your swift response. My colleague Saranya Dintakurthi is the developer working on this and she has submitted a response with the detail but it is currently showing as 'pending review'. Hopefully it should appear below shortly.
     
    Many thanks
    AM
  • André Arnaud de Calavon Profile Picture
    302,293 Super User 2025 Season 2 on at
    Thanks Anne Marie, 

    The reply from your colleague is not visible yet. Did she create a new account? Let's wait on the message to appear. If it will take too long, I can reach out to the community administrators.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 607 Super User 2025 Season 2

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 437 Super User 2025 Season 2

#3
Martin Dráb Profile Picture

Martin Dráb 363 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans