I'm staging a custom table that acts as an XREF table using Media File and Tree Node IDs.
I followed the documentation using TranslationHelper.RegisterRecord and TranslationHelper.TranslateColumn but it's not clear what to use for the CodeName value for these types when registering for translation.
MediaFileInfo.TYPEINFO.CodeNameColumn and TreeNode.TYPEINFO.CodeNameColumn are both null so I'm not sure how it's supposed to look up the records on the target to do the translation.
Quick and dirty sample code I'm talking about (inside ColumnsTranslationEvents.RegisterRecords.Execute handler):
// Media file info
int fileID = ValidationHelper.GetInteger(e.Data.GetValue("FileID"), 0);
var info = MediaFileInfoProvider.GetMediaFileInfo(fileID);
var codeName = info.GetStringValue(MediaFileInfo.TYPEINFO.CodeNameColumn, string.Empty);
e.TranslationHelper.RegisterRecord(PredefinedObjectType.MEDIAFILE, fileID, codeName, 0);
In case you've staged all documents and media files use GUID's for both. You have to use anything that is equal on both sides and unique.
It was my understanding it depended on the CodeNameColumn specifically to do the lookup on the target using TranslationHelper.TranslateColumn but we can try to work with the GUID.
Please, sign in to be able to submit a new answer.