You could consider simply using an autonumber attribute. This type of attribute increments automatically at database level.
as lennart spaans said you should add autonumber attributes in your entity like this
for your knowledge it will increase every time you create an object from this entity so you should make unpersistable entity with the same attibutes to pass the information and only create an object from the main entity on commit
Kaiyan Ali
to delete an object from a list view you can use the default delete button like this
as for edit
that depend on how many entities in your form if one you could use the default openpage button to pass the current object to newedit form
if more than 1 entity you should pass an object of the main entity and its associated object
this a screen from my domain model to make it clear for you
and in the end i recommend you to watch this learning path
https://academy.mendix.com/link/path/31/Become-a-Rapid-Developer
i think it would help you to have a solid understanding of mendix basics