Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Suggested answer

how to call querybuildrange varaiable in a formdatasource extension

Posted on by 92
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:
  • Waed Ayyad Profile Picture
    Waed Ayyad 6,332 Super User 2024 Season 2 on at
    how to call querybuildrange varaiable in a formdatasource extension
    Hi,

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

    Thanks
    Waed Ayyad
  • Bharani Preetham Peraka Profile Picture
    Bharani Preetham Pe... 3,605 Super User 2024 Season 1 on at
    how to call querybuildrange varaiable in a formdatasource extension
    You would require getter setter methods. Can you give us the complete requirement?
  • Suggested answer
    Moussy Profile Picture
    Moussy 32 on at
    how to call querybuildrange varaiable in a formdatasource extension
    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();
     
  • Suggested answer
    Waed Ayyad Profile Picture
    Waed Ayyad 6,332 Super User 2024 Season 2 on at
    how to call querybuildrange varaiable in a formdatasource extension
    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
    Layan Jwei Profile Picture
    Layan Jwei 7,347 Super User 2024 Season 2 on at
    how to call querybuildrange varaiable in a formdatasource extension
    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

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans