I have a form with 2 Data source and 2 grids. DS1 is mapped with Grid 1 and DS2 is mapped with Grid2. I have a menu item M1.
When I’m clicking the Menu item M1, I want to pass the active record of corresponding DS. Example, if i click on DS1 and then click M1 then DS1 record should pass and if i click DS2 and press M1 then DS 2 record should pass.
I have written code in M1 - clicked method.
My problem is, how to find the active / currently focused Datasource.
I created common flags, and made true /false in Active method of each DS . but it is not called, when it has single record. When I’m changing focus of each grid, active method is not calling.
If you have any idea, pls share it
You don’t need any code at all. Simply set DataSource property of M1 to DS2 and you’ll receive the active record in Args.
If you wanted to write some code anyway, you would find the active record in an automatically created variable with the same name as the datasource (e.g. DS1).
Thanks for your quick reply.
All the time , I dont want to send same DS records. When I click on Grid 1, then Grid1 (DS1 mapped) datasource have to pass. If i click on Grid2(DS2 mapped) then Grid2 DS have to pass.
If i set DS property for menu item then all the time, record will pass only from the DS which i set in the properties. Hope you understand my scenario.
Pls do the needful
Then use the other part of my reply. If you have some problem with it, you’ll have to explain it - I can’t read your mind.
I would like to find the currently focused datasource thro code. Example, if i clicked on Grid2 and click on M1… then it has to written Grid2’s DS.
using which method / where/how can I find the currently focused DS.
Thanks in advance
It seems that you missed one half of my reply, even after I asked you to read it again. Let me copy it here as well: Find the active record in an automatically created variable with the same name as the datasource (e.g. DS1).
If I have understood your question correctly, you need to set the record of the Grid datasource being selected, if so overwrite enter method, and even gotfocus method will be of some use. Refer the methods here. The method will be executed after a user selects a control (grid in your case).
No methods are needed, because the value is already saved to the variable by AX. Just use the variable, that’s all.