How to refer to items in a value list by their 'Name'

Hi, I've got some code in a workflow where depending on one source property, we're setting another destination property 'Type'

'Type' is a value list which contains:

Programme, ID = 1

Project, ID = 2

etc

Previously I was doing that via just setting the ID number. I know that Project is ID=2 in the Type value list, so I have that ID number hard coded in the script

However, the vault is due to be deployed to production via content replication rather than transferring an .MFB so we've been told that all ID number references should be avoided and everything needs to use aliases instead, as the ID numbers may get shuffled around in the transition and won't stay in the same order

 

So, How can I avoid using the ID? I know the value in the source property will be 'Project', so do I have to construct a search to find the item within the value list that matches, then I can get the (new) ID number, and use that ID as previously? or is there some better approach

Many thanks

Parents Reply Children
  • I don't think that makes one bit of difference.

    That said: if you have a local M-Files vault with the exact list you want to use, you could create a replication package containing just that list and its values, export it, and then import it into a blank vault for testing.  That's exactly what I did, but you could test it with your exact structure if you have concerns.

    Edit: having read the response from , then having re-read your post, I realise that I misread it.  As he said said: the IDs happen to be the same in this case, but may not be in yours.  You need to assume that they will be different even though in some cases - especially when replicating into a blank vault - they may happen to end up the same.

  • The ID numbers will change in replication if someone manually adds an item in the receiving vault. This new item will automatically take the next ID available. This ID will then be taken when replication pulls in a new item from the external vault, and the incoming item will have to change ID to the next available number.