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

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Are Memo fields (nvarchar(max)) supported in DMF?

(0) ShareShare
ReportReport
Posted on by

I've been unable to get any Memo fields to work in DMF in R3.  When I try to get staging data for an entity that has a Memo field, the DMF service crashes with a .net runtime exception, providing zero helpful information.  The same entity works fine without the Memo field.

There are demo files from Microsoft for standard entities that have Memo field included, suggesting it might work.  When completing mapping with a memo field, it completes successfully, setting up an entity attribute for the field defined as field type 'VarString', and a field size of -1.  It seems that there is logic trying to account for the memo field.

In the DMF service configuration file, there is a parameter called "Nvarcharmaxcolumnlength", which again seems to imply that this is somehow supported.

I've tried different source file formats, different encodings, SQL traces, playing with the above parameter, changing the entity attribute to String, and am running out of ideas.  Nothing on issue search that seems to match up with this issue.

So, does anyone know conclusively whether this is supported?  Has anyone actually gotten it to work?  If so, are there any tricks I'm missing?

Thanks!

Taylor

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    mongro Profile Picture
    25 on at
    RE: Are Memo fields (nvarchar(max)) supported in DMF?

    I also had a problem with memo fields. I’m importing data from AX3.0 to AX2012 R3 using ODBC. Same situation as you wrote Taylor, when I try to import data to staging tables, DIXF service crashes.

    I have workaround, maybe not much elegant ;-) but it works for me.

    Let’s say, I want to import AssetTable and have a problem with field MaintenanceInfo3 which is a memo field.

    Step 1 First I have to check the maximum length of data in this field in source table. I use SQL query:

    SELECT MAX(DATALENGTH(MAINTENANCEINFO3)) FROM ASSETTABLE

    SQL type of my base field is Text so I use datalength() function. Use len() for nvarchar types.

    Step 2 Every memo field in staging tables that is used in mappings is a “crash generator” so it should be changed to fixed size string. I’m changing every existing memo to string 1000 and duplicating this field as much times as is needed to get all data from source table. In my example max length of data is 1773 so I need two fields MaintenanceInfo3 and MaintenanceInfo3_2 to get all the data..

    Step 3 I need to prepare data to fill these new fields in staging. I use sql statement

    SELECT (…)

    SUBSTRING(ASSETTABLE.MAINTENANCEINFO3, 1, 1000) AS MAINTENANCEINFO3,

    SUBSTRING(ASSETTABLE.MAINTENANCEINFO3, 1001, 1000) AS MAINTENANCEINFO3_2

    (…) FROM ASSETTABLE

    Step 4 Then I use ‘Generate source mapping’ button to update mappings to stage. If field names in staging table and select statement are equal, mapping is added automatically.

    Step 5 Now I can click ‘Get staging data’. The process should end without crash.

    But this is half the battle ;-)

    Step 6 Now I should get all those fields together and put into target memo field. To do this, I write generate* method in *EntityClass. In my example it looks like this:

    [DMFTargetTransformationAttribute(true),DMFTargetTransformationDescAttribute("Function that generates MaintenanceInfo3"),

    DMFTargetTransformationSequenceAttribute(10),

    DMFTargetTransFieldListAttribute([fieldStr(DMFAssetEntity,MaintenanceInfo3), fieldStr(DMFAssetEntity,MaintenanceInfo3_2)])]

    public container generateMaintenanceInfo3(boolean _stagingToTarget = true)

    {

       AssetMaintenanceInfoMemo maintenanceInfo3;

       if (_stagingToTarget)

       {

           maintenanceInfo3 = entity.MaintenanceInfo3;

           if (entity.MaintenanceInfo3_2)

               maintenanceInfo3 += entity.MaintenanceInfo3_2;

       }

       else

       {

           maintenanceInfo3 = target.MaintenanceInfo3;

       }

       return [maintenanceInfo3];

    }

    I also need to modify method getReturnFields() by adding new case

           case methodStr(DMFAssetEntityClass, generateMaintenanceInfo3) :

               con += [fieldstrToTargetXML(fieldStr(AssetTable, MaintenanceInfo3))];

               break;

    Step 7 Now I can recreate target mappings. I go to ‘Target entities’ form, click ‘Modify target mapping’, then ‘Mapping details’ and ‘Generate mapping’. New mapping based on method from previous step should be added.

    Step 8 Get back to processing groups and do “Copy data to target’ action. New records should be created, memo fields should be filled now.

    In very similar way I have managed with array fields (generate* method is a little bit different).

    If anyone have easier way to resolve this issue, please let us know :)

    Monika

  • 5400 Profile Picture
    7,162 on at
    RE: Are Memo fields (nvarchar(max)) supported in DMF?

    Lets take one simple example:

    DMFvendGroupEntity -> make Name field is memo for both staging and target.

    DMFdataTypeMapping -> create one row string as source target as memo

    Now you can proceed for vendor group import /export functionality. Please check it is working or not.

  • Daniel Weichsel Profile Picture
    on at
    RE: Are Memo fields (nvarchar(max)) supported in DMF?

    I think that an XML source file format has worked for me with memo fields before when CSV has failed.

  • Taylor G Profile Picture
    on at
    RE: Are Memo fields (nvarchar(max)) supported in DMF?

    I'm assuming this isn't possible, and will update the memo fields via SQL rather than DMF.  If anyone knows differently, I would be curious as to your experience!

    Thanks!

  • Taylor G Profile Picture
    on at
    RE: Are Memo fields (nvarchar(max)) supported in DMF?

    I don't understand how GUID datatype is related to a string memo field in AX.

    I haven't had any problems with the mapping.  The issue is that the DIXF service crashes when you try to get staging data.

  • Taylor G Profile Picture
    on at
    RE: Are Memo fields (nvarchar(max)) supported in DMF?

    My string memo fields are showing as nvarchar(max) in SQL, not sure why we are seeing something different.

  • Suggested answer
    5400 Profile Picture
    7,162 on at
    RE: Are Memo fields (nvarchar(max)) supported in DMF?

    Memo type data conversion is supporting by DIXF. New data type GUID is added in R3 release.

    Make sure, your staging should have same name memo type field as target table. So it will mapped automatically through target mapping. Also your file column name should be same as staging field name for auto source mapping.

    you can preview the value as well as gets staging also possible. Now you can move to target.

    Hope, you are clear now.

  • Suggested answer
    Bashir Ahmad Profile Picture
    5,248 on at
    RE: Are Memo fields (nvarchar(max)) supported in DMF?

    Memo field in the database - ntext

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…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Syed Haris Shah Profile Picture

Syed Haris Shah 9

#2
Mea_ Profile Picture

Mea_ 4

#3
Martin Dráb Profile Picture

Martin Dráb 2 Most Valuable Professional

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans