Hi there,
I'm a real newbie in PowerApps and try to do my first steps^^.
Context:
With a button on a form, I create a new record which I pre-fill with some information with the patch function (see below).
After the creation of the record (which is functional), I'd like to change the edit form to go to the newly created record, switch the gallery to this record too and put the edit form in edit mode, for the user to complete the last details.
The following code is in the OnSelect property of the button:
ResetForm(FrmActivBody);
Patch(
tblSupportActivities,
Defaults(tblSupportActivities),
{
Scope_of_Support: "New Activity Title",
Status: {Value: "G"},
Trend: {Value: "Stable"},
Start_Support: Today(),
Planned_End: Today() + 90,
Support_Provider: {
Claims:"i:0#.f|membership|" & User().Email,
Department: "",
DisplayName:"",
Email:"",
JobTitle: "",
Picture: ""
},
ProjectRef: {
Id: LookUp(
tblProjects,
prjID = GalProjects.Selected.prjID,
prjID
),
Value: "Text"
}
}
);
//Switch Gallery and edit form to the created record
Set(
varGalActivDefault,
FrmActivBody.LastSubmit
);
//Put the edit form in edit mode
EditForm(FrmActivBody);
Problem description:
As written above, the record gets created but then nothing happens. The gallery is not changing to the created record. Since this is not happening, the edit form (FrmActivBody) is put in edit mode - but on the current record (not on the new one).
I suppose it's not working since I'm not creating the record via the edit form (not submitted via FrmActivBody but created via patch function).
Does anyone know what I could change that this is working?