Hi @futr_vision ,
To make sure the form validation is triggered and the submit button updates its state, you can force the form to revalidate itself after setting the item property.
1. Create a global variable:
Set(glbCopiedRecord, LookUp(SourceTable, ID = SelectedRecordID));
2. Set the form item property:
Item: glbCopiedRecord
3. Force revalidation:
Set(glbCopiedRecord, LookUp(SourceTable, ID = SelectedRecordID));
UpdateContext({varRevalidate: Now()});
4. Trigger validation
UpdateContext({varRevalidate: Now()});
5. Modify the Submit Button code:
If(
FRM_CampaignForm.Valid && !IsBlank(glbCopiedRecord),
DisplayMode.Edit,
DisplayMode.Disabled
)
6. Make sure all the fields are validated
ForAll(
ControlsOf(FRM_CampaignForm),
Reset(ThisItem)
);
------------------------------------------------------------------------------------------------------------------------------
If I answered your question, please accept my post as a solution and if you liked my response, please give it a thumbs up.
Thanks!