Skip to main content
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

  • Oleg Abapolov Profile Picture
    21 on at
    RE: Wrong argument type for function

    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

  • Bashir Ahmad Profile Picture
    5,248 on at
    RE: Wrong argument type for function

    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);

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

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Kempeth Profile Picture

Kempeth 4

#1
Andy Adamak Profile Picture

Andy Adamak 4

#1
Community Member Profile Picture

Community Member 4

Featured topics

Product updates

Dynamics 365 release plans