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 :
Microsoft Dynamics AX (Archived)

how to get exact string while using conpeek ?

(0) ShareShare
ReportReport
Posted on by 4,359

Dear All,

I have a string "00000042" in a container "con" at position 1.

When I am getting the string in individual string for example.

s = conpeek(con, 1);

I am getting value as 42 and not 00000042 i.e., it is loosing the previous string as I suppose its a zero.

so how to achieve the whole string "00000042" without loosing a 0;

Thanks.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Mea_ Profile Picture
    60,284 on at

    Its not true. if you will run this job

    static void Job2(Args _args)
    {  
        container c = ['000042'];
        str s = conPeek(c,1 );
        info(s);
    }


    you will see that s = "000042".

    You can get 42 only if "s" has type int instead of string.

  • Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    I can see it might be issue with your insert, and not with retrieval.

    Because container will return you back, same what you inserted. you may be inserting 000042 as number. if so,, you can use function to convert number to str before insert or at time of insert

  • TimODonnell Profile Picture
    5 on at

    Have a look here for a work around ....

    http://dax-ideas.blogspot.com/2011/06/con2str-and-str2con-functions-in-global.html

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans