I have a method written in C# that updates LogisticsPostalAddress in AX table.
private void updateLogisticsPostalAddress()
{
ax = new Axapta();
ax.Logon(null, null, null, null);
axRecord = ax.CreateAxaptaRecord("LogisticsPostalAddress");
axRecord.ExecuteStmt("SELECT forupdate * FROM %1 where %1.recid == " + intRecid);
if (axRecord.Found)
{
ax.TTSBegin();
axRecord.set_Field("CountryRegionID", txtcountry.Text);
axRecord.set_Field("STATE", txtregion.Text);
axRecord.set_Field("City", txtcity.Text);
axRecord.set_Field("CityRecid", txtcity.SelectedValue);
axRecord.set_Field("Street", txtstreet.Text);
axRecord.set_Field("Address", txtstreet.Text + " " + txtcity.Text + " " + txtregion.Text + " " + txtcountry.Text);
axRecord.set_Field("ModifiedDateTime", DateTime.Now);
axRecord.Update();
ax.TTSCommit();
}
}
However, this method does not allow me to update a record since i have not specify the ValidTimeStateUpdateMode. How can i do this in C#?