Foreign Key Field Description


Author
Message
ChanKK
ChanKK
Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)
Group: Forum Members
Posts: 190, Visits: 1.3K
Hi,

I have table employee (EmployeeBO) with field

employeeNo, employeeName.



I have txn table sale (SalesBO) with field

SalesNo, Date, EmployeeNo, Qty, Price, Total



I would like like to list table employee in editable GridView with columns



SalesNo, Date, EmployeeNo, EmployeeName, Qty, Price, Total



In order to achieve this, I added custom bindable field - EmployeeName to SalesBO, and retrieve it from employeeTable whenever required. I found that it is really killing my application performance.



May I know how should I amend it to get back performance?



Thank you

Replies
ChanKK
ChanKK
Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)
Group: Forum Members
Posts: 190, Visits: 1.3K
Hi,

No, I don't want to update employeeName, but need to update



SaleDate, Qty, Price, EmployeeNo



As I know, SQL Server doesn't support update to any view that involve more than one table.



Beside, if I want to add new record to SalesBO, I do need to have additional handling to update EmployeeName in SalesBO as well so that the grid will show the latest data.



Is it the way?
Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Well then my approach should work for you since I do the same thing.



In SalesBO you have the FK for employee plus the cfp_EmployeeName, once you load the data it will bring the cfp_EmployeeName for that FK. If you are adding records, then you need to update the cfp_EmployeeName yourself at that time since the new record will not have that information.



Please try not to get confuse, this is pretty simple approach. One of the beauty feature of the BO is that it uses an internal data table and this does not need to match with the properties created by the BOM which means that if the SQL query you use to fill the bo have a field (in this case cfp_EmployeeName) which is not in the BO it will to trigger any error but the underline data table will have this column which you can access in the Custom Field Property and update the cfp_EmployeeName property from it.

Edhy Rijo

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search