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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Unable to cast object of type 'Dynamics.AX.Application.Forms.InventTrans' to type 'Microsoft.Dynamics.Ax.Xpp.Common'

(0) ShareShare
ReportReport
Posted on by 25

[ExtensionOf(tableStr(InventTransOrigin))]
final class INFInventTransOrigin_T_Extension
{

public display Str yuvraj()
{

ProdBOM prodbom;


if(this.ReferenceCategory == InventTransType::Production)

{
select prodbom where prodbom.ProdId == this.ReferenceId ;
{

if(prodbom.InventRefId)
{
return prodbom.InventRefId;
}

}
}
return null;
}

}

I PUT THIS DISPLAY METHOD ON A STRING CONTROL IN INVENTTRANS FORM WITH DATA SOURCE INVENT TRANS ORIGIN 

I have the same question (0)
  • Suggested answer
    Mohit Rampal Profile Picture
    12,565 Moderator on at

    Hi Ruthwik, Instead of null try returning empty string ' '

  • ruthwik alluri Profile Picture
    25 on at

    already tried bro...but not working

  • Suggested answer
    GirishS Profile Picture
    27,827 Moderator on at

    Hi ruthwik,

    Have you confirmed that the error is coming from the display method you added?

    Because the error is saying different thing.

    Can you debug and confirm it?

    If the error is coming from the display method, debug and see exactly at what line the error is throwing.

    Thanks,

    Girish S.

  • ruthwik alluri Profile Picture
    25 on at

    pastedimage1683712531696v1.png

    error is showing at 92 line....what to do bro??

  • GirishS Profile Picture
    27,827 Moderator on at

    This is a standard piece of code where the error is throwing.

    But we are asking in display method - At which line the error is throwing in the display method you have written.

    Thanks,

    Girish S.

  • ruthwik alluri Profile Picture
    25 on at

    no error in display method......and also the debugger is skipping my select statement

  • GirishS Profile Picture
    27,827 Moderator on at

    Then I think its not because of display method. Have you done any other customizations.

    If you comment the display method is it throwing error?

    Thanks,

    Girish S.

  • ruthwik alluri Profile Picture
    25 on at

    yes bro even after commenting....its throwing error......i kept synchronize database....still the error was coming....so i am replacing my entire DB now

  • Martin Dráb Profile Picture
    237,967 Most Valuable Professional on at

    Open details of the exception and look at the stack trace. This should show give more details that you've collected to far.

    The error itself is saying that you're trying to assign a form to a variable that can hold tables only, but it's important to know where it happens.

  • ruthwik alluri Profile Picture
    25 on at

    no...there is no error in my code

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 451 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 428 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans