web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Operand types are not compatible with the operator

(0) ShareShare
ReportReport
Posted on by

I am trying to insert into my temp table. There is error showing as “Operand types are not compatible with the operator.”

Kindly see my code

ttsBegin;

 

while   select crossCompany TaxCode from TaxTrans where TaxTrans.DATAAREAID == prTransDataArea

 

 

   {

            TmpTaxTransaction.TaxCode=TaxTrans.TaxCode;

 

       TmpTaxTransaction.insert();

 

 

   }

 

   ttsCommit;

 

Contract Class

[

   DataMemberAttribute("prTransDataArea"),

   AifCollectionTypeAttribute("prTransDataArea", Types::String),

   SysOperationLabelAttribute(literalStr("CompanyInfo"))

]

public DataArea parmCompany(DataArea _prTransDataArea = prTransDataArea)

{

   prTransDataArea = _prTransDataArea;

 

   return prTransDataArea;

}

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Community Member Profile Picture
    on at
    RE: Operand types are not compatible with the operator

    Hi Muhammed Usama Aziz,

    Thank you for your support and its working fine.

  • Verified answer
    Muhammad Usama Aziz Profile Picture
    on at
    RE: Operand types are not compatible with the operator

    The return type you have used in the parm method is a table while the field with which you are comparing is a string. Replace your parm method with the below method

    [

      DataMemberAttribute("prTransDataArea"),

      SysOperationLabelAttribute(literalStr("CompanyInfo"))

    ]

    public DataAreaId parmCompany(DataAreaId _prTransDataArea = prTransDataArea)

    {

      prTransDataArea = _prTransDataArea;

      return prTransDataArea;

    }

  • Community Member Profile Picture
    on at
    RE: Operand types are not compatible with the operator

    Thank you JL Aguilera,

    How can I use the parameter value for DATAAREAID. I am using lookup class for dataarea from companyinfo table and the selected texts I need to pass the query .

  • JL Aguilera Profile Picture
    68 on at
    RE: Operand types are not compatible with the operator

    I think your parmCompany method is returning the data type dataArea (table) and you are matching it to the data type DataAreaID TaxTrans.DATAAREAID

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Syed Haris Shah Profile Picture

Syed Haris Shah 9

#2
Martin Dráb Profile Picture

Martin Dráb 2 Most Valuable Professional

#2
Community Member Profile Picture

Community Member 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans