Delete object in Import Worksheet

gmagma Member Posts: 17
edited 2007-08-24 in NAV Tips & Tricks
Does anyone know how to create a "killer object" with size 0 and to use that object to delete objects in database with import worksheet?
Thanks
gma

Comments

  • krikikriki Member, Moderator Posts: 9,094
    If you want to delete objects, you can just delete them from the object designer. I hope this ansers you question, because I didn't understand exactly what you wanted.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • DenSterDenSter Member Posts: 8,304
    :shock: what? A killer object? Where did you get that idea?
  • gmagma Member Posts: 17
    I know that I can delete the object directly in the object designer but if I want to delete the same object in different databases I have to repeat the same delicate operation.
    If you see at the help you see that It's possible to use the delete option using a killer object of size 0.
    I don't know how to create an object of size 0.
  • gjgarciasmgjgarciasm Member Posts: 47
    Hi,

    I need create a killer object also but I don´t how to do it. ](*,)

    Does anybody know anything about this topic?

    Please, it is very important for me.

    Thank you.
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    gma wrote:
    If you see at the help you see that It's possible to use the delete option using a killer object of size 0.
    Please show us the relevant help text.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • DenSterDenSter Member Posts: 8,304
    Open the C/SIDE reference guide and search for the word 'killer', which will display the help text for the import worksheet :) I have no idea how you would create such a killer object.
  • Alex_ChowAlex_Chow Member Posts: 5,063
    DenSter wrote:
    Open the C/SIDE reference guide and search for the word 'killer', which will display the help text for the import worksheet :) I have no idea how you would create such a killer object.

    Holy crap... 8 years of Navision experience and this is the first time I know about tihs.
  • matteo_montanarimatteo_montanari Member Posts: 189
    deadlizard wrote:
    DenSter wrote:
    Open the C/SIDE reference guide and search for the word 'killer', which will display the help text for the import worksheet :) I have no idea how you would create such a killer object.

    Holy crap... 8 years of Navision experience and this is the first time I know about tihs.
    OBJECT Codeunit 50000 Killer Form Creator
    {
      OBJECT-PROPERTIES
      {
        Date=13/09/06;
        Time=[ 1.36.03];
        Modified=Yes;
        Version List=;
      }
      PROPERTIES
      {
        OnRun=BEGIN
                Object.Type := Object.Type::Form;
                Object.ID := 50000;
                Object.Name := 'Killer Form';
                Object.INSERT;
              END;
    
      }
      CODE
      {
        VAR
          Object@1000000000 : Record 2000000001;
    
        BEGIN
        END.
      }
    }
    

    Import this code as a text file object in a cronus database
    Compile Codeunit 50000 and run.
    Search Form 50000 and save as a FOB
    Delete Form 50000
    Create a simple form 50000
    Import your FOB

    :D

    Matteo
    Reno Sistemi Navision Developer
  • ta5ta5 Member Posts: 1,164
    Hi Matteo
    I still dont understand. :oops:
    What happens?

    Thomas
  • matteo_montanarimatteo_montanari Member Posts: 189
    ta5 wrote:
    Hi Matteo
    I still dont understand. :oops:
    What happens?

    Thomas

    When you import the fob with a 0 size object, Import Worksheet suggest "Delete" instead of "Replace" the existing object.

    My example show how to create a 0 sized object.

    Matteo
    Reno Sistemi Navision Developer
  • wakestarwakestar Member Posts: 207
    Very interesting

    ... but it would be more useful to know how to delete objects which are not in the license :roll:
  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    wakestar wrote:
    ... but it would be more useful to know how to delete objects which are not in the license :roll:

    Why do you want that? Are they in your way?
  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    Eto wrote:
    When you import the fob with a 0 size object, Import Worksheet suggest "Delete" instead of "Replace" the existing object.

    My example show how to create a 0 sized object.

    Matteo

    Good tip! I did not now that.

    It should be in the Tips and Tricks selection.
  • wakestarwakestar Member Posts: 207
    wakestar wrote:
    ... but it would be more useful to know how to delete objects which are not in the license :roll:

    Why do you want that? Are they in your way?

    YES, they are

    We wrote our own tools for exporting navision objects automatically (for different purposes). It works very well, except when there is an object which is not in the license....
  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    Do you mean custom objects or standard NAV objects?

    You cannot delete all standard NAV objects that are not in the license. This wil cause compile errors all over the database.

    BTW, your tool sounds intersesting! How have you done this? Care to share the solution?
  • wakestarwakestar Member Posts: 207
    Custom Objects... not Standard NAV Objects :)

    It is all done with SENDKEYS... of course the user has to follow some "rules" like not changing the order of the fields in the object designer, because the tool automatically sets the filters.
  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    OK, I understand.

    Isn't it possible to check the License Permission table in your routine? This way you might avoid to touch object that are not in the license.
  • wakestarwakestar Member Posts: 207
    theoretically yes,

    but because it is an external application (VB) which 'commands' the client, it is not that easy to read the table in navision. And at the end it is an 'In-house' Application... what means that nobody wants to pay for it :mrgreen:
  • gjgarciasmgjgarciasm Member Posts: 47
    Eto wrote:

    ...

    Import this code as a text file object in a cronus database
    Compile Codeunit 50000 and run.
    Search Form 50000 and save as a FOB
    Delete Form 50000
    Create a simple form 50000
    Import your FOB

    :D

    Matteo

    Thank you!!! :D

    It works. It is perfect.
  • Alex_ChowAlex_Chow Member Posts: 5,063
    Eto wrote:
    When you import the fob with a 0 size object, Import Worksheet suggest "Delete" instead of "Replace" the existing object.

    My example show how to create a 0 sized object.

    Matteo

    Good tip! I did not now that.

    It should be in the Tips and Tricks selection.

    :?: What would be a practical use of a 0 size object?
  • gmagma Member Posts: 17
    The solution shown by Eto works very well.
    Thanks
    Giuseppe
  • G-RajG-Raj Member Posts: 1
    Another way for this...

    Export the object as .txt.
    Delete every thing inside it except the start and the end brace.
    Import the txt file. The object will get deleted automatically and will not even for a confirmation.

    \:D/
    Regards,
    G-Raj
  • PhennoPhenno Member Posts: 630
    G-Raj wrote:
    Another way for this...

    Export the object as .txt.
    Delete every thing inside it except the start and the end brace.
    Import the txt file. The object will get deleted automatically and will not even for a confirmation.

    \:D/


    This is nice... why this thread is not in tips&tricks?
  • krikikriki Member, Moderator Posts: 9,094
    Phenno wrote:
    This is nice... why this thread is not in tips&tricks?
    I was waiting for someone to to note it :mrgreen:
    BTW : in case you find some other topic in a wrong forum, you can use the report function (the red ! on the right of the post) of the forum.

    [Topic moved from Navision forum to Navision Tips & Tricks forum]
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • vytjakvytjak Member Posts: 36
    Eto wrote:
    deadlizard wrote:
    DenSter wrote:
    BEGIN
      Object.Type := Object.Type::Form;
      Object.ID := 50000;
      Object.Name := 'Killer Form';
      Object.INSERT;
    END;
    

    Alternatively, it can be done by browsing to the end of the list of the required type in the object designer until you are on a new record. Enter an ID and a name, and you will have created a 0 size object, which can be exported and which will default to the "Delete" option in the import worksheet while importing.

    Note though: as far as I remember, despite being described in the manual, attempts to import/export such ojects used to crash Navision in the earlier versions.
    Vytenis Jakas
    B3 Technologies - Making Technology Serve the People
Sign In or Register to comment.