Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

Flowing field from different table

Posted on by 100

Hi,

I want to flow a field from Table1 to Table2 based on few conditions and display it in a list page which is based on Table2. 

I wanted to create the field has a flowfield but the 'conditions' for the field fetches more than 1 record. I suppose, we cannot just show the first record field value from the filter conditions using a flowfield? 

Should i rather create field has a variable in page and populate it onopen/onaftergetrecord of the page? 

or create physical field in the table and populate it onopen/onaftergetrecord, which is the best approach for this?

Thanks

Johnson Patrick

 

Categories:
  • Johnson_Patrick Profile Picture
    Johnson_Patrick 100 on at
    RE: Flowing field from different table

    but why though? when i have flowfield defined on the table.

  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,091 Super User 2024 Season 1 on at
    RE: Flowing field from different table

    You can use Calcfield on OnAfterGetRecord trigger of that page.

  • Johnson_Patrick Profile Picture
    Johnson_Patrick 100 on at
    RE: Flowing field from different table

    Hi,

    Thanks for your reply. The two mentioned approaches doesnt work for me, as i need the value to the physically stored in the table and trying to fetch all the values onpageopen was causing me too much delay in opening the page.

    I followed the flowfield Lookup method and even though the conditions on the FF fetched multiple records, it always displayed the field of interest on the first record.

    See below my code for the FF :

    pastedimage1684143090952v1.png

  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,091 Super User 2024 Season 1 on at
    RE: Flowing field from different table

    Hi,

    If the conditions for the field in Table2 fetch more than one record from Table1, creating a flowfield might not be suitable. Here are two alternative approaches you can consider:

    Create a field as a variable in the page: You can create a variable in the page and populate it with the desired value during the OnOpen or OnAfterGetRecord trigger of the page. This approach allows you to control the logic and fetch the specific value based on your conditions.

    Create a physical field in Table2: Another option is to create a physical field in Table2 and populate it during the OnOpen or OnAfterGetRecord trigger of the page. This approach stores the calculated value in the table itself, allowing you to reuse it without recalculating each time.

    The choice between these two approaches depends on factors such as the complexity of the logic, the need for data persistence, and performance considerations. Evaluate your specific requirements and determine which approach suits your scenario better.

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,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans