Hi, christoph.malherbe,

Why do you use the code to make a dynamic link
manually?

Delete the code in executeQuery, and create relation
between VehicleTable and VehicleOwnerHistory on
VehicleOwnerHistory table.
When you create a menuitembutton on VehicleTable form
that launch VehicleOwnerHistory form, then Axapta will
create the dynamic link automatically.

If you want to learn about this, create the simplest
forms and tables. Then, use that method on your form,
because I don't see your other modifications on your
form.

Good luck.

--- cdlmalherbe01 <[EMAIL PROTECTED]>
wrote:

> I have a table "Vehicles" which contains 2 fields,
> "VehicleId"
> and "OwnerId".
>
> "VehicleId" is the primary key for table
> "VehicleTable".
>
> When the "OwnerId" is changed, I record the value of
> the
> previous "OwnerId" in a table called
> "VehicleOwnerHistory" with
> fields "VehicleId", "OwnerId", "DateChanged" etc.
>
> From my "VehicleTable" form, I want to launch a
> form "VehicleOwnerHistory" form which shows the list
> of historical
> owners. This form is used to view and update the
> list of historical
> owners.
>
> I looked at the "LedgerTransAccount" form and how it
> is launched
> from the "LedgerTable" form to show transactions for
> the selected
> account only. The principle applies to my problem.
>
> I've adapted the code in the "InitQuery" and
> "executeQuery" methods
> of the LedgerTransAccount form:
>
> --------void
> InitQuery()---------------------------------------
>       {
>           Query query;
>           Vehicles vehicles;
>           VehicleOwnerHistory vehicleOwnerHistory;
>
>           ;
>
>           query = new
> query(querystr(vehicleOwnerHistory));
>
>           switch(element.args().dataset())
>           {
>               case(tablenum(FSMEquip)):
>                   fsmEquip = element.args().record();
>      
>                 
> query.dataSourceNo(1).addDynalink(fieldnum
> (Vehicles,VehicleId),Vehicles,fieldnum
> (VehicleOwnerHistory,VehicleId));
>
>                   break;
>
>               default:
>           }
>
>           VehicleOwnerHistory_ds.query(query);
>       }
>
> --------public void
> executeQuery()-----------------------------------
>       {
>           this.InitQuery();
>
>           super();
>       }
>
> It seems to work except for the fact that it returns
> only 1 record
> when I launch the VehicleOwnerHistory form,
> irrespective how many
> matching records exist in the VehicleOwnerHistory
> table.
>
> All help appreciated!
>
>
>
>
>
>
>
>


Best regards,


Sonny Wibawa Adi
MBS Certified Professional - Axapta 3.0 Technical
MCSD.NET
MCAD.NET


           
__________________________________
Yahoo! Music Unlimited
Access over 1 million songs. Try it free.
http://music.yahoo.com/unlimited/




SPONSORED LINKS
Computer part Programming languages Microsoft axapta
Support exchange


YAHOO! GROUPS LINKS




Reply via email to