Grid

Hi,

I have a problem. I need to add a select records to a grid. I have two data source joined a in my form I have two grids. When i mark a record in the first grid in the second grid i must have a row with a record connected with the mark record. How I do this?? please any suggestions :)) Thanks

Do you mean something like order forms in AX? That if you select a header record, corresponding lines are displayed in the other grid? You mustn’t use join in that case - use a delayed link instead. Also ensure yourself that both grids have the right data source set in the Datasource property.

If you are looking for parent-child type form. Provide the relation to your child table(wrt parent) under table node.

Under form, don’t forget to specify the Joinsource property for your child datasource & one more thing to keep in mind is when you create 2 different grids just make sure that you have specified correct datasource to this grids.

I have this problem: In data sources i have InventTable, purchTable and purchLine. and I have 3 grids. The first grid is to mark a one rekord from InventTable ItemID. the second grid show me all PurchID where are used this ItemID, and then when I mark one of the PurchId record from the second grid in third grid i want to get all ItemID which are used in marked PurchID. In the data source must be only 3 data sources.

I have this wrote :

display ItemId wyswietl()
{
PurchTable purchTableMarked;
PurchLine items;

;

if (PurchTable_ds.Mark())

{
purchTableMarked = PurchTable_ds.getFirst(1,false);

while select * from items
where items.PurchId == purchTableMarked.PurchId
{

info(items.ItemId);

}

}

return (items.ItemId);
}

and when in the second grid i mark a rekord the info box show me all itemID i want to be shown. I dont know how enter then to the third grid

See Lines for multiple headers to understand how to show data related to several selected records.

Thank’s. You help me a lot. Now I understand how it works.

I have one more question. back to my example. my project looks like this:

I have a grid with InventTable where i want to mark a Item Id, and automatic in the secon grid with purchtable i want to see a PurchId. I can’t joint two tables. What I must do??

Sorry, I didn’t get what’s the problem. How is displaying PurchId related to joins? And why can’t you join tables?

So: I have 3 grids: the first with data source: InventTable, second with Purchtable, and third with PurchLine.

The task is : when I mark in the first grid ItemId in the second grid it show me all of PurchId where the ItemId is used., and then when I mark record PurchId in the second table in the third table i must show all ItemId used to the PurchId. and I do it this way:

In the first grid the datasource is InventTable in the second PurchTable in third PurchLine., and the problem is with marking first grid with a second because InventTable and PurchTable have not the same field. I hope you understand. :))

If I have ItemId in PurchTable it will be ok. Can I add ItemId to PurchTable??

It almost done. Please look here:

void wyswietl()
{
PurchLine purchTableMarked;
PurchLine items;
; if (PurchLine_ds.Mark())

{
purchTableMarked = PurchLine_ds.getFirst(1,false);

while select * from items
where items.PurchId == purchTableMarked.PurchId
{

info(items.ItemId);
}

}
//return (items.ItemId);
}

How can I write items.ItemId to the grid??

The question how to link items and order headers can’t be answered without defining the logical relationship. The usual relationship is “the item is used on one or more lines of the order”. But in that case, adding ItemId to PurchTable or PurchId to InventTable wouldn’t make sense.