2) browseDialog1->BusinessObjectType: vwTbCadastroBO browseDialog1->BusinessObjectToPopulate: vwTbCadastroBO1
3) After executed the search: Procedure executed inside of the event of closing of the browseDialog1 control. private void browseDialog1_BrowseDialogClosed(EventArgs e) { if (vwTbCadastroBO1.Count == 0) return; int idCadastro = vwTbCadastroBO1.IdCadastro; tbCadastroBO1.FillByView(vwTbCadastroBO1); if (tbCadastroBO1.Count > 0) this.NavigateToPrimaryKey(idCadastro);
}
4) Method to populate the Primary Business Object (tbCadastroBO1) from the loaded view BO (vwTbCadastroBO1) in the browseDialog. public void FillByView(BDLicitecMasterViewBO.vwTbCadastroBO viewBO) { if (viewBO.Count == 0) return; viewBO.MoveFirst(); string where = string.Empty; do { where += viewBO.IdCadastro + ", "; } while (viewBO.MoveNext()); where = where.Trim(); where = where.Remove(where.Length - 1); this.FillDataTable("SELECT * FROM TbCadastro" + " WHERE IdCadastro IN ( " + where + " )");
5) Error: The navigation is executed successfully, however, the controls in the form is not refreshed. Rogério Mauri
Solved problem!
Step by step:
Considering that vwTbCadastroBO1 is an object constructed from a view, it does not have primary key. Then, in the "Business Object Mapper" I configured "Override Primary Key Specification" with the IdCadastro field. ... soon easy...
Of fact the problem occurred because the primary key of the BO was not defined. (the vwTbCadastroBO has its origin in one view in the database).
I wait that my English for AltaVista translator has been intelligible.
Thank you very much Rogério Mauri