By Terry Bottorff - 8/15/2010
I have a BrowseDialog on a maintenance form and that all works well. When I return from the BD I am able to edit the chosen record and save the results. All is good, but, how do I get all the records back in the BO after I save the changes so I can continue to edit? I'm sure it is simple but I just don't seem to be able to get it to work. TIA.
|
By Edhy Rijo - 8/15/2010
Hi Terry,
I don't quite understand your question, but let's try to explain some basics.
A BD uses an internal BO to show you the records found and will populate whatever BO you assign in the BusinessObjectToPopulate, so when you do a search and whatever records are returned, based on the ReturnSelectedRecordOnly property, the BusinessObjectToPopulate BO will be filled with those records when you click the OK button.
Now, when the BD is closed, you have total control of the current record. When you modify it and save it, you don't have to do anything else to see the changes since the latest one will be showing after the save.
So when you say:
...how do I get all the records back in the BO after I save the changes so I can continue to edit?
To what BO are you referring to?
|
By Terry Bottorff - 8/15/2010
I am using a single BO and when I use the BD and select a record to edit - I return to the Maintenance form - change some data and save the record. I only have one record that will match the BD search criteria. That works.
Now after I save the new data since I am using a single BO only the selected record appears in the maintenance form.
A BD uses an internal BO to show you the records found and will populate whatever BO you assign in the BusinessObjectToPopulate, so when you do a search and whatever records are returned, based on the ReturnSelectedRecordOnly property, the BusinessObjectToPopulate BO will be filled with those records when you click the OK button.
So I guess I will use 2 copies of my BO so my original BO retains all the records? But can I use just one maintenance form to show all records in BO and then edit the selected record-save and then return to All Records to continue editing?
|
By Edhy Rijo - 8/15/2010
But can I use just one maintenance form to show all records in BO and then edit the selected record-save and then return to All Records to continue editing?
Terry, you don't need 2 BOs, by setting the ReturnSelectedRecordOnly property of the BD to False, all records in the BD's BO will be copied to your BusinessObjectToPopulate BO, so if you are using a SF Maintenance Form with navigation toolbar, you can simply navigate trough all the records without having to use the BD again.
There are many ways you can show the data to the user, I am assuming that you do not want to display all records in a listview or grid, but simply use the BD, get a bunch of records in the PrimaryBO and edit the current one, then save, go to the next and do the same, right?
|
By Terry Bottorff - 8/16/2010
ReturnSelectedRecordOnly is set to false. If I go back to the BD and Click the Clear button and then do a Search I get all of the records showing up in the maintenance form. I just wanted that to happen after I did a Save.
|
By Ivan George Borges - 8/16/2010
Terry, as Edhy told you, they will all be still there. There is no need to go back and do another search. First time you came back from the BD, your BO was populated with all the results, even if you edit the current row you see on your form, after you save you can navigate to any of the others that came from your search, they are there already. Try the Nvaigation buttons on the Toolstrip and you will see it.
|
By Terry Bottorff - 8/16/2010
Yes I know that. Let's say I have 100 records in the BO at the beginning. I use the BD and I get 3 records back. That is what I want and I edit 1, 2 or 3 of them and save my edits. Now I want to go back to the 100 records so I can get another set to edit. Does that make sense?
Sorry for the confusion.
|
By Ivan George Borges - 8/16/2010
Oh, I kind of got it now what you meant. I think you have the feeling that you need your BO populated with all records first, and then when you go to the BrowseDialog and enter a Search Criteria, the BD will then perform the search on your populated BO, is that the case? If it is, then no, this is not what it happens. The BrowseDialog will always go to the server and do the search on the underlying table. It doesn't care about what you have in your BO at the time it does its search, and by the time you give it the OK after found your records, it will populate your original BO with all records found only. So, on your example, after you edited and saved the 3 records you had found first, justo go back to the BrowseDialog and enter your new search criteria. You will be sent back to the BO with the new records found and then you can again do whatever with them and save them. Sounds like what you were looking for?
|
By Terry Bottorff - 8/16/2010
OK I understand and it makes sense. I thought it was working on the BO and not going to the server. That is Cool, that will work for me. My understanding was what was causing me the problem. Thanks to both of you......
|
By Ivan George Borges - 8/16/2010
You are most welcome, Terry.
|
By Edhy Rijo - 8/16/2010
Terry Bottorff (08/16/2010) OK I understand and it makes sense. I thought it was working on the BO and not going to the server. That is Cool, that will work for me. My understanding was what was causing me the problem. Thanks to both of you......
Hi Terry,
Glad you got it working. Yes StrataFrame is very powerful and flexible, the more you get to know it, the more you will figure out what you can do with it, not only the BO, but almost every part of the framework surprise me when I need to do something complicate or advance and then figure out the way it is handle by the framework and most of the time, it is pretty simple.
|
|