Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

operand type are not compatible in RDP class

Posted on by 1,534

hi expert, today i am facing strange problem regarding operand type are not compatible, i want to display worker sales responsible name on a sales agreement fullfilment report, for this i just add the field from salesagreementheaderdefault table to sales agreement followupTmp table ,and  make the basic relationship of newly added field (worker sales responsible )with hcmworker table, when referencing it on RDP

like

 agreementFollowUpTmp.WorkerSalesResponsible=HcmWorker::find(salesAgreementHeaderDefault.WorkerSalesResponsible).name();

then it gives me error like that

Operand types are not compatible with the operator.

plz guide me ,

Regards.

*This post is locked for comments

  • Suggested answer
    munsif Profile Picture
    munsif 1,534 on at
    RE: operand type are not compatible in RDP class

    thanks quershi & Martin, my problem solved.

  • munsif Profile Picture
    munsif 1,534 on at
    RE: operand type are not compatible in RDP class

    dear i have tried it, but it gives me information regarding workersalesREsponsible in digits form(1542222), i want to get textual data (munsif)? so how it can?

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: operand type are not compatible in RDP class

    Please make sure "agreementFollowUpTmp.WorkerSalesResponsible" is extended from type "Name" not "RefRecId".

    agreementFollowUpTmp.WorkerSalesResponsible=HcmWorker::find(salesAgreementHeaderDefault.WorkerSalesResponsible).name();

    Then your code will work fine. At this stage I guess "agreementFollowUpTmp.WorkerSalesResponsible" is of type RefRecId(Int 64) and you cannot assign "Name" (string) in it.

  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 230,235 Most Valuable Professional on at
    RE: operand type are not compatible in RDP class

    If you want the name, create a field with right data type. What's the problem?

  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 230,235 Most Valuable Professional on at
    RE: operand type are not compatible in RDP class

    In that case, replace your code with

    agreementFollowUpTmp.WorkerSalesResponsible = salesAgreementHeaderDefault.WorkerSalesResponsible;

  • munsif Profile Picture
    munsif 1,534 on at
    RE: operand type are not compatible in RDP class

    thanks Martin, so please guide me how to get name for salesworker responsible,

    Regards

  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 230,235 Most Valuable Professional on at
    RE: operand type are not compatible in RDP class

    Most likely WorkerSalesResponsible is a record ID of HcmWorker (which is Int64 for value) and you're trying to assign a name (string) into it, which is clearly not compatible.

  • munsif Profile Picture
    munsif 1,534 on at
    RE: operand type are not compatible in RDP class

    thanks for quick response, both have int64 type, both have extended from salesworkerresponsible EDT.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: operand type are not compatible in RDP class

    What is the datatype of "agreementFollowUpTmp.WorkerSalesResponsible" ? Also make sure "salesAgreementHeaderDefault.WorkerSalesResponsible" is type of RefRecId.

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,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans