Join sources in Form.

Hi All,

I got a requirement , where I have to create a form includes 2 Grids like Header and line and it consists of a button named post .By clicking that button we should hit to a 3rd table using classes and 3rd table is having fields of both tables and we have to do the total of amount field in 3rd table.

Could you please let me know how to do this requirement using classes.

Hi Sravya,

You can do the While select query on the Click method of the button.

Thanks & Regards

Pranav

Define a class with main method, so that it can accessed through action menu item, which can be added to the form(in the header section).

The main method will receive current header record as args, find out the line records from the current header record and use them for updating/inserting the third table.

Hi Kranthi,

Thanks for your quick reply .I tried this requirement using args class but it is not transferring data from table2 to table3 as i required.Could you tell how to do the same with sample code.

Thanks & regards,

Sravya.

Hi,

1.Create a class with main method
2.get header record from args.record()
3.Insert in to third table.
4Use while select statement based on the primary key(Headertable) and insert to table3.
Note: Use try catch statement.If system encounter any error it will rollback alltransaction.

Example.

class static void main(Args _agrs)
{
Table1 table1;
Table2 table2;
Table3 table3;
;
if(_args.dataset() == tablenum(Table1))
{
Table1 = _args.record();
}

try
{
ttsbegin;
// while loop(Table2) based on Table1.primary key
// Validation
// Insert to Table3
ttscommit;
}
catch(Exception::error)
{
error msg
}
}

Check below path \Classes\WMSJournalCheckPost\main

This is just example.

Sorry for the above post.

Example.

class public static void main(Args _agrs)
{

}