Delete an object.

Is it possible to delete an object in navision using codes. how. can i have sample codes to do this?

Thanx in advance

Festus

Yes you can, but the code depends on the object type. For example, this code deletes the form 87900:

Object.GET(Object.Type::Form,’’,87900);
Object.DELETE;

where Object is a record variable that references the Object table.

Marco

Just for testing purpose create 2 codeunits with Name Test1 & Test2

In Test1 Codeunit Create Global Variable

Name DataType Subtype Length
Object Record Object

write this code on On run function
Object.GET(Object.Type::Codeunit,’’,CODEUNIT::Test2);
Object.DELETE(TRUE);

Complie & run codeunit test1 …it will delete codeunit object with Name Test2.

hope it helps you

Remember that the licence and user and object must have permissions to delete in the Object table.

You can / must set the permissions for this to work.