How to make log details when user attemt to change te data in form?

Hi friends…

I have a task in Ax2009

i have a form named as Form_1. In this form i have grid with datasoure of table WeekDetails

Now my question is:

when i change something in the grid which in form i need to make the log details on another table with field name and table name of weekdetails but without using modified field in table?

How can i achieve this???

Could u Pls help me???

just tell me some suggestion where or in which method i need to write coding to achieve this task…

Do it in update() method (and insert(), if needed) of the table. You can check whether the field has changed by comparing the current and orig() buffer. For example:

void update()
{
    boolean field1Changed = (this.Field1 != this.orig().Field1);

    ttsBegin;

    super();

    if (field1Changed)
    {
        this.logField1Change();
    }

    ttsCommit;
}

thanks for your reply martin

But i want to perform this operation in form level only

but if i use this coding this will update my log table when i modify through JOB or by coding also.

Here my question is : I want to make the log details when the user perform the changes in grid level only(not by coding level).

You check this by using if (this.isFormDataSource()), whether the current update to the data is being done from the form as this is used as a data source.

Or place your update code at table level(by defining a method) and call it in the write method of formDataSource

ya thanks fo ur reply kranthi

from which method in datasorce(execuequery,leave or init) i need to call that table level update method.

Write method

thanks kranthi

where you went yesterday man.

i was waiting for that method name(Write method) to copy my coding.

now its working

Hi Dear,

Can you please provide us the code for this specific task ??? I have same requirement in my current project.

Thanks

When we have the database log functionality , again why we need to write the code ? [:O]

Pioneers please correct me if i am wrong .

Yes there is standard functinality in AX 2009 to track log of each record

Regards

Rajesh