Post Details

How can I implement ComputedColumn in D365FO using X++ for the scenario where there is the same value between two tables?

In D365FO, you can implement a ComputedColumn using X++ to calculate the same values between two tables by creating a new method in the table where you want to add the ComputedColumn. Here is an example of how you can achieve this: 1. Create a new method in the table where you want to add the ComputedColumn. In this method, you can write the logic to calculate the same value between two tables.


                            
public SalesTable getSameValue(SalesTable salesTable)
{
    CustTable custTable;
    select * from custTable where custTable.AccountNum == salesTable.AccountNum;

    if (custTable)
    {
        salesTable.SameValue = custTable.FieldName; // Set the same value from CustTable to SalesTable
    }

    return salesTable;
}

                        

` 2. Create a new ComputedColumn in the table and set the ComputedMethod property to the method you created in step 1. 3. You can now access the computed column in your code or forms to display the calculated value. By following these steps, you can implement a ComputedColumn in D365FO using X++ for the scenario where there is the same value between two tables.


Leave A Reply


Name*

E-mail*