I have two forms: form1 and form2.
I want to complete fields on form1 and have three of those fields auto-populate on form2. I have the auto populate working for the three fields. However, after the user hits submit on Form1 and navigates to Form2 I need to reset Form1 back to new mode. But when I do that it clears/erases all of the auto populated fields on Form2.
Currently using this formula in the default data cards for the fields on Form2 that need to be autopopulated. I have 3 instances with different field names but the format is the same.
If(!IsBlank(form1.LastSubmit.FactNumber),form1.LastSubmit.FactNumber,ThisItem.'PR Number')
On Success for Form1 currently has nothing but needs to reset the form but keep the last submitted data for the 3 fields on Form2
Okay in Form2 I changed default mode to edit. I also added the following to the items:
Patch(Defaults(BEFactTable),{'PRNumber': varGlbRecord.factnumber}) and I receive the following error "Invalid formula expected a value compatible with data source"
FYI just in case it's helpful factnumber is the columns value I am trying to retain from Form1
I have two tables in the dataverse
BEFact used for Form2
GeneralV used for Form1
That is correct. The NewForm will just put the form back into new record mode.
Just to clarify for on success "NewForm(yourFormName)" is to reset form1 correct so the formula would be NewForm(Form1)?
Put your Default properties back to the default properties. Otherwise you will be breaking the Unsaved property function on the form.
On Form1 in the OnSuccess action formula, but the following:
Set(glbRecord, Self.LastSubmit);
NewForm(yourFormName)
Then for your other forms, if you are creating new records from them, then set the default mode to Edit and DO NOT issue a NewForm on those forms, only EditForm if needed.
And, set the Item property of those forms to:
Patch(Defaults(yourDataSource), {columnYouWant1: glbRecord.columnYouWant1, columnYouWant2: glbRecord.columnYouWant2, ...etc...})
This will provide the functionality you are looking for.
I hope this is helpful for you.
WarrenBelz
146,524
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,906
Most Valuable Professional