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

How to get/Set record when two page does not have direct relation in business central.

(1) ShareShare
ReportReport
Posted on by 329
Hi guys,
I have one page . i.e. Call Distribution, & on that page there is one action button i.e. CustomerTrends.
We can click on this action ,then it will open the customer Trends page ,& if we can close this page ,then new sales order will be created.->this is customization already done.
 
My query is : On call Distribution page there is an Call No field. & on sales order page there is call ID field.
So if I click on this CustomerTrends action ,& then page will be open & then I close the page ,so new Sales order will be created ,so on that time, this call no is updated on new created sales order call ID field.
 
This two page does not have the direct relation.

 
Is any way to do this.
  • Suggested answer
    YUN ZHU Profile Picture
    103,127 Super User 2026 Season 2 on at
    Hi, sorry I may not fully understand your question.
    Customer Trends should also include the Call No., right? If not, please pass it in when you click Customer Trends in Call Distribution. This way you should be able to get the Call No. when creating a Sales Order.
     
    And if there is no directly related table, the value can also be found through an intermediate table.
    For example, in your example, you can query the value in the order of Sales Order -> Customer Trends -> Call Distribution.
     
    Hope this can give you some hints.
    Thanks.
    ZHU
  • Test user Profile Picture
    329 on at
    Hi Yunzhu,

    Customer Trends should not include the Call No.
     
    And if there is no directly related table, the value can also be found through an intermediate table.
    For example, in your example, you can query the value in the order of Sales Order -> Customer Trends -> Call Distribution.
     
    sorry i couldn't understand.c an you describe in brief above highlighted line?
  • Suggested answer
    YUN ZHU Profile Picture
    103,127 Super User 2026 Season 2 on at
    I'm sorry I didn't explain it clearly. What I mean is that if Sales Order is related to Customer Trends, and Customer Trends is related to Call Distribution, by querying twice in the code, you can find Call Distribution through Sales Order.
    But I don't know the details of your design. If there is no correlation in these three tables, you should consider modifying the solution.
     
     
    Hope this helps.
    Thanks.
    ZHU
  • Test user Profile Picture
    329 on at
    Hi Yunzhu,
     by querying twice in the code, you can find Call Distribution through Sales Order.
    How to query this?
     
  • Suggested answer
    YUN ZHU Profile Picture
    103,127 Super User 2026 Season 2 on at
    For example, find the name of the Vendor No. set on the Item No. from Sales Header (Take the first line of Sales Lines whose Type is Item)
     
    Hope this helps.
    Thanks.
    ZHU
  • Test user Profile Picture
    329 on at
    Hi Yunzhu,
    Customer Trends should also include the Call No., right? If not, please pass it in when you click Customer Trends in Call Distribution. This way you should be able to get the Call No. when creating a Sales Order
     
    I have pass it on customerTrends ,But if I have 2 same customer in call distribution entries ,so on that case it will take the first call no only.
    how to avoid this.
    I am writing this code.
  • Suggested answer
    YUN ZHU Profile Picture
    103,127 Super User 2026 Season 2 on at
    Sorry, I didn't understand your code here. You queried all the records of Rec_CallT and then modified them in the loop.
    But the record you modified is Rec (Rec.Validate), and the value of Rec_CallT has not changed. . . .I recommend you contact your development partner to discuss the details.
     
    Thanks.
    ZHU

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 July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 674 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 362 Super User 2026 Season 2

#3
AndrewThomas81 Profile Picture

AndrewThomas81 359 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans