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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

how to call querybuildrange varaiable in a formdatasource extension

(1) ShareShare
ReportReport
Posted on by 217
Hi,
 
A querybuildrange variable is declared in form Class Declaration, initialized in FormDataSource\init method and assigned value in FormDatasource\linkActive method.
 
I am extending linkactive method as I have to assign some other value to querybuildrange variable.
 
How to call querybuildrange variable in Formdatasource extension class.
 
Lakshmi
Categories:
  • Suggested answer
    Layan Jwei Profile Picture
    8,348 Super User 2026 Season 2 on at
    Hi,
     
    If it's declared in class declaration, then you can access it using "element" keyword
    element.VariableName
     
    Thanks,
    Layan Jweihan
    Please mark this answer as "Verified" if it solved your issue. In order to help others who will face a similar issue in the future
  • Suggested answer
    Waed Ayyad Profile Picture
    9,222 Super User 2026 Season 2 on at
    Hi,
     
    You can't access Form variables through the extension classes of the form. If you have getter method in the standard form that return the variable you can call it otherwise you can't.  I think you can define new range for the same DataSource and add the range values that you want.

     For example, you can add like the following code:
    
    QueryBuildDataSource queryBuildDataSource = this.query().dataSourceTable(tableNum(TheTableName));
    QueryBuildRange qbr = QueryBuildDataSource.addRange(FieldNum(TableName,fieldName).value('');
    
    


    Thanks,
    Waed Ayyad
    If this helped, please mark it as "Verified" for others facing the same issue
     
  • Suggested answer
    Ognjen Lapcevic Profile Picture
    101 on at
    Hi,
     
    If you need to also clear previous ranges that are set, on top of what @Waed Ayyad wrote, you can do:
      QueryBuildDataSource qbds = this.query().dataSourceTable(tableNum(TheTableName));
      qbds.clearRanges();
     
  • Bharani Preetham Peraka Profile Picture
    3,634 Moderator on at
    You would require getter setter methods. Can you give us the complete requirement?
  • Waed Ayyad Profile Picture
    9,222 Super User 2026 Season 2 on at
    Hi,

    Is your issue resolved?  If yes, mark the answers that helped you as verified.

    Thanks
    Waed Ayyad

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

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

#1
Martin Dráb Profile Picture

Martin Dráb 507 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 419 Super User 2026 Season 2

#3
CU-1234529-002 Profile Picture

CU-1234529-002 155

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans