I have a model driven app with a embedded canvas app.
The canvas app has one gallery showing existing records in a table called (AFP Payment Schedules) based on a Job Number.
The second gallery I'm using with a collection to enable the user to input information and then I patch that into the AFP Payment Schedules table.
What I'm having a problem with is I'm trying to get last ID number (AFP Number) from the AFP Payment Schedules table, based on the Job Number and then increment ID by one. The second gallery should then be automatically listing the new line of info to be entered with the next AFP number after what already exists. The code I'm trying is below, but what I get returned each time is a zero.
The existing AFP number is 1 so I'm expecting my new line in gallery two to be a 2 as its incremented 1 by 1.
Thanks in advance for any help on this
David
That worked perfectly, thank you.
Hi @dgarrick ,
Please try this:
Set(
LastTotalAFP_ScheduleLines,
First(
Sort(
Filter(
'AFP Payment Schedules',
'Job Number' = [@ModelDrivenFormIntegration].Item.'Job Number'
),
'AFP Number',
SortOrder.Descending
)
).'AFP Number'
);
Set(TotalAFP_ScheduleLines, LastTotalAFP_ScheduleLines +1);
Best regards,
WarrenBelz
146,587
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,928
Most Valuable Professional