Getting info from .fob-file

jensthomsenjensthomsen Member Posts: 173
Hi
Is there any easy way of getting information of the content of an .for-file? That is: I have a fob file, and I want to be able to save the information of object types/ID in a table inside Navision? Is it possible to make a copy of table where info is shown when choosing 'Import'???
Jens

Comments

  • krikikriki Member, Moderator Posts: 9,118
    You can open the fob file with a text editor. The first part is pure text. So you can open it and read the data and save it in Navision.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • SPost29SPost29 Member Posts: 148
    This is core section a dataport from the object manager (on this site for download) It parses through the header of a fob and inserts it in a table.
    Where you see the assignments in the On after import just craet a table with these fields.
    And this should load that table
    A friend of mine Eric in Ann Arbor created the parsing loop.

    You would need to add XML ports and Menusuites to the option types

    Download the Object Manager to see the whole dataport, table,launch point, etc.
    Hope this helps
    Steve

    Object File Compare - OnBeforeImportRecord()
    CLEAR(gteTypeIn);
    CLEAR(gteObjectIDIn);
    CLEAR(gteRestofLine);
    CLEAR(gdaDate);
    CLEAR(gtiTime);

    Object File Compare - OnAfterImportRecord()
    IF (gteTypeIn <> 'Table') AND
    (gteTypeIn <> 'Form') AND
    (gteTypeIn <> 'Report') AND
    (gteTypeIn <> 'Dataport') AND
    (gteTypeIn <> 'Codeunit')
    THEN
    ginSwitch := 0
    ELSE
    ginSwitch := 1;


    IF ginSwitch = 1 THEN BEGIN
    gteHoldType := gteTypeIn;
    gteHoldObjectID := gteObjectIDIn;
    gteHoldName := COPYSTR(gteRestofLine,1,30);
    gteHoldDate := COPYSTR(gteRestofLine,35,8);
    gteHoldTime := COPYSTR(gteRestofLine,47,11);
    END ELSE BEGIN
    IF gteHoldType <> '' THEN BEGIN
    WITH ObjectModified DO BEGIN
    INIT;
    ginLineNo := ginLineNo + 1;
    "Line No." := ginLineNo;
    "Imported by" := USERID; // added as test
    INSERT;
    CASE gteHoldType OF
    'Table' : "Object Type" := "Object Type"::Table;
    'Form' : "Object Type" := "Object Type"::Form;
    'Report' : "Object Type" := "Object Type"::Report;
    'Dataport' : "Object Type" := "Object Type"::Dataport;
    'Codeunit' : "Object Type" := "Object Type"::Codeunit;
    END;
    EVALUATE(gdeObjectID,gteHoldObjectID);
    "Object ID" := gdeObjectID;
    Name := gteHoldName;
    IF DDMMYY THEN BEGIN
    gteDay := COPYSTR(gteHoldDate,1,2);
    gteMonth := COPYSTR(gteHoldDate,4,2);
    gteYear := COPYSTR(gteHoldDate,7,2);
    gteHoldDate := gteMonth +'/'+ gteDay +'/'+ gteYear;
    END;

    EVALUATE(gdaDate,gteHoldDate);
    EVALUATE(gtiTime,gteHoldTime);
    Date := gdaDate;
    Time := gtiTime;
    "Version List" := gteRestofLine;
    "Object File Name" := gteFileName;
    "Date Imported" := TODAY;
    "Imported by" := USERID;
    "Project Type" := greObject."Project Type";
    "Action Taken" := "Action Taken"::Unknown;
    "Import Type" := "Import Type"::FOB;
    MODIFY;

    CLEAR(gteHoldType);
    CLEAR(gteHoldName);
    CLEAR(gteHoldObjectID);
    CLEAR(gteHoldDate);
    CLEAR(gteHoldTime);
    END;
    END;
    END;
  • SPost29SPost29 Member Posts: 148
    These are the dataport fields used on import of a fob
    Steve

    Enabled SourceExpr StartPos Width
    Yes gteTypeIn 1 8
    Yes gteObjectIDIn 9 12
    Yes gteRestofLine 22 57
Sign In or Register to comment.