What's the suggestion for managing economy data between titles? It looks like most of the APIs for management are only for economy v1, I'm looking to develop a simple way for designers to move all items in a catalog from one title to another
What's the suggestion for managing economy data between titles? It looks like most of the APIs for management are only for economy v1, I'm looking to develop a simple way for designers to move all items in a catalog from one title to another
There isn't a good way to do this right now, but we're working on features to make it easier.
A pseudo-script like this would work.
foreach (itemA in titleA.SearchItems(...))
{
friendlyIdA = itemA.AlternateIds.Get("FriendlyId")
itemB = titleB.GetItem(fiendlyIdA)
if (itemB does not exist)
{
// clear itemA properties like Id and CreatorEntityKey
itemB = titleB.CreatDraftItem(itemA)
}
else
{
// update itemA properties like Id and CreatorEntityKey with values from itemB
itemB = titleB.UpdateDraftItem(itemA)
}
titleB.PublishDraftItem(itemB.Id) // use GetItemPublishStatus to check for publishing errors
}
48 People are following this question.