web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Customized Forms Openi...
Power Apps
Unanswered

Customized Forms Opening and Saving

(0) ShareShare
ReportReport
Posted on by 14

I have a couple customized forms that are acting erratic. 

 

Opening:

When I create a new form, at times the form creates in New mode other times Edit mode.  If I click new from the list and the form appears in Edit mode, click the 'X' and click new again and it usually creates in New mode.  When the form creates in New mode all the fields are blank as expected.  When it creates but shows Edit mode, the form is populated with data from the form in the first row of the list.  I use the following formula to show the mode:

If(
    frmWorkflow.Mode = FormMode.New, "New",
    frmWorkflow.Mode = FormMode.Edit, "Edit",
    frmWorkflow.Mode = FormMode.View, "View",
    "Unknown")

 

Here is the SharePointIntegration OnNew code:

NewForm(frmAuthApproval_1); Navigate(AuthApprovalNew, ScreenTransition.None); Set(varChanges, ""); Set(varStatus, "Draft")

 

Here is the SharePointIntegration OnEdit code:

EditForm(frmAuthApproval); Navigate(AuthorizationApproval, ScreenTransition.None); Set(varReset, false);
Set(varLogStatus, dcStatus.Default);
Set(varLogDTRequested, Title_DataCard.Default);

Set(varLogRequestor, dcRequestor.Default);
Set(varLogReqManager, dcReqManager.Default);
Set(varLogSysAccess, dcSystemAccess.Default);
Set(varLogSysAuthSpecialist, dcAuthorizationSpecialist.Default);
Set(varLogNewSOD, dcNewSOD.Default);
Set(varLogSODAuthority, dcSODAuthority.Default);
Set(varLogImplementer, dcImplementer.Default);
Set(varLogReqDesc, dcReqDesc.Default);
Set(varLogComments, dcComments.Default);
Set(varLogChangeLog, dcChangeLog.Default)

 

Here is the SharePointIntegration OnCancel code:

ResetForm(frmAuthApproval)

 

Also, I have buttons on the form that I want the user to click to execute specific code and then trigger the OnSave.  This code worked in the past but no longer works.

 

Here is the code for one of the buttons the user clicks, it shoud run the code then trigger the OnSave:

Set(varChanges, dcChangeLog.Default);
Set(varStatus, "Pending Mgr Approval");
Set(varChanges, User().FullName & " created SOX Authorization on " & Text(Now(), DateTimeFormat.ShortDate));
UpdateContext({varTickerTape: "Last Action: An email was sent to " & dcReqManager.Update & " requesting manager approval on " & Text(Now(), "[$-en-US]mm/dd/yyyy hh:mm AM/PM")});
UpdateContext({varMgrNotified: "Yes"});
SubmitForm(frmAuthApproval)

 

Here is the SharePointIntegration OnSave code:

If(
(!IsBlank(dcChangeLog.Default) And !IsBlank(dcChangeLog.Update)), Set(varLogChangeLog, dcChangeLog.Update),
!IsBlank(dcChangeLog.Update) , Set(varLogChangeLog, dcChangeLog.Update),
!IsBlank(dcChangeLog.Default) , Set(varLogChangeLog, dcChangeLog.Default)
);
If((dcStatus.Default = "Draft") And (lblMgrNotified.Text = "Yes"),
dcStatus.Update= "Pending Mgr Approval"
);
Set(varChanges, "");
If((Title_DataCard.Update <> varLogDTRequested) And !IsBlank(varLogDTRequested), Set(varChanges, varChanges & "Date Requested "));

If((dcRequestor.Update <> varLogRequestor) And !IsBlank(varLogRequestor), Set(varChanges, varChanges & "Requestor "));
If((dcReqManager.Update <> varLogReqManager) And !IsBlank(varLogReqManager), Set(varChanges, varChanges & "Requestor's Manager "));
If((dcSystemAccess.Update <> varLogSysAccess) And !IsBlank(varLogSysAccess), Set(varChanges, varChanges & "System Access "));
If((dcAuthorizationSpecialist.Update <> varLogSysAuthSpecialist) And !IsBlank(varLogSysAuthSpecialist), Set(varChanges, varChanges & "Authorization Specialist "));
If((dcNewSOD.Update <> varLogNewSOD) And !IsBlank(varLogNewSOD), Set(varChanges, varChanges & "New SOD "));
If((dcSODAuthority.Update <> varLogSODAuthority) And !IsBlank(varLogSODAuthority), Set(varChanges, varChanges & "SOD Authority "));
If((dcImplementer.Update <> varLogImplementer) And !IsBlank(varLogImplementer), Set(varChanges, varChanges & "Implementer "));
If((dcReqDesc.Update <> varLogReqDesc) And !IsBlank(varLogReqDesc), Set(varChanges, varChanges & "Request Description "));
If((dcComments.Update <> varLogComments) And !IsBlank(varLogComments), Set(varChanges, varChanges & "Comments "));
If(!IsBlank(varChanges), Set(varChanges, User().FullName & ", on " & Text(Now(), DateTimeFormat.ShortDateTime) & " changed " & varChanges));
If(!IsBlank(varChanges), Set(varChanges, varLogChangeLog & Char(10) & varChanges), Set(varChanges, varLogChangeLog));
SubmitForm(frmAuthApproval)

Categories:
I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard