Question

I have 2 linked tables which are linked together by ID.

One of them contains list of albums and second one is list of songs.

I have them in data sources with proper link types etc.

I have a form with two grids. One shows Albums and second one show list of songs which are on that album. Everything work correctly if there are songs on album. But if I there is no song on album then on a second grid are some values. There should be nothing shown. But there are some wrong information based on previous clicked album with song.

How I can ensure that if there are no songs on album the second grid will be empty or not shown at all?

Without problems: http://postimg.org/image/e2pvzmbfb

With data which should not be there:http://postimg.org/image/75xjyh9xt/

Tables: Album, Songs (One song can be on one album only and it is linked to album by AlbumID. On Song table there is relation Album.AlbumID==Song.AlbumID)

There are two data sources. One link Albums (DS_Albums). Second link Songs (DS_Songs) with JoinSource DS_Albums, link type delayed. There are two grids linked to the data sources.

Was it helpful?

Solution

That's an unusual behavior in Axapta.

1.- Check carefully the relation in Songs table with Albums table.

2.- Make sure the second grid datasource is DS_Songs and not DS_Albums, and its parent controls has DS_Songs or empty Datasource property.

3.- Perhaps what's happening is that Ax is creating a empty record by default if no records in DS_Songs are present for a given Album record selected. If this is the case, Ax creates a record with related fields automatically filled. To avoid this, go to Songs_DS datasource and put "InsertIfEmpty" property (or similar) to "No".

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top