Sign In Register

How can we help you today?

Start a new topic
Answered

Live ops Sales Tutorial

I followed the Sales tutorial here https://docs2.gamesparks.com/tutorials/live-game-operations/live-ops-for-weekly-events.html but Im having issues to save events, whenever I click save it doesnt close the modal and in the background it replace the sale list for the sales edit screen I assume its doing this because in the tutorial the Save function only returns the form and is not updating anything.


The tutorial says this:

 

Now that our action is set to save, when we click on the save button, we can run the code in the save() function. Here we'll use the update() function of mongoDB so that we can edit our existing Events, and we'll use the upsert functionality so that if the Event doesn’t exist (that is, we're creating a new one), we can insert a new Event into the sales_events collection.

 But at the beginning made me create a metadata collection which is read only should not we be using runtime collection?


The save function in the tutorial is completely empty and the form is expecting form.update set to true.


I guess you guys needs to fix this tutorial or its something I missing?


Best Answer

Thanks for pointing that out. We've had the change to the documentation and the new doc should be pushed live by the end of the day.

Thanks,
Sean


Ok so I finally finished this up using a runtime collection, also had some troubles with saving the dates, this tutorial needs to be fix.

Hi Hjupter,


I'll pass your findings on to the author of the example for review. For clarification meta collections can only be written to in preview. They are read only on Live.


Regards,

Liam

I guess I missed that part in the documentations about meta collections. So how can I save/update a meta collection using the regular update/save methods?

Ok, when I started re-creating the tutorial I tried using update function on a meta collection and I was getting an error and since there was no suggestion for update method in the meta collection I thought that was the problem, its a bit confusing tho if we can save or update a meta collection the methods should appear in the cloud editor suggestion.

Answer

Thanks for pointing that out. We've had the change to the documentation and the new doc should be pushed live by the end of the day.

Thanks,
Sean

Login to post a comment