Page 1 of 1

Change the block source dynamically

Posted: Wed Jun 13, 2007 3:48 am
by fahedakhter
I have a block name "EMP" & "EMP2". I want to change the property of block emp QUERY_DATA_SOURCE_NAME to "EMP2" I write a trigger on When-New-Form-Instance.

Set_Block_Property('Emp',Query_Data_Source_Name,'Emp2');
Set_Block_Property('Emp',Query_Allowed,4);
Set_Block_Property('Emp',Update_Allowed,4);
Clear_Block(No_Validate);
Execute_Query(No_Validate);

It work fine and data is populated. But when I change any record it give me an error.
FRM-40654: Record has been updated by another user. Re-query to see change.

When I omit Set_Block_Property('Emp',Query_Data_Source_Name,'Emp2'); then
it work fine. Remember there is no lock in any table.

Regard's
Fahed Akhter