How to check which form control has been modified ?

In sales line details in salestable form, there are some dates i.e.,requested shipping date,requested receipt date,confirmed receipt date and confirmed shipping date .I have to modify the dates for multiple lines…where as in standard it’s applicable for only individual lines…

i have done the customization …nd it’s working fine

SalesLine _salesLine,_salesLine1;

SalesTable _salesTable;

MultiSelectionHelper helper = MultiSelectionHelper::construct();

date shipingdate1,confirmdate1;

helper.parmDatasource(SalesLine_DS);

select _salesLine where _salesLine.ItemId == SalesLine.ItemId && _salesLine.SalesId == SalesLine.SalesId;

{

if(_salesLine)

{

shipingdate1 = _salesLine.ShippingDateRequested;

confirmdate1 = _salesLine.ReceiptDateRequested;

_salesLine = helper.getFirst();

while (_salesLine.RecId != 0)

{

select forUpdate _salesLine1 where _salesLine1.RecId == _salesLine.RecId;

{

if(_salesLine1)

{

_salesLine1.ShippingDateRequested = shipingdate1;

_salesLine1.ReceiptDateRequested = confirmdate1;

_salesLine1.update();

}

}

_salesLine = helper.getNext();

}

}

}

but my requirement is…wen the requested shipping date will be modified, only this dates will get updated for all marked lines and wen the confirmed shipping date will be modified, only confirm dates will get updated for all marked lines.

to do so, which condition I should give ?

In SalesTable.update() above super() (for example), you can check whether this.SomeField == this.orig().SomeField. Then you can update all relevant sales lines with update_recordset.

Note that your code above never use anything from _salesTable variable. Also the use of MultiSelectionHelper seems highly suspicious to me.

Any other way ??

Why?

I have never used that concept.

can u give an example by writing a code for better clarification…

or is there ny other method ,by which we can know which form control is currently modified ?

Than you should learn the concept. For example, look at how modified DlvMode is handled in SalesTableType.update() (at least in AX 2012 R3).

Trust me, updating sales lines when a form control (not the record in database) changes would be a bug easily leading to data corruption. You want to do all updates in the same database transaction.

to meet my requirement in which table update method I have to write the logic salesline or salestable ?

I assume that you want to run the logic when a field on SalesTable changes (= SalesTable is updated), but your functional requirements are something what you should explain to us and not the other way around.

no…I have to update from salesline…coz the fields I m modifying, are present in salestable form>line view>line details fast tab>delivery tab

I have to change the dates for multiple lines from here.

Sorry, I don’t understand what your functional requirement, therefore I can’t tell you how to implement it.

Nevertheless I hope that I answered the question how to check whether a field was modified.

No sorry I didn’t get the answer …

All right, so please explain to me what’s your problem with this.SomeField != this.orig().SomeField. Have you looked at the example in SalesTableType.update(), as I told you? Or you can find other examples, AX is full of them.

The code compares the modified value with the original value - exactly what you need.

plz tell me where i have to write the logic to compare …

Do you want me to repeat the whole discussion? Please read my first reply again.

So as I am modifying the shiping dates n all in salesline …so I’ve to write the logic to compare the value inside salesline table update() above super()…That’s what u mean I believe…

By using update_recordset , can we update the data for all marked lines ??

As I am modifying in salesline…so I have to write the logic inside Salesline table update() above super() u mean to say I believe…

and by using update recordset …am i able to update the data of all marked lines??

Please read the documentation to understand update_recordset. You can use a search engine to find documentation by yourself.