question

teemosoft avatar image
teemosoft asked

UpdateCatalogItems Issue

last post is currently awaiting moderation. So I post again T.T

Every I try to update Catalog Items.

I Can See

/Admin/UpdateCatalogItems PlayFabError(InvalidItemProperties, Unknown item '' as container key of item 'itemName'.

Always need Container Key ID.

when I get Catalogitems and Update that without edit . then it works

but something I change that request need container key(even that already container item)

Is it right I can't update catalog without 'container key'??

Thank you.

+

I remove

public CatalogItemContainerInfo Container;

in CatalogItem Class

Then update catalogitems works.

I think that requset has problem(can't update with container key null)

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
JayZuo avatar image
JayZuo answered

Container is not necessary for UpdateCatalogItems as you can see in CatalogItem, there is no required flag after Container.

For example, if you want to add a catalog item into your default catalog, you can use some code like the following (Using Unity SDK for demonstrating):

PlayFabAdminAPI.UpdateCatalogItems(new PlayFab.AdminModels.UpdateCatalogItemsRequest
{
    Catalog = new System.Collections.Generic.List<PlayFab.AdminModels.CatalogItem> {
        new PlayFab.AdminModels.CatalogItem { ItemId="Test", DisplayName = "Just for test" },
    }
}, (result) => { Debug.Log("UpdateCatalogItems succeed"); },
(error) => { Debug.LogError(error.GenerateErrorReport()); });

With above code you should be able to add a new item with no error.

If you still have this issue, please share TitleId and the complete code where you encountered errors so that we can help you troubleshooting it.


2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

teemosoft avatar image teemosoft commented ·

Thank you for your answer.

But what I'm saying is updatecatalogitems with public list<catalogitem>

So just I remove public string KeyItemId; in container in class.

Thank you.

0 Likes 0 ·
geriko avatar image geriko commented ·

necroing. Basically this is a 2 years old problem and still the same. TeemoSoft, thank you for your solution you saved my work!

Jay Zuo, the problem is if we would like to create a tool for ourself to handle our items inside Unity (because we have to do it anyway...) a clean and great solution to create a tool that sync your items with Playfab. I'm working on a designer friendly tool and this bug came up. Temporarily commenting out public string KeyItemId; in container in class is working but it is a bug.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.