Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 73760

How to use ValidTimeStateUpdateMode using .Net Business Connector

$
0
0

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#?


Viewing all articles
Browse latest Browse all 73760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>