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)

The 'value' argument is incompatible with the required type.

(0) ShareShare
ReportReport
Posted on by 30

I stumbled today on a well know error: 'Argument is incompatible with the required type.'

CustTable_Blocked.text(_MyTable.Blocked);

2678.img4.png

Please, help me.

Thank You.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Yassine Fallate Profile Picture
    30 on at
    RE: The 'value' argument is incompatible with the required type.

    Hi Nikolaos,

    Thank you so much for your reply

    I tried to enter the next instruction

    CustTable_Blocked.selection(_MyTable.Blocked); for comobox type

    and DataSourceCustTable_CreditMax.realValue(_MyTable.CreditMax);  for  real type

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at
    RE: The 'value' argument is incompatible with the required type.

    It's an enum and you can't assign an enum value to a method that expects a string as an argument.

    But why are you trying to assign this value to a form control, instead of the underlying table? Only if your form control is not bound to a table field, you should assign values to the control. Otherwise, assign the value to the table field directly:

    Then you could just have:

    CustTable.Blocked = _MyTable.Blocked;

    CustTable_ds.refresh();

    CustTable_ds.research(true);

    This applies to all your other fields as well.

    If your form control is not bound to a table field, use:

    CustTable_Blocked.selection(_MyTable.Blocked);

  • Yassine Fallate Profile Picture
    30 on at
    RE: The 'value' argument is incompatible with the required type.

    Hi BrandonSA

    it's not a boolean value but it's combox that I have to choose a value

  • Suggested answer
    BrandonSA Profile Picture
    1,673 on at
    RE: The 'value' argument is incompatible with the required type.

    Hi

    I'm guessing that CustTable_Blocked is a control on a form. The text property of that control takes a string argement. You're trying to pass _MyTable.Blocked as an argument. If _MyTable.Blocked is a string, this will work fine, but if it isn't, you'll get an error. I'm guessing _MyTable.Blocked is a boolean/NoYes value, in which case you'll need to cast the value or something like that. But what ever is going on, what you're passing the text property of the CustTable_Blocked control isn't a string, which means it's an incompatible argument.

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Community Member Profile Picture

Community Member 4

#2
Guy Terry Profile Picture

Guy Terry 2 Moderator

#2
Nayyar Siddiqi Profile Picture

Nayyar Siddiqi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans