Quick Report Attribute Domain Sort Order resets to alphabetical

607
3
02-02-2018 01:53 PM
WetherbeeDorshow
New Contributor III

using the quick report template, the add details page automatically sorts the attribute domain values alphabetically, rather than maintaining the order in the feature service. Also, the default values set for fields with attribute domains do not persist in the app. Any idea how to prevent the list from getting sorted and manually setting a default ("None")?

0 Kudos
3 Replies
NakulManocha
Esri Regular Contributor

This can be done but requires some code changes at your end. Here are some steps (Pseudo code). Hope you find it useful.

1) Edit QR source code and Open quickreportapp.qml. Look for 

function initializeFeatureService(errorcode, errormessage, root, cacheName)
2) find

if(fields.editable===true && fields.name!=root.typeIdField) {
var f = fields;
app.fields.push(f);
fieldsMassaged.push(f);
}

3) In this code block,
read the var f, it should be something like:

{
name: "opsstatus",
type: "esriFieldTypeString",
alias: "Operational Status",
domain: {
type: "codedValue",
name: "OperationalStatus",
codedValues: [
{
name: "Open",
code: "Open"
},
{
name: "Closed",
code: "Closed"
},
{
name: "Unknown",
code: "Unknown"
}
]
},
editable: true,
nullable: true,
length: 50
}

3) Sort the codedvales in alphabetical order, put it back to this jsobject

TinaJin
Esri Regular Contributor

Hi, 

we have introduced a new property, sortDomainByAlphabetical in AppStudio 3.0 release, to give the ability to change the coded value domain in alphabetical order.

You can download the AppStudio 3.0 desktop from here, creating a new Quick Report template, and click on the Edit icon to open Qt Creator when Quick Report app is selected, navigate to the appinfo.json file, and change sortDomainByAlphabetical to true.

I hope this helps

Thanks,

Tina 

WetherbeeDorshow
New Contributor III

Thanks. We customized the form per Nakul's suggestion, but this will be handy!

Wetherbee

0 Kudos