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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Wrong argument type for function

(0) ShareShare
ReportReport
Posted on by

vAccountType = str2num(conpeek(transline,4));

above vAccountType is an integer variable declared as int.

it is showing as Wrong argument type for function. Not getting it. I am a newbie. Anyone please help. Thanks in advance.

*This post is locked for comments

I have the same question (0)
  • Bashir Ahmad Profile Picture
    5,248 on at

    conPeek retrun anytype ,

    Retrieves a specific element from a container, do the following :

    anytype aty;

    aty = onpeek(transline,4);

    vAccountType = str2num(aty ) OR  vAccountType = str2Int(aty);

  • Oleg Abapolov Profile Picture
    39 on at

    Hi Mahesh,

    I guess there are at least 3 reasons for the "Wrong argument type for function" error:

    1. element number 4 in transline container is not a string

    2. container transline does not have element number 4

    3. container transline is empty

    Best regards,

    Oleg

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans