Based on value selected the data should be displayed
Hi All .I hope everyone is doing good. I have a scenario , but not sure if its possible / correct/not . Please let me know if any one has any ideas or any suggestions.
Scenario: I have used navigation pattern in interface . This uses different interfaces in choose function and get the data accordingly . Is it possible to do it in a single interface instead of using multiple interfaces or can we use a single grid ( instead of calling a!grid and the data for all the remaining status) and call the value in local variable and pas the local variable and get data accordingly .........!
Below is the code for an idea what i am describing about . Any ideas / suggestion please let me know. Thank you in advance [emoticon:c4563cd7d5574777a71c318021cbbcc8]
{
a!localVariables(
/* The selected navigation section */
local!activeNavSection: 1,
/* The navigation sections */
local!navSections: {
a!map(name: "Requested"),
a!map(name: "Inprogress"),
a!map(name: "Delayed"),
a!map(name: "Cancelled"),
a!map(name: "Completed"),
},
{
a!columnsLayout(
columns: {
a!columnLayout(
contents: {
a!forEach(
items: local!navSections,
expression: a!cardLayout(
contents: a!sideBySideLayout(
items: {
a!sideBySideItem(
item: a!richTextDisplayField(
labelPosition: "COLLAPSED",
value: a!richTextItem(
text: fv!item.name,
color: "ACCENT",
size: "MEDIUM",
style: if(
fv!index = local!activeNavSection,
"STRONG",
"PLAIN"
)
)
)
)
},
alignVertical: "MIDDLE"
),
link: a!dynamicLink(
value: fv!index,
saveInto: local!activeNavSection
),
style: if(
fv!index = local!activeNavSection,
"ACCENT",
"NONE"
),
showBorder: false,
accessibilityText: if(
fv!index = local!activeNavSection,
fv!item.name & " " & "selected",
""
)
)
),
a!cardLayout(
height: "TALL",
showWhen: not(a!isPageWidth("PHONE")),
showBorder: false
)
},
width: "NARROW"
),
a!columnLayout(
contents: {
choose(
local!activeNavSection,
a!sectionLayout(
label: index(
local!navSections.name,
local!activeNavSection,
""
),
contents: a!gridField_24r3(
labelPosition: "ABOVE",
data: a!recordData(
recordType: 'recordType!{4159bc7e-822e-44d7-bdea-42ce7ab5c096-w0949aa}W0949AA Maintenance',
),
columns: {
a!gridColumn(
label: "Request",
sortField: 'recordType!{4159bc7e-822e-44d7-bdea-42ce7ab5c096-w0949aa}W0949AA Maintenance.fields.{eee2f931-999a-4540-bed2-e907dc892c8a-w0949aa}id',
value: a!linkField(
links: a!recordLink(
label: text(
fv!row['recordType!{4159bc7e-822e-44d7-bdea-42ce7ab5c096-w0949aa}W0949AA Maintenance.fields.{eee2f931-999a-4540-bed2-e907dc892c8a-w0949aa}id'],
"MR0000"
),
recordType: 'recordType!{4159bc7e-822e-44d7-bdea-42ce7ab5c096-w0949aa}W0949AA Maintenance',
identifier: fv!identifier
)
),
align: "START",
width: "AUTO"
),
a!gridColumn(
label: "Issue",
sortField: 'recordType!{4159bc7e-822e-44d7-bdea-42ce7ab5c096-w0949aa}W0949AA Maintenance.fields.{36dbff6f-ffca-41a0-902e-4e20ed0bc958-w0949aa}issue',
value: fv!row['recordType!{4159bc7e-822e-44d7-bdea-42ce7ab5c096-w0949aa}W0949AA Maintenance.fields.{36dbff6f-ffca-41a0-902e-4e20ed0bc958-w0949aa}issue'],
align: "START",
width: "AUTO"
),
a!gridColumn(
label: "Mechanic",
sortField: 'recordType!{4159bc7e-822e-44d7-bdea-42ce7ab5c096-w0949aa}W0949AA Maintenance.fields.{ca225a9f-b472-4d45-92f0-65baf65fef15-w0949aa}mechanic',
value: a!richTextDisplayField(
value: a!richTextItem(
text: rule!W0949AA_formattedUsername(
user: fv!row['recordType!{4159bc7e-822e-44d7-bdea-42ce7ab5c096-w0949aa}W0949AA Maintenance.fields.{ca225a9f-b472-4d45-92f0-65baf65fef15-w0949aa}mechanic']
)
)
),
align: "START",
width: "AUTO"
),
a!gridColumn(
label: "Request Status",
sortField: 'recordType!{4159bc7e-822e-44d7-bdea-42ce7ab5c096-w0949aa}W0949AA Maintenance.relationships.{97baeb28-1dc4-4d0b-9a3c-da6629f572b4-w0949aa}aaMaintenanceStatus.fields.{a0d16621-eaa1-43e4-baf1-36ae56047356-w0949aa}value',
value:
a!richTextDisplayField(
value: rule!W0949AA_maintenanceStatusIcon(
maintenanceStatus: fv!row['recordType!{4159bc7e-822e-44d7-bdea-42ce7ab5c096-w0949aa}W0949AA Maintenance.relationships.{97baeb28-1dc4-4d0b-9a3c-da6629f572b4-w0949aa}aaMaintenanceStatus.fields.{a0d16621-eaa1-43e4-baf1-36ae56047356-w0949aa}value'],
isIncludingLabel: true()
)
),
align: "START",
width: "AUTO"
),
a!gridColumn(
label: "Request Date",
sortField: 'recordType!{4159bc7e-822e-44d7-bdea-42ce7ab5c096-w0949aa}W0949AA Maintenance.fields.{c365c0bc-29da-44a2-85f2-283c7bc1c01a-w0949aa}createdOn',
value: todate(
fv!row['recordType!{4159bc7e-822e-44d7-bdea-42ce7ab5c096-w0949aa}W0949AA Maintenance.fields.{c365c0bc-29da-44a2-85f2-283c7bc1c01a-w0949aa}createdOn']
),
align: "END",
width: "AUTO"
)
},
pageSize: 10,
initialSorts: {
a!sortInfo(
field: 'recordType!{4159bc7e-822e-44d7-bdea-42ce7ab5c096-w0949aa}W0949AA Maintenance.fields.{c365c0bc-29da-44a2-85f2-283c7bc1c01a-w0949aa}createdOn',
ascending: false
)
},
validations: {},
refreshAfter: "RECORD_ACTION",
userFilters: {
'recordType!{4159bc7e-822e-44d7-bdea-42ce7ab5c096-w0949aa}W0949AA Maintenance.filters.{9ec7475a-a56d-4ca8-ab9a-768c6da6a11c-w0949aa}aaRefMaintenanceStatusId',
'recordType!{4159bc7e-822e-44d7-bdea-42ce7ab5c096-w0949aa}W0949AA Maintenance.filters.{2be5767c-730a-4f8c-9c4b-0c09c6d8661b-w0949aa}aaRefMaintenanceReviewStatusId',
'recordType!{4159bc7e-822e-44d7-bdea-42ce7ab5c096-w0949aa}W0949AA Maintenance.filters.{e390aa47-6a25-4113-b10d-e91cc2d6fed6-w0949aa}Mechanic'
},
showSearchBox: true,
showRefreshButton: true,
openActionsIn: "NEW_TAB",
actionsDisplay: "LABEL_AND_ICON"
),
),
a!sectionLayout(
label: index(
local!navSections.name,
local!activeNavSection,
""
),
contents: {a!gridLayout()}
),
a!sectionLayout(
label: index(
local!navSections.name,
local!activeNavSection,
""
),
contents: {a!gridLayout()}
),
a!sectionLayout(
label: index(
local!navSections.name,
local!activeNavSection,
""
),
contents: {a!gridLayout()}
),
a!sectionLayout(
label: index(
local!navSections.name,
local!activeNavSection,
""
),
contents: {a!gridLayout()}
),
)
}
)
},
spacing: "SPARSE",
showDividers: true
)
}
)
}
