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 :
Dynamics 365 Community / Forums / Finance forum / How to insert enum val...
Finance forum

How to insert enum values in table when importing value from excel using x++ in d365

(0) ShareShare
ReportReport
Posted on by 950

Hi all,

i have a field in excel which contains some value, i am importing that excel into my form(table) using x++. but those values aren't inserting into the field which is an enum field in the table. ! i tried like below but it is not inserting into the table when imported.

table.field = range.get_Item(i, 1).value);

reference link which i follwed for importing from excell

https://dynamicsaxgyan.wordpress.com/2017/04/04/read-from-excel-using-x-code-ax7-d365-for-operations/

any suggestions pls. 

thanks in advance

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    301,035 Super User 2025 Season 2 on at

    Hi Test Bot,

    Why are you using custom x++ for importing Excel data if you can use Data management features, Microsoft Flow or LogicApps to import Excel files?

  • Verified answer
    Sukrut Parab Profile Picture
    71,710 Moderator on at

    Enum fields need to be handled differently when you import though the code , for example

    sk_excel.Enum               =       str2enum(NoYes,cells.item(row,9).value().bstr());

    However , question still remains is , do you need to do that at all, when out of the box features are available which does everything for you ? Some of them are already suggested to you by Andre.

  • TestBot Profile Picture
    950 on at

    Dear Sukrut,

    A slight modiication in the syntax for D365, worked for me.

    NOYES myEnum;

    sk_excel.Enum  = str2Enum(myenum, cells.get_Item(i,107).value);

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Finance

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans