How to use getid() method to get id?

In the system the "Id", and "config-id" are the item name. For Document item, the id is the document name(screenshot below).  I need the id property, the one that is unique, to be added to the properties of Document item. 

I have this method but it doesn't work:
Item myItem = this.newItem("Document");
myItem.setID(this.getID());
Item results = myItem.apply();

Error is "Error Number: CS0161, 'ItemMethod.methodCode()': not all code paths return a value"

Also, once I have this method working what are the next steps. I guess I will have to add this method to the Server Events, event onBeforeGet, correct?

Any help is appriciated. 

Thanks!

Parents Reply Children
No Data