How to get an handle of the last object

Hello,

I want to get an handle of last object in the current module and i want to create a new objects below that.
Kindly help me.

Thanks

Regards,
Shruthi
Bosch - Wed Sep 28 07:45:54 EDT 2011

Re: How to get an handle of the last object
SystemAdmin - Wed Sep 28 08:40:45 EDT 2011

Load Standard view or switch off filtering, sorting, outlining etc. to be sure all non-deleted objects are in view. After that use the "last" function
 

Object lasto = last(current Module)

Re: How to get an handle of the last object
Peter_Albert - Wed Sep 28 08:44:19 EDT 2011

It's a bit hidden in the DXL manual (but then, what is not hidden in the DXL maunal ...) but you find it in the "Navigation from an object" section:

Object last(Module m)

Note that this returns the last object as it appears in the displayed module, hence you have to check for filters and the display of delete objects. Object creation is covered in the "Object management" section, the perm you want to use is

Object create(below(Object o))


The rudimentary code hence is

create below last current Module

but you should check that current Module is not null, that you have edit right, that the last object is not deleted, etc ...

Regards,

Peter