@Deano12 if I may, could I suggest a different way that your App could flow which may make things easier?
Assuming that the 'Type of Entry' is only 2 options why not lock this down like this:
For New Entries
- Set the DisplayMode of the 'Type of Entry' datacard to either View or Disabled so it can't be changed.
note: you may need to change the dropdown back to a label, just playing around to get it to work
- Set the default property of the datacard If( varTypeOfEntry = "New", "New Entry", "Amendment")
- On the Submit New Entry button add the code: Set(varTypeOfEntry, "New")
This should sort New Entries
For Amendment entries:
- I assume this it the current flow: Historical Entries --> Previous Entries --> DOB Entry --> END?
- If so, on your DOB Entry screen, add a button called "Amendment to Previous" [or something that makes sense for your project]
- in the OnSelect of this button add the code:
Set(varTypeOfEntry, "Amendment"); Set(varPreviousID, Gallery.Selected.ID); Navigate('Dob Data Entry',ScreenTransition.Cover)
- set the default value of 'Amending Previous Entry Number' to: If(varTypeOfEntry = "Amendment", varPreviousID, Blank() )
- Set the DisplayMode of the 'Amending Previous Entry Number' datacard to either View or Disabled so it can't be changed.
So what all the above will do is
- if a New Entry is required, 'New Entry' will be set (no need for dropdown selection) in the 'Type of Entry' field. The rest of the process stays the same.
- is an Amendment Entry is required, 'Amendment' will be set (no need for dropdown selection) in the 'Type of Entry' field and the previous related ID will be set (no need to enter it) in the 'Amending Previous Entry Number' field. The rest of the process stays the same.
Let me know if I'm on the right track. If there are more than 2 options (ie New Entry & Amendment) then you can always extend your If() statements to fits.
Hope this helps!