What is the difference between Write and Insert Method?

dhirajdhiraj Member Posts: 4
edited 2008-08-26 in Dynamics AX
Hi,
What is the difference between write method and insert method.
And when and how will you identify whether to use write method or insert method.


warm regards,
dhiraj karmalkar
Warm Regards,
Dhiraj Karmalkar

Comments

  • ClausThomsenClausThomsen Member Posts: 2
    Hi dhiraj

    You can use the write method to skip testing whether you should insert or update a record.

    if ( custTable.validateWrite() )
    {
    if ( custTable.recId )
    custTable.update();
    else
    custTable.insert();
    }

    Instead of the above code you can write the following :

    if ( custTable.validateWrite() )
    {
    custTable.write();
    }


    regards

    Claus Thomsen
    
                            
  • MikerMiker Member Posts: 105
    You can use the write method to skip testing whether you should insert or update a record
    But strongly enough
    better use insert for insert, but update for update, because update intend ttscommit transaction
    going to Europe
Sign In or Register to comment.