You can use an own “Number range”. For the first use set the cursor where you want the ID and goto Insert > Fields > Other and then tab Variables. In the section Type select item “Number range”. In the section Name overwrite the content with your own identifier, e.g. ID. Click button Insert. Close. You should see a 1 in the document.
Move cursor to the next place which should get the next number. Again goto Insert > Fields > Others > Variables. Click on Type “Number range”. Now you should see your identifier ID in the section Select. Click it. Insert. Close. Another way to input the next number is to mark an existing one and copy&paste it to the target place.
To set a reference to such number goto Insert > Fields > Others and then tab Cross-Referencies. Click on ID in section Type. The right list shows all existing numbers in their paragraphs. To insert only the number itself as reference, use item Numbering in the section ‘Insert reference to’. In this section the wording “category” means the text of the paragraph, which is before the number, and the wording “Caption text” means the text of the paragraph, which is behind the number. But there is a short coming: You can only reference one number per paragraph.
If you need to reference two different numbers from the same paragraph, you can do this by defining bookmarks. Mark the number and then Insert > Bookmark. Give it a text, that you can identify the spot easily. Same for the second number. To reference such bookmark goto Insert > Fields > Others and then tab Cross-Referencies. But now click on Bookmarks in section Type and select item “Reference” in section ‘Insert reference to’ to get the marked number. Here too the numbers adapt themselves, when the underlying ID changes.