Welcome!

This community is for professionals and enthusiasts of our products and services.Share and discuss the best content and new marketing ideas,build your professional profile and become a better marketer together.

Register
0

How can I translate an external ID into the corresponding database ID in an XML record?

By
Diogo Duarte
on 11/4/15, 10:06 PM632 views

How can I translate an external ID into the corresponding database ID in an XML record?


0
Diogo Duarte
On11/4/15, 10:11 PM

You can use the ref attribute to translate an external ID into the corresponding database ID for a many-to-one relation field like "<field name="field_name" ref="module_name.external_record_id"/>".

For a one-to-many or many-to-many relation field, a list of IDs is expected, so a different syntax is needed like "<field name="field_name" eval="[(4, [ids])]"/>".

In the last case we use a list of triples, each triple is a write command that does different things according to the code used: "(0,0,{values})" link to a new record that needs to be created with the given values dictionary; "(1,ID,{values})" update the linked record with id=ID; "(2,ID)" remove and delete the linked record with id=ID; "(3,ID)" delete the relationship on the linked record with id=ID; "(4,ID)" adds a relationship to existing record with id=ID; "(5)" unlink all; "(6,0,[IDs])" replace the list of linked IDs.


Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, justuse the commenting tool. Please remember that you can alwaysrevise your answers - no need to answer the same question twice. Also, pleasedon't forget to vote - it really helps to select the best questions and answers!

Keep Informed

About This Community

This community is for professionals and enthusiasts of our products and services.Share and discuss the best content and new marketing ideas,build your professional profile and become a better marketer together.

Read Guidelines

Question tools

2 follower(s)

Stats

Asked: 11/4/15, 10:06 PM
Seen: 632 times
Last updated: 11/4/15, 10:12 PM