Skip to content

Conversation

@tuan-nguyen-fenwick
Copy link
Contributor

@tuan-nguyen-fenwick tuan-nguyen-fenwick commented Oct 28, 2025

Change log:

  • Salespersons: Spread sales documents across more salespeople.
  • Open orders: Added more open sales orders.
  • Back orders: Added more sales backorders.
  • Due dates: Spread out the due date of existing sales documents.
  • Deferral codes: Added deferral codes to posted and unposted sales documents.
  • Discounts: Added line discounts to posted sales invoices.

Fixes: #29346
Fixes AB#597341

Tuan Nguyen added 30 commits June 26, 2025 15:20
Tuan Nguyen added 3 commits October 16, 2025 09:49
Several improvements to the sales analytics demo data include:
- Spread sales documents across more salespeople.
- Added more open sales orders.
- Added more sales backorders.
- Spread out due dates.
- Added deferral codes to posted and unposted sales documents.
- Added line discounts to posted sales invoices.

Test container: http://bcdev2.fenwicksoftware.com.au:10320/BC/?company=Demo12-Sales

Related work items: microsoft#27654
@tuan-nguyen-fenwick tuan-nguyen-fenwick requested a review from a team as a code owner October 28, 2025 00:21
@github-actions
Copy link
Contributor

Could not find linked issues in the pull request description. Please make sure the pull request description contains a line that contains 'Fixes #' followed by the issue number being fixed. Use that pattern for every issue you want to link.

@JesperSchulz JesperSchulz added the SCM GitHub request for SCM area label Oct 29, 2025
attilatoury
attilatoury previously approved these changes Nov 26, 2025
PredragMaricic
PredragMaricic previously approved these changes Nov 26, 2025
@tuan-nguyen-fenwick
Copy link
Contributor Author

@darjoo Hi Darrick, would you be able to review and complete this pull request please?

ChethanT
ChethanT previously approved these changes Nov 27, 2025
@JesperSchulz JesperSchulz self-assigned this Dec 5, 2025
@JesperSchulz JesperSchulz added the processing-PR The PR is currently being reviewed label Dec 5, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2025

Processing this PR. The branch is now locked 🔒 Please don't push updates unless otherwise agreed.


using Microsoft.Purchases.Document;
using Microsoft.DemoTool.Helpers;
using Microsoft.DemoData.Bank;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be sorted alphabetically

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usings are already sorted in alphabetical order

@JesperSchulz
Copy link
Contributor

Internal build fails with:

