The OnBeforeEvaluateField

PassHopePassHope Member Posts: 25
I have found several question regarding Dataport import. One is if a description filed has 80 char in file, but only 50 char in table. You have to write code so that only the 50 first char are imported.

I tried to do that in the OnAfterImportRecord. That did not work, and in OnBeforeImport it doesn't have any data to handle.

I found out in the C/SIDE help that in OnBeforeEvaluateField data is imported but not evaluated. It is listed under Triggers in the help file.

My problem is that I can not find this. It is not in the trigger list of the c/al editor.

Does anyone know where to find this or activate it?

Comments

  • kinekine Member Posts: 12,562
    Open the dataport into designer, go to the dataitem, - View - dataport fields, go to the problematic dataport field, F9 - there are the triggers... ;-)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • PassHopePassHope Member Posts: 25
    Thank you very much.

    I'll start checking it out....

    It works fine, just remember to use the VAR Text variable.

    IF STRLEN(Text) > 50 THEN
    Text := CopyStr(Text,1,50);
    
Sign In or Register to comment.