AutoNumber field and result from web service call

3
Hello all, let me briely describe my problem with autoNumber field and mapping result back in XML Schema to metaobject model. I have an object with an Autonumber column (Id) and another text column that I want to update via a web service call, Web service itself only modifes text column and returns it along with original id. When Id is type of integer, I can use it for mapping back to metaobject in mapping and use it as a key for searching for existing object. However when I change type of Id column to AutoNumber, I can no longer use that in mapping and therefor as a key for search for existing object. Is there a simpler solution, other than creating other attribute that will act as "hidden" id that will be used for mapping purpose? Thank you for your time. Kind regards, Jakub
asked
2 answers
2

Mapping the attribute to the autonumber field will automatically set the attribute to the int from the webservice, which, as you guessed, shouldn't be possible.

In other words, no, as far as I know there isn't a neat way to do it, other than the suggestion you proposed, namely to use another attribute and use that to find the right object.

I know some projects actually prefer this, and create a type of "log" object which all XML data is mapped to, and they then use to find the correct metaobjects. These log objects are only used for that purpose.

answered
3

Not tested, but I think this will work:

You could try passing the ID as a parameter to a custom object handler microflow in the mapping, and in that microflow retrieve the object with the given ID. This has the same behaviour as when using the "find" object handling in a mapping, but doesn't require actually mapping the ID field, which makes it possible to use the AutoNumber type for your Id attribute.

answered