I have 2 data sources (Sharepoint Lists) List1 and List2 andI created an app that deals with these 2 lists.
These 2 lists have exactly the same columns.
In the first Screen of the app I have 2 buttons so that I can select List1 or List2 as data source for the rest of my screens. Basically the buttons are simply setting up a global variable with Set(BaseDades, List1) or Set(Database, List2) with the 2nd button.
On the other screens and forms I use Database instead of List1 or List2 as source/Items...
Everything works great, so all forms take the records from the list I pick in the Wellcome screen and so far so good.
The only thing I can't figure out how to solve is the delete record icon on the DetailsScreen, the one that does:
Remove(BaseDades, BrowseGallery1.Selected); If (IsEmpty(Errors(BaseDades, BrowseGallery1.Selected)), Back())
I get the error: "The 1st argument of 'Remove' should be a collection".
I tried avoiding the use of BaseDades (the variable pointing to the chosen list) and using an if and pointing to list1 or 2, but it doesn't work either. In this case the error is: "The collection does not accept items of this type"
How can I manage to delete the selected record, so that my Trashcan icon works?
thanks
I found the problem. I forgot to change
DetailForm1.DataSource= If(Tipus="C1", List1, List2)
With this small change I can now select the List I'm going to work with though a button on the WellcomScreen.
Awesome! I have 2 apps in 1.
I tried changing my approach and instead of using a global variable pointing to the DataSource, I used an if to point to the chosen DataSource:
BrowseGallery1.Items = If(Tipus="C1", List1, List2)
BrowseGallery1 shows perfectly the records from the chosen list, but then when I select one and go to the DetailScreen no data is displayed when I do:
DetailForm1.Item= BrowseGallery1.Selected
I have the error: "Invalid formula. Expected value compatible with Datasource"
WarrenBelz
146,745
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,091
Most Valuable Professional