Pages

Tuesday, August 22, 2017

Job to export AX 2012 label file in Dynamics 365 FOEE format for easy movement

I am maintaining an ISV solution across AX 2012 and Dynamics 365 for Finance and Operations, Enterprise Edition, and when there is development in one, porting those changes to the other can be a hassle.

If I create a label in Dynamics AX 2012, exactly creating it in D365 isn't straight forward/simple.

I quickly wrote this simple job to export a label to a format that can be easily imported into Dynamics 365. I simply looked at how D365 label text is stored and inferred this, so I haven't done extensive testing, but it seems to work fine for several hundred labels when comparing via WinMerge what my job outputs vs what D365 contains.


static void AlexOnDaxExportLabelToD365(Args _args)
{  
    #File
    str                         labelFileId         = 'QUA';
    str                         language            = 'en-us';
    Filename                    labelFilenameD365   = @'C:\Temp\AlexLabel.label.txt';
    
    LabelId                     labelId;
    LabelString                 labelString;
    LabelDescription            labelDescription;
    
    Set                         setLabelIds;
    SetEnumerator               se;
    
    SysLabelFileReader          labelFileReader;
    TextIo                      textIo;
    
    SysLabelFile                labelFile = SysLabelFile::newLanguageModule(language, labelFileId);
    
    if (!Label::flush(labelFileId, language))
        throw error(strFmt("Unable to flush label %1 in language %2", labelFileId, language));
    
    new FileIOPermission(labelFilenameD365, 'W').assert();
    
    // This just create the file if it doesn't exist
    textIo = new TextIo(labelFilenameD365, #IO_Write, #utf8Format);
    textIo.write('');
    textIo = null;

    // We output the file somewhere  
    if (labelFile.toFile(labelFilenameD365, true))
    {
        labelFileReader = SysLabelFileReader::newFileClient(labelFilenameD365);

        if (labelFileReader)
        {
            setLabelIds = labelFileReader.labelIds();
        }
    }
    
    if (!(setLabelIds && labelFileReader))
        throw error("Unable to get label");
    
    textIo = new TextIo(labelFilenameD365, #IO_Write, #utf8Format);
    
    se = setLabelIds.getEnumerator();
    
    while (se.moveNext())
    {
        labelId             = se.current();
        labelString         = labelFileReader.labelText(labelId);
        labelDescription    = labelFileReader.labelDescription(labelId);
        
        // There must be a value
        if (!labelString)
            labelString = ' ';
        
        if (labelDescription)
            textIo.write(labelId + '=' + labelString + '\n' + ' ;' + labelDescription);
        else
            textIo.write(labelId + '=' + labelString);
    }
    
    textIo.write(''); // Write ending CR
    textIo = null;
        
    CodeAccessPermission::revertAssert(); 
    
    info(strFmt("Finished converting %1 to Dynamics 365 for Operations label file", labelFilenameD365));
}

59 comments:

  1. The use of different fonts ruins the appearance of the article. The remaining outlook is not too commendable either. The content is not engaging and I wouldn't recommend anyone to visit this page soon.

    ReplyDelete
  2. But it was only recently in conversation with a professional coach friend of mine that the final piece of the explanation as to why this process worked in the jigsaw of communication, and hence successful job application, clicked into place.guarantor

    ReplyDelete
  3. This is not only a minor bit of work. This is beyond all that. This is greatness.
    eCTD

    ReplyDelete
  4. After perusing the blog compositions, an otherworldly connection is made amongst peruser and essayist.
    Resumeyard

    ReplyDelete
  5. Please share more like that. job alert

    ReplyDelete
  6. The website is looking bit flashy and it catches the visitors eyes. Design is pretty simple and a good user friendly interface.
    resume template google docs

    ReplyDelete
  7. This is my first time visit to your blog and I am very interested in the articles that you serve. Provide enough knowledge for me. Thank you for sharing useful and don't forget, keep sharing useful info: Visit Office Rental Singapore

    ReplyDelete
  8. Let create a new world for yourselft by way take part in the games– sims 4 cheatsin my site. Click link to visit site. Thank you so much.

    ReplyDelete
  9. Pretty nice post. I just stumbled upon your weblog and wanted to say that I have really enjoyed browsing your blog posts. After all I’ll be subscribing to your feed and I hope you write again soon! job posting site

    ReplyDelete
  10. Superior post, keep up with this exceptional work. It's nice to know that this topic is being also covered on this web site so cheers for taking the time to discuss this! Thanks again and again! job posting

    ReplyDelete
  11. We have sell some products of different custom boxes.it is very useful and very low price please visits this site thanks and please share this post with your friends. job posting site

    ReplyDelete
  12. Personally, I have found that to remain probably the most fascinating topics when it draws a parallel to. You may find two to three new levels inside L . a . Weight loss and any one someone is incredibly important. Initial stage may be real melting away rrn the body. lose weight Buscar ofertas

    ReplyDelete
  13. Many job boards will rank or prioritize job postings within their database by title, membership status, date, keywords or other less obvious means.What is a cover letter

    ReplyDelete
  14. This article is an appealing wealth of informative data that is interesting and well-written. I commend your hard work on this and thank you for this information. You’ve got what it takes to get attention. buy insta likes

    ReplyDelete
  15. Lamentably, very few clients comprehend or set aside some effort to check what authorizations they award. 먹튀검증

    ReplyDelete
  16. More importantly, when you accept a job offer, accept it for what it is now and act as if this is the best it will ever be. I know of too many people who have accepted a job offer that wasn't a good fit, workplace diversity Singapore often out of extreme circumstances, and then talk themselves into believing it will become better somehow in the future.

    ReplyDelete
  17. The game was genuinely intended for its period: the ball conduct was changed by a few components like gravity, wind speed, position and point of contact, and so on.;https://b-game.net

    ReplyDelete
  18. And living in style, maybe for a few moments, but the charm will create a magic spell, and the meanings of quality living will unfold.
    Bangalore Independent Escorts
    Bangalore Escorts
    Bangalore Escorts
    Bangalore Escorts
    Bangalore Escorts

    ReplyDelete
  19. Ludhiana escorts are educated along with experienced and they Have the propensity to catch the attention of consumers with their sex appeal and glorious bodily structure. That's to say they might be called intriguing, sexy, and alluring.
    Ludhiana escorts
    Dehradun Escorts
    Jodhpur escorts
    Gurgaon Escorts
    Noida Escorts
    Chandigarh Escorts

    ReplyDelete
  20. I am really impressed by your written description and it is well-structured. By following your methods, I can export AX 2012 label file in Dynamics 365 FOEE format so I am really grateful for you to help me with this difficult task. Assignment Writing Services

    ReplyDelete
  21. Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I’ll be subscribing to your feed and I hope you post again soon. I need job fast

    ReplyDelete
  22. Wow, What a Excellent post. I really found this to much informatics. It is what i was searching for.I would like to suggest you that please keep sharing such type of info.Thanks poker88

    ReplyDelete
  23. Wow, What a Excellent post. I really found this to much informatics. It is what i was searching for.I would like to suggest you that please keep sharing such type of info.Thanks Std test

    ReplyDelete
  24. Thanks For sharing this Superb article.I use this Article to show my assignment in college.it is useful For me Great Work. 먹튀검증

    ReplyDelete
  25. In the world of www, there are countless blogs. But believe me, this blog has all the perfection that makes it unique in all. I will be back again and again 먹튀검증

    ReplyDelete
  26. Extremely pleasant article, I appreciated perusing your post, exceptionally decent share, I need to twit this to my adherents. Much appreciated! shipping from china to usa

    ReplyDelete
  27. This is an excellent post I seen thanks to share it. It is really what I wanted to see hope in future you will continue for sharing such a excellent post eyaculacion precoz como combatirla

    ReplyDelete
  28.  I want to have this great information. I love it so much! shipping from china to usa

    ReplyDelete
  29. Very informative post! There is a lot of information here that can help any business get started with a successful social networking campaign. buy website traffic

    ReplyDelete
  30. I like your post. It is good to see you verbalize from the heart and clarity on this important subject can be easily observed... Autoankauf

    ReplyDelete
  31. When you use a genuine service, you will be able to provide instructions, share materials and choose the formatting style. Free website promotion

    ReplyDelete
  32. Very informative post ! There is a lot of information here that can help any business get started with a successful social networking campaign Courtier immobilier chelsea

    ReplyDelete
  33. Great article Lot's of information to Read...Great Man Keep Posting and update to People..Thanks 메이저놀이터

    ReplyDelete
  34. I am so much grateful to have this wonderful information 먹튀검증

    ReplyDelete
  35. Very useful information shared in this article, nicely written! I will be reading your articles and using the informative tips. Looking forward to read such knowledgeable articles 먹튀검증

    ReplyDelete
  36. it's really nice and meanful. it's really cool blog. Linking is very useful thing.you have really helped lots of people who visit blog and provide them usefull information 메이저놀이터

    ReplyDelete
  37. I’m going to read this. I’ll be sure to come back. buy web traffic

    ReplyDelete
  38. Superbly written article, if only all bloggers offered the same content as you, the internet would be a far better place.. 먹튀검증업체

    ReplyDelete
  39. Thank you for the update, very nice site. 먹튀폴리스

    ReplyDelete
  40. Thanks for sharing these informations. I really like your blog post very much. You have really shared a informative and interesting blog post . 먹튀검증

    ReplyDelete
  41. I’m going to read this. I’ll be sure to come back 스포츠토토

    ReplyDelete
  42. Positive site, where did u come up with the information on this posting?I have read a few of the articles on your website now, and I really like your style. Thanks a million and please keep up the effective work. student discounts

    ReplyDelete
  43. I definitely enjoying every little bit of it. It is a great website and nice share. I want to thank you. Good job! You guys do a great blog, and have some great contents. Keep up the good work. 먹튀검증

    ReplyDelete
  44. Positive site, where did u come up with the information on this posting?I have read a few of the articles on your website now, and I really like your style. Thanks a million and please keep up the effective work. Indian Matchmaking

    ReplyDelete
  45. Really unquie place, Thank you so much meant for posting The experience. Fantasticly penned report, anxieties most of folks given similar volume of material as you may, the online market place might be a a lot better put. Be sure to keep it up! 먹튀검증

    ReplyDelete
  46. Will surely come and visit this blog more often. Thanks for sharing. 토토검증사이트

    ReplyDelete
  47. Positive site, where did u come up with the information on this posting? I'm pleased I discovered it though, ill be checking back soon to find out what additional posts you include. alternative small business loans

    ReplyDelete
  48. Listed here you'll learn it is important, them offers the link in an helpful webpage 토토사이트

    ReplyDelete
  49. Udaipur Escorts fulfill your desires give a lot of pleasure
    If you are tired of numerous advice on how and where to Find Udaipur Escorts, right you have come to the right place.We offer class and good Udaipur call Girl services! I will make sure that we both will enjoy our time together!ready to call and meet you for serious relationships !!
    Udaipur Call Girls
    Udaipur Escorts
    Escort Services in Udaipur

    ReplyDelete
  50. This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value of providing a quality resource for free. Mississauga private investigation

    ReplyDelete
  51. Joy is the most crucial thing for you when you need to contact the most elevated level of fulfillment for sex joy purposes.Indore Call Girls are presently moving for better constantly sex moments for your sexual relationship.

    ReplyDelete
  52. All this hot and provocative Escorts in Dwarka won't just edify your temperament yet will assist you with feeling the hotness around you in the room you are available. Also, in a similar treatment, you will be going to have with these Dwarka Escorts.
    Dwarka Escorts | Dwarka Escorts

    ReplyDelete
  53. I read your post and I found this post amazing! thank! 먹튀폴리스

    ReplyDelete
  54. I read your post and I found this post amazing! thank! 먹튀폴리스

    ReplyDelete
  55. Just admiring your work and wondering how you managed this blog so well. It’s so remarkable that I can't afford to not go through this valuable information whenever I surf the internet 토토사이트

    ReplyDelete
  56. You there, this is really good post here. Thanks for taking the time to post such valuable information. Quality content is what always gets the visitors coming. vape attic olathe

    ReplyDelete
  57. I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article. 먹튀검증커뮤니티

    ReplyDelete