Initialize or get the data from Parent Table to Child Table.And this functionality is done based on Foreign key .
Below is the Lookup functionality implemented to get the data from Parent Table to Child table using Init Method
Step 1 : Created Parent Table with name Product Category (ProductCategoryID , Product_Category)and entered some data in it .
Step 2: Now Created child table with Columns (Product ID, Product Name , List Price ,Standard Cost,Quantity ) And these columns are related to Products.Now Create two more Columns one Category(String) and other Category Price (Real Datatype) .
Note: In my case I had created the child table with name "InventoryProduct"
Step 3 : Get All the values of ProductCategory column from Parent Table to child table column Category :
1. Create Relation in Child Table below is the .I had create the Relation name as "GetCategories" .And specified my parent table name in "Properties Tab -> Table"
2: Create the Normal Relation , By right clicking the relation name
3: Now select the Category Field which is column of Child Table
And as shown below select the column ProductCategory of parent table
automatically relation will get's created in child table:

Note: If you get 2 coumn values in child table column "Category" Please drag and drop the "ProductCategory" column in " AutoLookup" of "Field Group" Section.
Step 4:Create the "ModifiedField" method and apply below code before Super() method
ProductCategory productc;
if(_fieldId==fieldNum(InventoryProducts,Category))
{
select productc where productc.Product_Category== this.Category;
this.CategoryID=productc.ProductCategoryID;
}
Below is the Lookup functionality implemented to get the data from Parent Table to Child table using Init Method
Step 1 : Created Parent Table with name Product Category (ProductCategoryID , Product_Category)and entered some data in it .
Step 2: Now Created child table with Columns (Product ID, Product Name , List Price ,Standard Cost,Quantity ) And these columns are related to Products.Now Create two more Columns one Category(String) and other Category Price (Real Datatype) .
Note: In my case I had created the child table with name "InventoryProduct"
Step 3 : Get All the values of ProductCategory column from Parent Table to child table column Category :
1. Create Relation in Child Table below is the .I had create the Relation name as "GetCategories" .And specified my parent table name in "Properties Tab -> Table"
2: Create the Normal Relation , By right clicking the relation name
3: Now select the Category Field which is column of Child Table
And as shown below select the column ProductCategory of parent table
automatically relation will get's created in child table:
Note: If you get 2 coumn values in child table column "Category" Please drag and drop the "ProductCategory" column in " AutoLookup" of "Field Group" Section.
Step 4:Create the "ModifiedField" method and apply below code before Super() method
ProductCategory productc;
if(_fieldId==fieldNum(InventoryProducts,Category))
{
select productc where productc.Product_Category== this.Category;
this.CategoryID=productc.ProductCategoryID;
}
Comments
Post a Comment