Re: Create a Button to Add User Information

So all of this works really well and I don't want to be a stickler, but here I go. I still find myself having to use the refresh button before anything will change immidiately. I don't know if there really is a way around it or not, however the button works both ways and so does the "Available?" field.

Re: Create a Button to Add User Information

Well it sounds like some progress at least. Now let's nail down the last part.What are you seeing that's not updating, your browse gallery, or the data?

_____________________________________________________________________________________Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

Re: Create a Button to Add User Information

So one of the things that I was kind of leaning toward before was...why even have an EditForm? There is nothing there to edit for the person checking out or in the book.

I was thinking more in terms of just having a screen with the Title and Author on it and a "Check out" or "Return" button (depending on the status). Which actually leads us back to either a Patch statement (because we have no need for a Form) or having the EditForm fields be read-only.

Also, was considering, would you be wanting some logic for the Return/Check-in? Seems you would want to check that the current user is the one that checked it out and only allow them to check it back in. For all others there would not be any option to do anything.

Just kind of thinking through your scenario, but not sure that it actually would be what you want.

As for the refresh button...no...you don't want that, nor would you need it - people will be confused. This is all quite possible to do without it.

_____________________________________________________________________________________Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

Re: Create a Button to Add User Information

Yes, I agree there's no real point to an edit form screen while having those buttons. The only thing I wonder is will the patch formula update the screen quick enough? And yes some logic to check the user would be wonderful.

Re: Create a Button to Add User Information

Yes, if you are patching/updating a datasource, this is immediate as, behind the scenes, it is updating the local "collection" which is the datasource and then making the round-trip to the actual data source for the real update. The only "delay" would be experienced between multiple users on multiple devices. A single user on a single device should always see immediate change.

So based on some of this, I'd say that something like this would be better for your situation:

Your Screen:

Label 1 - Let's call it lblTitle

Text property set to : BrowseGallery1.Selected.Title

Label 2 - Let's call it lblAuthor

Text property set to : BrowseGallery1.Selected.Author (assuming that's the column name for this)

Label 3 - Let's call it lblCheckedOutTo

Text property set to : BrowseGallery1.Selected.'Checked Out By'

Visible property set to : !(IsBlank(BrowseGallery1.Selected.'Checked Out By'))

Patch(IPC_LIB, BrowseGallery1.Selected, { 'Checked Out By': If(IsBlank(BrowseGallery1.Selected.'Checked Out By'), User().FullName, "") } );Back() // If you want to then return to the calling screen

This will give you three static labels with the Title and Author and the person it is checked out to. The Check out to label will only be visible if it is actually checked out.

The button will only be visible if the book is not checked out to anyone (and will say "Check out") OR if the book is checked out to the current user (and it will say "Return").

When the button is clicked, it will patch the record from the BrowseGallery1. If the book is checked out, it will "blank" the column, if it is not checked out, it will fill in the current user. Remember, this button is only visible given the above conditions, so we don't have to do any further checking in this formula.

See if that concept and scenario works for you.

_____________________________________________________________________________________Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

Re: Create a Button to Add User Information

I apologize for this ignorant question, but should I be using these formulas on my browse screen or details screen? I tried setting them for my browse screen, but then no data appeared. I'll promptly try this on my details screen.

Re: Create a Button to Add User Information

I would just create a new screen for it. There is no need for any other controls on it (except maybe some navigation header controls)

_____________________________________________________________________________________Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.