Hi all, as are they, because I have a little more time and as always putting some interesting things can happen to me day. Something really interesting - from my point of view - is the integration between AX and CRM, the interesting thing about this is that the latest version of AX and gives you a connector that looks very easy to use, the style of Dynamics CRM - but earlier versions, is a bit more complicated I mean:
- should import a library named AxaptaCOMConnector, this library should be set directly on the AX, to be recorded in the server.
- must import this library to the VS.
- Schedule freely, always given to the "logon" and "logoff", always.
An example of how to make the LogOn and LogOff, is as follows:
Axapta _ax = new Axapta (); try {_ax.Logon ("USER", "" "" "");} catch (System.Exception err) {System.Diagnostics.Debug.Print (err.Source) System . Diagnostics.Debug.Print (err.StackTrace) System.Diagnostics.Debug.Print (err.Message) _ax.Logoff ();} Updated
Well, now let's see how I can access and update any record in AX, to enter a record, we must identify the AX entity, the entity once identified, we must add the following:
IAxaptaRecord ax.CreateRecord record = ("Entity" AX "); record.InitValue (); This allows us to add detail, but still not the values \u200b\u200bwe must enter, for that, add attributes, you must have in a while that we must put the exact name of the property,
record. set_field ("Language", "ES"); record.Insert (); With these lines we dicendo, in which field you have to put that value, when in AX is an associated table (in the case of Language ), which we must pass the ID or name.
acutalizacion To perform, is a bit more complicated, because we have to make a Begin and Commit, something like this:
ax.TTSBegin (); IAxaptaRecord record = (IAxaptaRecord) ax.CallStaticRecordMethod ("Entity - AX", "find", "Record Id", true, null, null, null, null); record.DoUpdate (); record.set_field ("Column Name", Value); ax.TTSCommit (); CallStaticRecordMethod The method is used to obtain the ID of the record you want to update, AX does, then get it and stores it in memory, then we must say that we want to update fields.
Finally I Commit and go give the updated record.
0 comments:
Post a Comment