So I discovered a couple of things playing with opening a UX in a dynamic panelcard when in a panelnavigator and setting the alias as well as the title of the tab band.
First of all if you watch the example video https://www.youtube.com/watch?v=YKE3-VKpcvU you will see them use the customer ID to generate a unique alias. If you use an actual table id that is auto-increment meaning a number it will likely fail because the javascript generated by AS converts it to uppercase and there isn't an uppercase for a number...the example uses the northwind DB which if you watch is all character strings.
Secondly, if you use the customers full name for the PANE title and for some reason you have a NULL value you will get a weird string or it will fail so here is a way to get that sorted out.
I am not saying this is the only way to do it - it worked for me though!
BTW: using if (knownname <=" ") takes care of a NULL value in the DB
function paneltitle () {
var missingname = "Unknown Name";
var knownname = {dialog.object}.getValue('cusname');
if (knownname <= " ") {
return missingname;
} else if (knownname != " "){
return knownname;
}
}
function MYALIAS () {
var text = "";
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
for (var i = 0; i < 5; i++)
text += possible.charAt(Math.floor(Math.random() * possible.length));
return text;
}
First of all if you watch the example video https://www.youtube.com/watch?v=YKE3-VKpcvU you will see them use the customer ID to generate a unique alias. If you use an actual table id that is auto-increment meaning a number it will likely fail because the javascript generated by AS converts it to uppercase and there isn't an uppercase for a number...the example uses the northwind DB which if you watch is all character strings.
Secondly, if you use the customers full name for the PANE title and for some reason you have a NULL value you will get a weird string or it will fail so here is a way to get that sorted out.
I am not saying this is the only way to do it - it worked for me though!
BTW: using if (knownname <=" ") takes care of a NULL value in the DB
function paneltitle () {
var missingname = "Unknown Name";
var knownname = {dialog.object}.getValue('cusname');
if (knownname <= " ") {
return missingname;
} else if (knownname != " "){
return knownname;
}
}
function MYALIAS () {
var text = "";
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
for (var i = 0; i < 5; i++)
text += possible.charAt(Math.floor(Math.random() * possible.length));
return text;
}