[go: up one dir, main page]

0% found this document useful (0 votes)
11 views3 pages

SkillsPractice2 EvaluationFunctions Solutions

The document provides a solution for an evaluation function exercise involving a form layout for requesting vehicle maintenance. It includes fields for selecting vehicle parts, entering repair costs, indicating warranty status, specifying maintenance type, and providing a description of the repair. The form is designed to ensure required information is collected before submission.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views3 pages

SkillsPractice2 EvaluationFunctions Solutions

The document provides a solution for an evaluation function exercise involving a form layout for requesting vehicle maintenance. It includes fields for selecting vehicle parts, entering repair costs, indicating warranty status, specifying maintenance type, and providing a description of the repair. The form is designed to ensure required information is collected before submission.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

EVALUATION FUNCTIONS EXERCISES - SOLUTIONS

Exercise 1: Evaluation functions

SAIL Expression:

load(
local!parts: rule!VFM_getAllVehicleParts(),
local!warranty,
a!formLayout(
label: "Request Maintenance",
firstColumnContents: {
a!dropdownField(
label: "Part",
labelPosition: "ABOVE",
choiceLabels: local!parts.name,
placeholderLabel: "--- Select a Value ---",
choiceValues: local!parts.id,
value: ri!request.partId,
saveInto: ri!request.partId,
required: true,
validations: {}
),
a!textField(
label: "Repair Cost",
labelPosition: "ABOVE",
value: dollar(
ri!request.repairCost
),
saveInto: ri!request.repairCost,
refreshAfter: "UNFOCUS",
required: true,
disabled: local!warranty,
validations: {}
),
a!checkboxField(
label: "",
labelPosition: "COLLAPSED",
choiceLabels: {
"Under warranty"
},
choiceValues: {
true
},
value: local!warranty,
saveInto: {
local!warranty,
a!save(
ri!request.repairCost,
0
)
},
validations: {}
)
},
secondColumnContents: {
a!dateField(
label: "Date Needed",
labelPosition: "ABOVE",
value: ri!request.dateNeeded,
saveInto: ri!request.dateNeeded,
validations: {}
),
a!radioButtonField(
label: "Type of Maintenance",
labelPosition: "ABOVE",
choiceLabels: {
"Routine",
"Other"
},
choiceValues: {
true,
false
},
value: ri!request.isRoutine,
saveInto: ri!request.isRoutine,
required: true,
choiceLayout: "STACKED",
validations: {}
),
if(
or(
ri!request.isRoutine,
isnull(
ri!request.isRoutine
)
),
{},
a!paragraphField(
label: "Description of Repair",
labelPosition: "ABOVE",
value: ri!request.reason,
saveInto: ri!request.reason,
refreshAfter: "UNFOCUS",
required: true,
height: "MEDIUM",
validations: {}
)
)
},
buttons: a!buttonLayout(
primaryButtons: {
a!buttonWidgetSubmit(
label: "Submit",
style: "PRIMARY"
)
}
)
)
)

You might also like