The Deferral Account field must have a value (Cannot be null or empty) in the Deferral Template table: Deferral Code=3M.
--------------------- CorrelationId: 4776659f-db73-4960-a81d-8103617d6223. Status: 400 (The Deferral Account field must have the value (Must not
--------------------- be zero or empty) in the Deferral Template table: Deferral Code=3M.) ErrorCode:
--------------------- Application_FieldValidationException Content: {"error":{"code":"Application_FieldValidationException","message":"Field
--------------------- Deferral Account must have a value (Must not be zero or equal to 9) in the Deferral table
--------------------- Template: Deferral Code=3M. CorrelationId: 4776659f-db73-4960-a81d-8103617d6223."}} Headers: Server:
--------------------- Microsoft-HTTPAPI/2.0 request-id: 4776659f-db73-4960-a81d-8103617d6223 WWW-Authenticate: Negotiate
--------------------- oRswGaADCgEAoxIEEEAEAAACsbVcwBqovOQAAAAAA= Date: Fri, 05 Dec 2025 12:44:54 GMT Content-Type: application/json
--------------------- Content-Length: 270

@tuan-nguyen-fenwick
Copy link
Contributor Author

Internal build fails with:

The Deferral Account field must have a value (Cannot be null or empty) in the Deferral Template table: Deferral Code=3M.
--------------------- CorrelationId: 4776659f-db73-4960-a81d-8103617d6223. Status: 400 (The Deferral Account field must have the value (Must not
--------------------- be zero or empty) in the Deferral Template table: Deferral Code=3M.) ErrorCode:
--------------------- Application_FieldValidationException Content: {"error":{"code":"Application_FieldValidationException","message":"Field
--------------------- Deferral Account must have a value (Must not be zero or equal to 9) in the Deferral table
--------------------- Template: Deferral Code=3M. CorrelationId: 4776659f-db73-4960-a81d-8103617d6223."}} Headers: Server:
--------------------- Microsoft-HTTPAPI/2.0 request-id: 4776659f-db73-4960-a81d-8103617d6223 WWW-Authenticate: Negotiate
--------------------- oRswGaADCgEAoxIEEEAEAAACsbVcwBqovOQAAAAAA= Date: Fri, 05 Dec 2025 12:44:54 GMT Content-Type: application/json
--------------------- Content-Length: 270

Hi @JesperSchulz

It would be great if you could provide a call stack for me to further investigate.

As far as I know, I was able to generate demo data normally in my BC environment. I checked and even got some sales invoice lines posted with deferral codes in the database. My platform build is US Business Central 28.0 (Platform 28.0.40012.0 + Application 28.0.40329.0).

image

And the Deferral Template records are created successfully.
image

Here is the link to the code that creates and populates the Deferral Template with a deferral account:
https://github.com/microsoft/ALAppExtensions/blob/main/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Finance/1.Setup%20data/CreateDeferralTemplate.Codeunit.al

@JesperSchulz
Copy link
Contributor

The build output was a little strange. Let me try to rerun. If it fails again, I'll try to dig for more details.

@tuan-nguyen-fenwick
Copy link
Contributor Author

tuan-nguyen-fenwick commented Dec 16, 2025

The build output was a little strange. Let me try to rerun. If it fails again, I'll try to dig for more details.

@JesperSchulz Do you have any update on this?

@JesperSchulz
Copy link
Contributor

The build output was a little strange. Let me try to rerun. If it fails again, I'll try to dig for more details.

@JesperSchulz Do you have any update on this?

Unfortunately it failed again. However, it fails on the "BuildDatabase" task, which is a little unusual. And it only seems to be failing in local versions! The W1 database builds, but all local versions fail:

[2025-12-12 15:41:18] Initialize CRONUS International Ltd.. Language ID 2067
Invoking codeunit '2' on tenant '' on server 'NAV_BE'.
[2025-12-12 15:41:23] Run and generate full Contoso demo data.
Invoking codeunit '5193' on tenant '' on server 'NAV_BE'.
[2025-12-12 15:42:49] Inner exception:
[2025-12-12 15:42:49] Invoke-jobNAVCodeunit: Deferral Account moet een waarde hebben in Deferral Template: Deferral Code=3M. Het veld kan niet nul of leeg zijn. 
--------------------- CorrelationId:  e8e833e1-1ddd-4b98-b72e-62f53fa6c9f9. Status: 400 (Deferral Account moet een waarde hebben in Deferral
--------------------- Template: Deferral Code=3M. Het veld kan niet nul of leeg zijn.) ErrorCode: Application_FieldValidationException 
--------------------- Content: {"error":{"code":"Application_FieldValidationException","message":"Deferral Account moet een waarde hebben in
--------------------- Deferral Template: Deferral Code=3M. Het veld kan niet nul of leeg zijn.  CorrelationId: 
--------------------- e8e833e1-1ddd-4b98-b72e-62f53fa6c9f9."}}  Headers: Server: Microsoft-HTTPAPI/2.0 request-id:
--------------------- e8e833e1-1ddd-4b98-b72e-62f53fa6c9f9 WWW-Authenticate: Negotiate oRswGaADCgEAoxIEEAEAAADUMbvR6aqemgAAAAA= Date: Fri, 12
--------------------- Dec 2025 14:42:33 GMT Content-Type: application/json Content-Length: 240

I'm afraid I don't have time to investigate further. We will need someone from the SCM team to look into this, if needed. @PredragMaricic, FYI.

@tuan-nguyen-fenwick
Copy link
Contributor Author

tuan-nguyen-fenwick commented Dec 17, 2025

Unfortunately it failed again. However, it fails on the "BuildDatabase" task, which is a little unusual. And it only seems to be failing in local versions! The W1 database builds, but all local versions fail:

[2025-12-12 15:41:18] Initialize CRONUS International Ltd.. Language ID 2067
Invoking codeunit '2' on tenant '' on server 'NAV_BE'.
[2025-12-12 15:41:23] Run and generate full Contoso demo data.
Invoking codeunit '5193' on tenant '' on server 'NAV_BE'.
[2025-12-12 15:42:49] Inner exception:
[2025-12-12 15:42:49] Invoke-jobNAVCodeunit: Deferral Account moet een waarde hebben in Deferral Template: Deferral Code=3M. Het veld kan niet nul of leeg zijn. 
--------------------- CorrelationId:  e8e833e1-1ddd-4b98-b72e-62f53fa6c9f9. Status: 400 (Deferral Account moet een waarde hebben in Deferral
--------------------- Template: Deferral Code=3M. Het veld kan niet nul of leeg zijn.) ErrorCode: Application_FieldValidationException 
--------------------- Content: {"error":{"code":"Application_FieldValidationException","message":"Deferral Account moet een waarde hebben in
--------------------- Deferral Template: Deferral Code=3M. Het veld kan niet nul of leeg zijn.  CorrelationId: 
--------------------- e8e833e1-1ddd-4b98-b72e-62f53fa6c9f9."}}  Headers: Server: Microsoft-HTTPAPI/2.0 request-id:
--------------------- e8e833e1-1ddd-4b98-b72e-62f53fa6c9f9 WWW-Authenticate: Negotiate oRswGaADCgEAoxIEEAEAAADUMbvR6aqemgAAAAA= Date: Fri, 12
--------------------- Dec 2025 14:42:33 GMT Content-Type: application/json Content-Length: 240

I'm afraid I don't have time to investigate further. We will need someone from the SCM team to look into this, if needed. @PredragMaricic, FYI.

@JesperSchulz Thanks, I think this error message is much clearer now. I'll further investigate from my end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

processing-PR The PR is currently being reviewed SCM GitHub request for SCM area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve analytics sales dataset in Demo Data Tool

5 participants