You can debug to be sure you know exactly which line of code issues
the error in AX.  The Development IV course has a chapter about using
the .NET business connector and I would guess that the help has the
same content.

Here is a bit of information that might be helpful:
1) To debug both your .NET code as well as the AX code, modify server
configuration to allow debugging on the server. Also modify the client
configuration to allow debugging in the business connector. Set a
breakpoint in AX code somewhere or go to the user Options and make
sure that that the "Debug Mode" parameter is set to "When Breakpoint"
(Which gets set automatically as soon as you set a breakpoint
anywhere). Open the AX client and launch the debugger.
2) When you call "CreateAxaptaRecord" the string that you pass must be
the name of an EXISTING Ax table. I do not think you can use that
method, despite its name, to actually create a table in AX.  The call
that passes in "ReqPO" should not cause an error - but the call that
passes in "EAMItemRequirements" might be a problem if that table does
not already exist in your environment.
3) I prefer to write most of the code in X++ in AX classes to do
whatever work I need to do via .NET. I pass values as int and str to
the class and let AX manipulate the tables via the class.  So I use
the AxaptaObject when I need to modify data in AX. I only use
AxaptaRecord to retrieve information from AX into .NET

I hope that helps.

On Wed, Feb 18, 2009 at 3:54 AM, Sakthivel K <sakaxa...@yahoo.com> wrote:
> Hi,
>
>
>  I am using Ax 2009,I want to pass table object into .net business
> connector.I can easily
> pass str,int variable and i could not able to pass table/class objects.
>
> Below is my coding.
>
> If it is str,int  datatype i can directly pass str,int value in below
> method.
>
> In .Net side it is not giving error,but in Axapta side when i try to call
> this method i am getting err message saying that "Argument 1 is not
> compatible with required data type".
>
> AX Code:
>
> EAMItemRequirements  -->is table.
>
> public InventTransRefId creatingPlannedPO(EAMItemRequirements
> _eamItemRequirements)
> {
>      AXEAM01.AXEAM01     dllJr;
>     str refIdval;
>     ;
>     dllJr = new AXEAM01.AXEAM01();
>     refIdval = dllJr.creatingplannedPO(_eamItemRequirements);
>     return refIdval ;
>
> }
>
> .Net code:
>
>  public string creatingplannedPO(AxaptaRecord eamItemRequirements)
>         {
>             Axapta ax;
>             Int32 sno, p;
>             Int64 m = 0;
>             object oL;
>             string s = "", frmInventLocId, toInventLocId, s1, s2, s3, refId
> = "";
>             try
>             {
>                 // Login to Microsoft Dynamics AX.
>                 ax = new Axapta();
>                 ax.Logon(null, null, null, null);
>                 eamItemRequirements =
> ax.CreateAxaptaRecord("EAMItemRequirements");
>                 AxaptaRecord tReqPO = ax.CreateAxaptaRecord("ReqPO");
>                ................................
>                ..............................
>
>             }
>             catch (Exception e)
>             {
>                 Console.WriteLine("An error occurred in object creation or
> Axapta logon: {0}", e.Message);
>             }
>             return refId;
>         }
>
>
>
> Thanks,
>
> Sakthivel
>
> 

Reply via email to