Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
In previous version there was App.GetSnapshot(id). In newer version App.GetSnapshot(id) has been deprecated
I tried to get snapshot layout in different ways but none of them worked. I get either null or null reference exception
like:
var genericObjects = await app.GetAllInfosAsync();
foreach (var info in genericObjects)
{
if (info.Type == "snapshot")
{
var sn1 = app.GetGenericObject(info.Id); //returns null
var sn2 = app.GetObjectAsync<GenericObject>(info.Id);
if(sn1 != null) //or sn2
{
var layout1 = await snt1.GetLayoutAsync();
var json = layout.PrintStructure();
}
}
}
If I remember correctly, snapshots are stored as bookmarks, not generic objects. So try this:
var sn1 = app.GetGenericBookmark(info.Id);