Take fields from default table to custom


I'm working for a project and I need to take field "Sales Account" on General Posting Setup and put it on custom table to field "Id Account".

The advice of project manager is:

THE ACCOUNT is enhanced by crossing between Item and Customer items; fields (Information) that we find in both in the shipment header and in the invoice header.

ITEM table: take field Gen. Prod. Posting Group)

Customer table: I take the Gen. Bus field. Posting Group

The intersection of these two fields must then be identified in the account setup table - GENERAL POSTING SETUP

I retrieve this link using the fields:

Each pair is linked to a sales account (Sales_account) -> So Sales_Account = ID_ACCOUNT

How can do this?

Thanks so much and sorry for bad english

  • May I start by asking you you one question. Have you any idea why you are doing this and what the purpose of it is?

    Because I don't based on the description you have provided. When should this "crossing" and what else would be in the "custom table".

    But I assume you would need to update it when you post the sales invoice. Since you need the "Sales Account" then I assume you would insert this for each invoice line?
    In that case you should create an event subscriber to the event triggered right after posting the invoice lines. At least if you are using extensions or version 11+.