Experts,
I have got Collection named as DailyinventoryL and Dataverse table named as Dailyinventory . Following button click is to send the data from collection to table.
Set(Varlastno1 ,
First(
FirstN(Sort(DailyinventoryL,sno, Descending),
1
)
).sno);
ForAll(
DailyinventoryL,
Patch(
Dailyinventory,
Defaults(Dailyinventory),
{
crf99_materialno: Materialno,
crf99_materialdesc: Materialdesc,
crf99_plant: plant,
crf99_qty: Qty,
crf99_bbd: BBD
}
)
);
Set(
varNotifytest9,
"Transmit Completed"
);
Set(Varlastno1 ,
First(
FirstN(Sort(DailyinventoryL,sno, Descending),
1
)
).sno);
------
Issue here is that duplicated data is transmitted to table whenever clicking the button
Requirement here is that button should trigger error message if that is duplicated is passed.
Tried with workaround like bringing the last row of the collection records as variables.
Var created.
Set(Varlastno1 ,
First(
FirstN(Sort(DailyinventoryL,sno, Descending),
1
)
).sno);
Var is passed to one label. So whenever button is clicked then last row number will appear in the label12.
Now how to send the collections to table which is after the lastrow number which is appearing in label12. Not sure this is correct way.
Hi, you will want to look at the datasource for the last submitted item rather than the collection:
Refresh(Dailyinventory);
Set(Varlastno1,
First(
Sort( Dailyinventory, sno, Descending)
).sno
);
This way it will never use a Varlastno1 that is already in use, as it checks the datasource for the most recent number
@iAm_ManCat |
Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you! |
Thanks! |
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
User | Count |
---|---|
200 | |
100 | |
62 | |
59 | |
58 |
User | Count |
---|---|
254 | |
164 | |
90 | |
79 | |
70 |