Skip to main content

Notifications

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

Trouble with Lists

Posted on by 22

So Im working on a Table which I created. It displays the users' vacation hours (custom fields I put in the resource groups). I've made a repeater to show all the resource users I have and give the ability to add value to increase each user's vacation hours. (See pic below)

pastedimage1682359079002v1.png

The No., Name, and Vacation balance are pulled from the resource record, and Add/Subtract Vacation Balance is a new field.


When I enter the values for each user and submit, the final value I entered gets updated for each of the users

pastedimage1682363905789v1.png

I'd like it to separate each line and update all of the values on submit, but I'm having difficulty progressing. Any help would be great.
Do I need to create a temporary table or something to make this work?

  • bcaron1000 Profile Picture
    bcaron1000 22 on at
    RE: Trouble with Lists

    I had some code on the page  for processing,

    area(Processing)

           {

               action("Submit Changes")

               {

                   ApplicationArea = All;

                   trigger OnAction();

                   begin

                       //add confirmation yes no

                       currentUser := Database.UserId;

                       todaysDate :=   System.CurrentDateTime();

                       repeat

                           leaveChanges.changeID := 0;

                           leaveChanges.changedBy:= currentUser;

                           leaveChanges.changedResource:=Rec."No.";

                           leaveChanges."Date Changed":= todaysDate;

                           leaveChanges."OldVacationHours":=Rec.myVacation;

                           // leaveChanges."OldSickHours":=oldSickHours;

                           leaveChanges."Changed Vacation Amount":= addVacation;

                           // leaveChanges."Changed Sick Amount":= addSickHours;

                           leaveChanges."NewVacationHours" := totalVacation;

                           // leaveChanges."NewSickHours" := newSickHours;

                           leaveChanges.Insert(true);

                           Rec.myVacation := totalVacation;

                           Rec.MODIFY(TRUE);

                       until Rec.Next() = 0;

                   end;

               }

           }

    Im guessing as the value is only one value that is my issue

  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 73,411 Super User 2024 Season 2 on at
    RE: Trouble with Lists

    Hi, If this is a List page, this should not be happening. You can refer to the standard Payment Terms or Payment Methods page.
    Is there some code in the trigger of the field, table, or page?

    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,104 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans