Hi @dylandavis09 , I will try to give you simple logic which can serve the purpose. This code you need to have on submit button:
If(Or(CountRows(colRegistrationClasses) > 5, CountRows(colRegistrationClasses) < 5),
Notify("Make sure to select 5 course only!", NotificationType.Warning),
And(CountRows(colRegistrationClasses) = 5,Label1_100.Text ="NOT SUBMIITED"),
----Patch Code----
)
With this you do not require any code on display mode of any button. Buttons display mode will always be edit.
If user has selected more then 5 courses or less then 5 courses, then there will be warning message shown to user and if they have selected 5 courses and label is NOT SUBMITTED, then code will patch details to SP list.
-----------------------------------------------------------------------------------------------------------------------------
I hope this helps.
Please click Accept as solution ✅ if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs up.👍
Thanks,
ANB