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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Unanswered

Auto item charge assignment

(0) ShareShare
ReportReport
Posted on by 260

Greetings to all of you!

I am implementing an automation, which requires the below automation , when an item is added on sales lines:

1) Auto-create through AL an item charge line.

2) Auto-Assign this item charge to this specific item.

I have already managed to create the item charge line but i have some concerns regarding the auto assignment process.

As far as i noticed, the system , does not , pre-create in the item charge assignment table , the lines, when you insert on sales lines an item charge type of line.Instead, this procedure happens on Action when you click the item charge assignment action on the sales order subform.

So. I basically need , in the same section of code that i auto create and insert the item charge line, to run this procedure so that the system will create in the item charge sales table the needed records.
How can i do that? Is it possible to run the OnAction trigger of the Item Charge Assignment, through code? 

Any thoughts?

Thank you in advance.

With respect,

Antonis

I have the same question (0)
  • AntonisK Profile Picture
    260 on at

    UPDATE:

    I have used the procedure below which basically creates the item charge lines after i have already inserted the item charge line.

    Var

    InsertSalesLines: Record Sales Lines

    .

    .

    .

    InsertSalesLines.ShowItemChargeAssgnt();

    However, the system automatically pops up the item charge assignment page and needs to be closed manually.

    https://prnt.sc/9mxLsxsJgx-D

    Is there a way to stop this happening or manage to close the page automatically so that the user dont have to close manually this page?

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,857 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,047 Super User 2026 Season 1

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 959 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans