Skip to main content

Notifications

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.

Posted on by 203
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.
Categories:
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 73,472 Super User 2024 Season 2 on at
    How to get/Set record when two page does not have direct relation in business central.
    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
  • Nil@@m Profile Picture
    Nil@@m 203 on at
    How to get/Set record when two page does not have direct relation in business central.
    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
    YUN ZHU 73,472 Super User 2024 Season 2 on at
    How to get/Set record when two page does not have direct relation in business central.
    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
  • Nil@@m Profile Picture
    Nil@@m 203 on at
    How to get/Set record when two page does not have direct relation in business central.
    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
    YUN ZHU 73,472 Super User 2024 Season 2 on at
    How to get/Set record when two page does not have direct relation in business central.
    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
  • Nil@@m Profile Picture
    Nil@@m 203 on at
    How to get/Set record when two page does not have direct relation in business central.
    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
    YUN ZHU 73,472 Super User 2024 Season 2 on at
    How to get/Set record when two page does not have direct relation in business central.
    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

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans