@RandyHayes
Could I ask for a bit more help? I'm getting this weird bug - I open the app and press an 'arrival' button which runs this code:
Patch(Employees_dump; Defaults(Employees_dump); {Title: ThisItem.Title; PracovnikJmeno: User().FullName; Zacatek: Now(); LatitudStart:Location.Latitude;LongitudStart:Location.Longitude});; UpdateContext({Popup1:true; Popup2: false; prichodFirst:false});;That sucessfuly creates a record, I checked in Sharepoint. Then I press 'leave' button which runs this code:
Set(record;Last(
Filter(Employees_dump; PracovnikJmeno = User().FullName && Title = ThisItem.Title)));;
If(
IsBlank(
record.LongitudEnd) && !IsBlank(record.Zacatek) && IsToday(record.Zacatek);
Patch(Employees_dump; record; {Konec: Now(); LatitudEnd:Location.Latitude;LongitudEnd:Location.Longitude} );;
UpdateContext({prichodFirst:false; Popup2:true}) ; // zaznam existuje a ma prazdne pole pro odchod (LatitudEnd, LongitudEnd, Konec)
UpdateContext({prichodFirst:true; Popup2:false})) // zaznam nema prazdne pole pro odchodbut after pressing the 'arrival' button just once the if statement returns false. Only after pressing the 'arrival' button for the second time or reopening the app the if statement returns true and runs the patch function. I have no idea what's causing the issue.
Edit: we've tried on another phone and can't reproduce the issue