x++


How to filter records in line grid based on selected record in header grid?


I have a form with 2 grids. I want to display records in second grid(Line grid) according to the selected record in First grid(header grid) i.e, I need to filter records in second grid..
How to do that?? I am using query as a datasource on a form.
As shown in figure, there is a common field named Activity number.. Now, I need to display records in Second grid for selected record in first grid(Say VA-00015).
This is called joined datasources and explained in the link.
If your datasources are based on a query, you are out of luck: the tables are either inner or outer joined, so the usual dynalink logic will not work.
You will have to revert to normal table based datasources.
Use the JoinSource, for example you can have 2 datasource SalesTable and SalesLines, the in the details DataSource which is SalesLine set the JoinSource to SalesTable. Now once you click on the SalesTabel grid the SalesLine grid will display the lines for the selected SalesTable, no need for extra code.
You need to learn basics of Morph X dev environment, This may help you..
If the datasources in a form are based on a query, there is no option available for join datasource and also we cannot add any extra datasource: and the tables are either inner or outer joined.
So, better not opt for a query when you need to display data using dynamic linking.
I did the same and took different tables as a datasource instead of a query. Moreover, I have also created two different datasources for a same table which is being used commonly in both Header and Line grids for linking.
FurtherMore, I have joined the datasources a/c to my need.
I have also created some display methods for a fields which is being used from different datasource.

Related Links

Cancel Sales order packing slip through x++
Transferring open account records between customers
How to make sure that a form is only opened once?
Extend system menu in Dynamics AX 2012?
How to show selected items of certain table on the different table in Dynamics AX 2012?
AllowEdit doesn't work properly in Dynamics AX
AX 2012 how to set args record datasource in X++
Clients seem to be running old (buggy) code after XPO project import
Number sequence AX 2012
SSRS MS words report with page break
How can you get a detailed error descriptions in Dynamics AX?
How to get the length of an array?
X++ loop through lines in grid control
Concatenating row values in x++
How do you access a macro in the AOT macro node?
How can I set the Backgoundcolor of an AX2012 Action Pane Button

Categories

HOME
android
url-redirection
gdb
rdbms
google-spreadsheet
pda
depth
numbers
jelastic
tail
nested-if
onclick
project
pcl-crypto
commonjs
datastage
openbugs
symmetricds
plink
cumulocity
symbol
parameter-passing
linear-algebra
mathprog
sse
poedit
undertow
backpack-for-laravel
highstock
syntax-highlighting
asymptotic-complexity
corenlp-server
volatile
mustache
record
testbed
angularjs-material
autolisp
hreflang
yowsup
imx6
sharepoint-workflow
latitude-longitude
lint
xcode7.3
graphhopper
plaintext
preloader
dbnull
subclipse
tcc
procfile
corruption
mach-o
google-photos
lrs
drawstring
simevents
nss
sapi
fiware-monitoring
pypiserver
mod-proxy
atoi
zscript
dulwich
haskell-warp
kubuntu
actionfilterattribute
procedural-programming
mruby
crowd
sonarqube-5.0
cocos3d
lnk
android-framework
mbunit
neos-server
nevron
ui-select2
mantle
booksleeve
curb
os.system
usertype
gobject-introspection
user-tracking
multiplatform
uipagecontrol
delimited-text
eclipse-marketplace
web-application-project
sun
xpsdocument
product-management
xslcompiledtransform
contentpresenter

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App