Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

Econnect 10: Ambiguous column name 'Cash_Receipt!2!RMDTYPAL!element'.

Posted on by Microsoft Employee

I have a problem after upgrading to Great Plains 10.

When  I try to retrieve data from the 'Cash_Receipt' table with OUTPUTTYPE = 2 (CompleteDocument).

an SqlException is thrown, the stack trace is:

 

System.Data.SqlClient.SqlException was caught

  Message=Ambiguous column name 'Cash_Receipt!2!RMDTYPAL!element'.

  Source=.Net SqlClient Data Provider

  ErrorCode=-2146232060

  Class=16

  LineNumber=2

  Number=209

  Procedure=taRequesterCash_Receipt2

  Server=ldn-gpdb

  State=1

  StackTrace:

    Server stack trace: 

       at Microsoft.Dynamics.GP.eConnect.eConnectMethods.eConnect_Requester(String ConnectionString, ConnectionStringType ConnectionType, String sXML)

       at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)

       at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)

       at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)

    Exception rethrown at [0]: 

       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)

       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)

       at Microsoft.Dynamics.GP.eConnect.eConnectMethods.eConnect_Requester(String ConnectionString, ConnectionStringType ConnectionType, String sXML)

       at EConnectClasses.eConnectProvider.Retrieve(String DOCTYPE, OutputType OUTPUTTYPE, String WHERE) in D:\Work\TFS\Telco Solutions\E-connect\E-connect Deployment-NBC\Business Tier\EConnectHandler\EConnectClasses\eConnectProvider.cs:line 155

  InnerException: 

I found a solution which states that I have to make the OUTPUTTYPE = 0 (List). and it really works with no exceptions but this way doesn't retrieve all data needed from the Cash_Receipt table it just returns econnect data
XML Retrieved from list:
<root>
<eConnect>
<ACTION>0</ACTION>
<DOCTYPE>Cash_Receipt</DOCTYPE>
<RMDTYPAL>9</RMDTYPAL>
<DOCNUMBR>00000</DOCNUMBR>
<DBNAME>DB</DBNAME>
<TABLENAME>RM10201</TABLENAME>
</eConnect>
<eConnect>
<ACTION>0</ACTION>
<DOCTYPE>Cash_Receipt</DOCTYPE>
<RMDTYPAL>9</RMDTYPAL>
<DOCNUMBR>00000</DOCNUMBR>
<DBNAME>DB</DBNAME>
<TABLENAME>RM10201</TABLENAME>
</eConnect>
</root>
Any help will be highly appreciated; thanks in advance.

*This post is locked for comments

  • Verified answer
    George Nairooze Profile Picture
    George Nairooze 25 on at
    Re: Econnect 10: Ambiguous column name 'Cash_Receipt!2!RMDTYPAL!element'.

     

                    The cause is the duplication of “RMDTYPAL” value of DOCTYPECash_Receipt” in “INDEX1, DATA16” columns in “econnect_out_setup” table.

    A safe approach is to create a new type with no columns duplication. 

    New doc type “Cash_Receipt_G” has been created, which is the exact copy from Cash_Receipt type except for “RMDTYPAL” in “DATA16” column (it was removed). 

     ------------------SQL Script to Add New Type------------------------------------------------------------

    INSERT [eConnect_Out_Setup]

               (QUEUE_ENABLED

    ,DOCTYPE

    ,INSERT_ENABLED

    ,UPDATE_ENABLED

    ,DELETE_ENABLED

    ,TABLENAME

    ,ALIAS

    ,MAIN

    ,PARENTLEVEL

    ,ORDERBY

    ,INDEX1

    ,INDEX2

    ,INDEXCNT

    ,TRIGGER1

    ,TRIGGER2

    ,TRIGGERCNT

    ,DATACNT

    ,DATA1

    ,DATA2

    ,DATA3

    ,DATA4

    ,DATA5

    ,DATA6

    ,DATA7

    ,DATA8

    ,DATA9

    ,DATA10

    ,DATA11

    ,DATA12

    ,DATA13

    ,DATA14

    ,DATA15

    ,DATA16

    ,DATA17

    ,DATA18

    ,DATA19

    ,DATA20

    ,DATA21

    ,DATA22

    ,DATA23

    ,DATA24

    ,DATA25

    ,DATA26)

    Select QUEUE_ENABLED

    ,'Cash_Receipt_G'

    ,INSERT_ENABLED

    ,UPDATE_ENABLED

    ,DELETE_ENABLED

    ,TABLENAME

    ,'Cash_Receipt_G'

    ,MAIN

    ,PARENTLEVEL

    ,ORDERBY

    ,INDEX1

    ,INDEX2

    ,INDEXCNT

    ,TRIGGER1

    ,TRIGGER2

    ,TRIGGERCNT

    ,26

    ,DATA1

    ,DATA2

    ,DATA3

    ,DATA4

    ,DATA5

    ,DATA6

    ,DATA7

    ,DATA8

    ,DATA9

    ,DATA10

    ,DATA11

    ,DATA12

    ,DATA13

    ,DATA14

    ,DATA15

    ,DATA17

    ,DATA18

    ,DATA19

    ,DATA20

    ,DATA21

    ,DATA22

    ,DATA23

    ,DATA24

    ,DATA25

    ,DATA26

    ,DATA27

    From [eConnect_Out_Setup]

    where DOCTYPE = 'Cash_Receipt'

    ------------------------------------------------------------------------------

    The E-Connect user should have dbo owner role for GP database in the first run for E-Connect after the creation of the new type. This gives GP the permission to create new stored procedures for the new type.

    After that remove the dbo owner role from the E-Connect user.

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans