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 :
Small and medium business | Business Central, N...
Answered

Get name in other Table with CODE

(0) ShareShare
ReportReport
Posted on by 65

Hi .

I have a  custom report , in this report i need the name of SalesPerson but in the fields  only have SalesPersonCode .( Sales Invoice )

How can I get in a field the name of the SalesPerson the table is ( SALESPEOPLE/PURCHASERS ).

HelpMe Please.

Thanks

I have the same question (0)
  • Suggested answer
    divyeshchitte Profile Picture
    968 on at

    You Need to add

    Variable

    SalesPurchPerson Record Salesperson/Purchaser

    Code on

    Sales Header - OnAfterGetRecord()

    IF "Salesperson Code" = '' THEN BEGIN

     SalesPurchPerson.GET("Salesperson Code");

    Add SalesPurchPerson.Name in the dataset

    Refer Report 205 Order Confirmation for details

  • Armando Northware  Profile Picture
    65 on at

    But this variable is in report extension or where ? do you have a complete example ?

  • Suggested answer
    Suresh Kulla Profile Picture
    50,243 Super User 2025 Season 2 on at

    Did you create the dataset for the custom report? if so, then you need to add the Divyesh mentioned code in your dataitem trigger.  if not what do you mean by the custom report?

  • Armando Northware  Profile Picture
    65 on at

    Yes , i have a custom report .

    Im add  trigger for the dataitem("Sales Invoice Header"; "Sales Invoice Header") ?

  • Armando Northware  Profile Picture
    65 on at

    trigger OnAfterGetRecord()

               var

                   SalesPurchPerson: Record "Salesperson/Purchaser";

               begin

                   SalesPurchPerson.Get("Salesperson Code")

               end;

    How to set SalesPurchPerson.Name to DataItem Column ?

  • Verified answer
    Suresh Kulla Profile Picture
    50,243 Super User 2025 Season 2 on at

    Add this as a column

    column(SalesPurchPersonName; SalesPurchPerson.Name)

    {

    }

  • Armando Northware  Profile Picture
    65 on at

    its ready.

    Thanks

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 > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,229

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,867 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,153 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans