Thank you, another problem i am facing is that the booking time I want that registeres a users check in and check out time, needs to ble cleared, when the booking time/date is expired.
Check the picture below. For now the check in time and check out stays there, so that users can see its future or live check in/bookings. But when the date is expired, i want it to be removed from that gallery where it says "Mine bookinger". Any ideas..?
My code :
Under Items on the gallery:
SortByColumns(Filter(Treningsapp;Title = glbUser.FullName);"SjekkInnTid";SortOrder.Ascending)
Onselect on Sjekk inn button:
If(mytext = "Sjekk inn"; UpdateContext({mytext: "Sjekk inn"}); UpdateContext({mytext: Text(Now(); "hh:mm")})) ;;
ClearCollect(
colEnableButton;
{
SjekkInnTid : Now();
Bruker :If(Anonym.Value=true;"Anonym"; glbUser.FullName)
}
);;
Set(sjekkInnRecord;
Patch(Treningsapp;Defaults(Treningsapp);
{
Title:If(Anonym.Value=true;"Anonym";glbUser.FullName);
SjekkInnTid :Now()
//Bruker:If(Anonym.Value=true,"Anonym",glbUser.FullName)
}
)
);;
Reset(Anonym);;
UpdateContext({varSjekkinn: true})
Onselcet on Check out button:
If(mytext = "Sjekk ut"; UpdateContext({mytext: "Sjekk ut"}); UpdateContext({mytext: Text(Now(); "hh:mm")})) ;;
ClearCollect(
colEnableButton;
{
SjekkUtTid : Now();
Bruker :If(Anonym.Value=true;"Anonym"; glbUser.FullName)
}
);;
Refresh(Treningsapp);;
If(
!IsBlank(sjekkInnRecord);
Patch(Treningsapp;
sjekkInnRecord;
{
Title:If(Anonym.Value=true;"Anonym";glbUser.FullName);
SjekkUtTid:Now()
//Bruker:If(Checkbox1.Value=true,"Anonym",glbUser.FullName)
}
)
);;
Reset(Anonym);;
UpdateContext({varSjekkinn: false})
And under gallery i have set up two labels.
1. Under "Text" on label1 one its: ThisItem.SjekkInnTid
2. under "Text" on label two its: ThisItem.SjekkutTid
