Click here to Skip to main content
15,886,067 members
Articles / Programming Languages / C# 3.5

Integrate Microsoft Dynamics Axapta with Temperature Conversion C# Application - Part II

Rate me:
Please Sign up or sign in to vote.
4.86/5 (6 votes)
14 Dec 2010CPOL5 min read 71.9K   1.1K   13  
This article will demonstrate that after sending the data from Axapta to Temperature conversion application, how we can post back the converted temperature to Axapta.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Dynamics.BusinessConnectorNet;

namespace CvrtC2Frnt
{
    class AxHelper:BC
    {
        BC bc = new BC();
        Axapta ax;
        string tableName = "SalesTable";
        AxaptaRecord axRecord;

        public void SetAxRec(Boolean  Farenhite, double Temp, string SalesId)
        {
           ax = bc.GetAxConnection();
           
           if (ax != null)
           {
               using (axRecord = ax.CreateAxaptaRecord(tableName))
               {
                   ax.TTSBegin();
                   axRecord.ExecuteStmt("select forupdate * from %1 where %1.SalesId ==" + "'" + SalesId + "'" );
                   axRecord.set_Field(50001, Temp);

                   if (Farenhite == true)
                       axRecord.set_Field(50002, 1);
                   else
                       axRecord.set_Field(50002, 0);
                   axRecord.Update();
                   ax.TTSCommit();
               }
           }
           
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Technical Lead
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions