cancel
Showing results for 
Search instead for 
Did you mean: 

Skip list screen and go directly to detail screen

m_vandoremalen2
Explorer
0 Kudos

A lot of times I don't need the list screen, because only one item is available.

Now I would like to skip the list screen and go to the detailscreen.

I thought to use the api navigateForward(toScreen, listViewKey) for this, but in which method do I have to put this api in the custom.js file and how can I declare that the first row should be displayed in the detail screen.

An example would be appreciated.

Marcel

Accepted Solutions (0)

Answers (1)

Answers (1)

david_brandow
Contributor
0 Kudos

You could add in something like the following pseudo-code into customBeforeNavigateForward:

if (destScreenKey === "MyListviewScreen")

{

var mvc = getCurrentMessageValueCollection();

var data = mvc.getData("MyListviewKey");

if (data.getValue().length == 0)

{

navigateForward("MyListviewDetailsScreen", data.getValue()[0].getKey());

return false;

}

}

return true;

I haven't tested this, but the principle should be sound.