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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Business event based on two table fields

(0) ShareShare
ReportReport
Posted on by 45

Hi experts,

I am working on business event.

I want to create new business event for sales order confirmation which contains fields from header as well from line:

Fields:

SalesId (Header)

Customer# (Header)

Doc Type (Header)

ItemNo (Line)

Qty. (Line)

Price (Line)

I have already developed business event on single table (example : for CustConfirmHeader) but in my current scenario two table involved :fields - SalesId,Customer# , Doc Type )

Can you please guild me, how I'll handle two table fields in business event.

Thanks

Babita

I have the same question (0)
  • Suggested answer
    Sergei Minozhenko Profile Picture
    23,093 on at

    Hi,

    What is your scenario? Looks like you want to use the event message as a composite message (header+lines). But it's not the best practice way.

    Probably you need to fire the event for header and use OData call to read header+lines from D365.

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    What is the functional requirement? What is the trigger for the event? Do you simply want to add information from multiple tables?

    If yes, you can initialize any table buffers in the initialize method of the contract class.

    Or, if you want to trigger the event from multiple tables, simply put your trigger in multiple places.

    Could you describe a bit more what you want to achieve, as well as share all your current code. Thanks!

  • Martin Dráb Profile Picture
    237,801 Most Valuable Professional on at

    Your payload contains data for a single line, while there may be multiple lines. Does it mean that you want to raise an event for each line separately? Or that you want to ignore all lines except of one? Or that your model doesn't match your requirements?

  • microsoft d365 Profile Picture
    45 on at

    Thanks.

    Requirement:  After perfoming Sales confirmation, I want to generate Json file with fields : SalesId,Customer# , Doc Type, ItemNo , Qty. and price.

    as we know these fields we need to bring from two table that is CustConfirmHeader & salesline.

    If data comes from single table I can create the business event for that but here data comes from two table like below structure's (one order with multiple line):

    SalesId

    Customer#

    Doc Type

        ItemNo ,

        Qty.

        price

        ItemNo ,

        Qty.

        price

        ItemNo ,

        Qty.

        price

  • Verified answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    Business event can't contain multiple "lines". It's always flat data.

    So, your event can contain total qty of multiple lines, but it can't contain separate qty of each line.

    Such requirement sounds like something that business events are not meant for. Business events are supposed to be used to send very simple event information from D365FO, not complex messages with heavy payloads.

    Check the documentation: docs.microsoft.com/.../home-page

    Business events must not be considered a mechanism for exporting data. By definition, business events are supposed to be lightweight and nimble. They aren't intended to carry large payloads to fulfill data export scenarios.

    I suggest following approach:

    1) Send business event that contains some key values, such as sales confirmation id, and any other key values that are 1:1 related to Sales confirmation table.

    2) Then the receiver of the event can query the order details via OData using the key values that they received with the event.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 660 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 307 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans