Forum Discussion

chrisb's avatar
chrisb
Regular Contributor
10 years ago
Solved

Save method overwrites an object saved to stores

I am using the save method to save one property of an object to the project stores.  dir = "C:\\testing\\WIP\\Stores\\Objects\\"+dirName;  Objects.Save(fieldContent, hashIndex,"Text","","Tru...
  • sbkeenan's avatar
    10 years ago
    Hi Chris



    An interesting problem and one for which I may be completely wrong, but have you tried looking in the two different file locations using Explorer to see if there are 2 physically different files?



    This in itself will not directly answer your query, but I think that the problem might lie in how the Objects.Save feature works.  Is it that this is a collection of objects in the store, each of which must be unique and the fact that you have specified different directory paths is irrelevant because these are just values of a key, being the object's name, which is the same in both cases, For example, if the key is 'A' and one of its values is 'C:/myDir/myFile' and I create another key 'A' with a value 'C:/yourDir/yourFile', there will still only be one object in the collection with key A (the object's name), but its values, in this case the directory location have changed.  If you want to have two objects in the collection you will need to have unique names for each.



    I would be interested to hear if my understanding of this is correct?



    Regards

    Stephen.