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...
Suggested Answer

Please help explain RecordRef and Variant

(0) ShareShare
ReportReport
Posted on by 50

Hi,

I'm new to BC tech in this part and i have difficulties to understand about using RecordRef and Variant to pass between functions.

I'm using BC 17 onprem currently.

First, about the RecordRef:

1. I want to know which table RecordRef contain at the time. Is it only using recordref.number to get the object number of the record or is there another way to do it ?

2. If i'm using number to get the record number, is there a way to get the record name ?

Second, about the Variant: I have variant with "Item" type. Questions are:

1. Is there a way to know which variant record name ?

2. Is there a way to convert/copy variant including their filters, marks to specific record ?

Thank you.

I have the same question (0)
  • Suggested answer
    Bilal Haider Profile Picture
    414 on at

    Hi,

    RecordRef:

    1. Yes you can use RecRef.Number to get the ID of the record that RecRef contains.

    2. You can use RecRef.Caption to get name of record.

    Variant:

    1. Yes, you can get it as

         MESSAGE(FORMAT(MyVariant));

    2. You can COPY Variant and its filters as:

         myRec2.COPY(myVariant) but the myRec2 and variant should be of same record sub-type that you assign variant to.

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 2,785

#2
Jainam M. Kothari Profile Picture

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

#3
YUN ZHU Profile Picture

YUN ZHU 948 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans