How-to: Reset Object Properties After Importing a UI Translation (NAV 2013)

Recently I had to make sure that captions for both ENU and NLD were present throughout our solution. A job I have being doing many times over the past years and wrote some post about (you will find some here).

One of the last tasks in this process deals with resetting object properties after importing the UI translation back into our objects. To help you with this task the ObjectTime tool, a simple dataport, has been there for ages. But to my dismay MS has not made available a successor to that for NAV 2013. (Note that the MSDN article How to: Add Translated Strings By Importing and Exporting Multilanguage Files as such is incomplete as it does not tackle the issue of resetting object properties!)

So now we all are going to have to built this tool ourselves which isn’t much of a deal, but it would have saved us all some time if would have been there where it used to be: in the UpgradeToolkit directory on the product DVD. As I have built it I just might share it with you. You can download it from here. O no, sorry, I cannot upload it to my blog site (some technical reasons I guess). I’ll give you the text export here. Copy it and paste it into a .txt file and import that into NAV:

OBJECT XMLport 50000 Import/Export Object Time
{
  OBJECT-PROPERTIES
  {
    Date=18-01-13;
    Time=12:00:00;
    Version List=FLUX7.00.00;
  }
  PROPERTIES
  {
  }
  ELEMENTS
  {
    { [{2492F691-EBD4-4458-85FA-1BC05190649C}];  ;Root                ;Element ;Text     }
    { [{7DB14DEB-6C04-45DC-BC02-A64A6A35BBBD}];1 ;Object              ;Element ;Table   ;
                                                  SourceTable=Table2000000001;
                                                  SourceTableView=WHERE(Field1=FILTER(<>0));
                                                  AutoSave=No;
                                                  MinOccurs=Zero;
                                                  Import::OnBeforeInsertRecord=VAR
                                                                                 Object2@1000 : Record 2000000001;
                                                                               BEGIN
                                                                                 Object2 := Object;
                                                                                 IF Object2.FIND THEN BEGIN
                                                                                   Object2.Modified := Object.Modified;
                                                                                   Object2.Date := Object.Date;
                                                                                   Object2.Time := Object.Time;
                                                                                   Object2.MODIFY;
                                                                                 END;
                                                                               END;
                                                                                }
    { [{7ED90C76-8887-4264-810F-88E2814BB9DA}];2 ;Type                ;Attribute;Field  ;
                                                  DataType=Option;
                                                  SourceField=Object::Type }
    { [{F41BE766-5033-4069-9F81-E630067F2418}];2 ;ID                  ;Attribute;Field  ;
                                                  DataType=Integer;
                                                  SourceField=Object::ID }
    { [{5E744795-A0C7-4099-8C9E-1ED33F93061E}];2 ;Modified            ;Attribute;Field  ;
                                                  DataType=Boolean;
                                                  SourceField=Object::Modified }
    { [{21BC614A-AE81-4719-80A2-D3CCC94C9C1B}];2 ;Date                ;Attribute;Field  ;
                                                  DataType=Date;
                                                  SourceField=Object::Date }
    { [{C9B3B80F-2345-4AAA-ADC5-FF2B8785ED2C}];2 ;Time                ;Attribute;Field  ;
                                                  DataType=Time;
                                                  SourceField=Object::Time }
  }
  EVENTS
  {
  }
  REQUESTPAGE
  {
    PROPERTIES
    {
    }
    CONTROLS
    {
    }
  }
  CODE
  {
    BEGIN
    {
      +—————————————————————————————————————————+
      |Copyright (C) by fluxxus.nl. All rights reserved.                                                                          |
      +—————————————————————————————————————————+
      |Change | Date   |Developer |Bug Rep No.      |Description                                                         |Version |
      |——-+——–+———-+—————–+——————————————————————–+——–|
      |FLX0001|18-01-13|lvanvugt  |                 |Created object based on former MS dataport 104010                   |07.00.00|
      |       |        |          |                 |(Import/Export Object Time)                                         |        |
      |       |        |          |                 |Thanx to Marco de Vries (Imtech) and Gert Robyns (MSFT)             |        |
      +—————————————————————————————————————————+
    }
    END.
  }
}

Thanx to …

… Marco de Vries (Imtech) & Gert Robyns (MSFT) as I bumped into (and let me not be stopped by) some stupidities. [B]

One Comment

  1. Hi Thomas,

    Thanx for your comment. But are you sure?

    In my knowledge this was also there in NAV 2009. Maybe you recall the discussion I had with Mark Brummel, where he posted a comment on a similar blog post I wrote 2 years ago (and to which I implicitely refer above). It appeared that he was talking about the import of a Language Module, where I was talking about the Translate > Import. These are two different things.

    Now again I am talking about the Translate > Import. Are you too?

    b rg

    Luc

Leave a Reply

Your email address will not be published. Required fields are marked *