@Rag23 wrote:
Hello,
I have a SharePoint list where some of the columns are filled in through a form on Screen1. On Screen2, I have a view form that displays the data of a specific item from a gallery which has been connected to the list. I have another form in Screen2 which is set to edit mode.
The edit form in Screen2 has a ‘colors’ drop-down list that gets the rest of the form to be automatically filled based on the selection of the drop-down list.
[Michael] Remove it or remove the code that is in the OnChange or OnSelect or whereever you have code (maybe the Item Property of the Gallery looks at this drop downs value, I dunno but remove it whereever it is)
I would like the edit form to be automatically filled based on the product selected in the gallery. Also, I want to make sure that when the edit form is submitted, the item picked from the gallery is only edited.
At the moment, when I choose an item from the gallery, the view form gets filled but the edit form doesn’t.
[Michael] Hi, there is no difference between filling a form from a Gallery, when the form is in View mode versus Edit mode. So you just have to set the DataSource to the same as the Gallery and them set the Item property to GalleryControlName.Selected
In addition, when I submit the edit form, a new item is created in the SharePoint list instead of editing the existing one.
[Michael] Can you verify you are in Edit mode, instead of New mode in the Form? The default is Edit but it depends if you changed it.
Also if you ever do NewForm(FormName) it will be in New Mode, so maybe you are doing that. If you want to reset an Edit form use ResetForm(FormName).
Also, for it to DO an edit, the data has to actually map to a row in the table. For instance, if you fill the Form with data, but when it goes to get submitted, it has no way to tell the actual record to update, it will always create a new one. Once you bind it to the Datasource of the Gallery and the .Selected, you should be fine.
My guess is, however you are filling it, it has no idea how to match it or you are doing NewForm on it
Note: I’m planning to add a filter to the gallery to only display items of a specific category based on the selection of another drop-down list which has been filled in the form in Screen1. I thought about getting the edit form to be filled automatically by making the selection from ‘colors’ drop-down list to be automatically made based on the each filter type.
[Michael] Please no. Use the Gallery.Selected so that its properly initialized and pointing to the correct record.
Could this be achieved?
As I have answered everything, I am happy to still answer questions, but if you are good with these, can you please Mark it as Resolved (as the answer) and possibly a ThumbsUp, then feel free if you have additional questions after the above.