Skip to main content

Notifications

Announcements

No record found.

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

Update 'parent' card field of PartList

Posted on by 20

I have a Customer card with an embedded ListPart page of events the customer attended. 

These events have several editable boolean fields. (Checkboxes on the ListPart page)

For one of these fields I have the total of where it is true displayed in the Customer card through an integer field with FieldClass = Flowfield and a Calcformula = Count = (....)

This works nicely, but when I check or uncheck one of the boxes on the ListPart page, the field on the customer card is not updated, when I close the card and open it up again, the field is updated.

Is this in any way possible to have this happen on the fly?

What I have already tried and doesn't work:
UpdatePropagation : this not a valid poperty on a page with Pagetype = Card;

force a CalcField with the Onvalidate triiger as follows:

trigger OnValidate()
  var
    customer: Record Customer;
  begin
    customer.get(Rec.CustomerId);
    customer.CalcFields(BoolFieldName);
    // With or without the
    CurrPage.Update();
  end;
I tried putting this both in the table of the ListPart, as the ListPart Page itself.

Thanks in advance.

  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: Update 'parent' card field of PartList

    Sorry,  I didn't realize you are using Web Client on NAV 2018.  Yes, solution will not work on the web client.

  • Filip Cremers Profile Picture
    Filip Cremers 20 on at
    RE: Update 'parent' card field of PartList

    @Lars Lohndorf-Larsen

    I was afraid of that :(

    Still thank you for your answer.

  • Filip Cremers Profile Picture
    Filip Cremers 20 on at
    RE: Update 'parent' card field of PartList

    @Suresh Kulla 

    Thank you for your suggestion, but I think this doesn't work in the Web Client.

    When I tried this code I got the error 'Automation' is not recognized as a valid type.

  • RE: Update 'parent' card field of PartList

    Hi,

    To my knowledge this is not possible, sorry. Except for making some kind of timer on the header that refreshes every x seconds. But I will look forward to seeing if anyone else has ideas for this.

  • Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: Update 'parent' card field of PartList

    PROCEDURE UpdateParentPage@1240060002();
        VAR
          WshShell@1240060000 : Automation "{F935DC20-1CF0-11D0-ADB9-00C04FD58A0B} 1.0:{72C24DD5-D70A-438B-8A42-98424B88AFB8}:'Windows Script Host Object Model'.WshShell";
        BEGIN
          
          IF ISCLEAR(WshShell) THEN
            CREATE(WshShell,TRUE,TRUE);
          WshShell.SendKeys('{F5}');
          WshShell.SendKeys('{F5}');
          
        END;

    If UpdatePropagation is not working then try using the shell script like above

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

Featured topics

Product updates

Dynamics 365 release plans