I'm working on the community edition and doing Acme Automobile exercies. While developing 'Add Vehilce' interface, I'm facing this weird problem, the Category and Condition drop downs are not able to hold the values that I select, after selecting the values, the drop down is reloading with default values (place holder '--select a value--') I have double checked the configuration and even compared with the finished solution. Still same issue. the finished version despite having the same configuration, it is working fine.
I'm suspecting the caching issues or build issues.. any suggestions are helpful.
TIA
a!localVariables( local!category : rule!AAX_QR_REF_getVehicleCategory(), local!condition : rule!AAX_QR_REF_getVehicleCondition(), a!formLayout( label: "Add Vehicle", contents: { a!columnsLayout( columns: { a!columnLayout( contents: { a!sideBySideLayout( items: { a!sideBySideItem( item: a!textField( label: "Make", labelPosition: "ABOVE", value: ri!vehicle['recordType!{1787d8a4-970c-45b8-996e-b9cc6daa0bb3}AAX Vehicle.fields.{123cb5ac-090f-4e04-a7ad-ca1c02617f11}vehicleMake'], saveInto: ri!vehicle['recordType!{1787d8a4-970c-45b8-996e-b9cc6daa0bb3}AAX Vehicle.fields.{123cb5ac-090f-4e04-a7ad-ca1c02617f11}vehicleMake'], characterLimit: 55, required: false ) ), a!sideBySideItem( item: a!textField( label: "Model", labelPosition: "ABOVE", value: ri!vehicle['recordType!{1787d8a4-970c-45b8-996e-b9cc6daa0bb3}AAX Vehicle.fields.{68b46202-738c-435c-bed8-e057ac6c6576}vehicleModel'], saveInto: ri!vehicle['recordType!{1787d8a4-970c-45b8-996e-b9cc6daa0bb3}AAX Vehicle.fields.{68b46202-738c-435c-bed8-e057ac6c6576}vehicleModel'], characterLimit: 55, required: false ) ), a!sideBySideItem( item: a!integerField( label: "Year", labelPosition: "ABOVE", value: ri!vehicle['recordType!{1787d8a4-970c-45b8-996e-b9cc6daa0bb3}AAX Vehicle.fields.{fd164a36-3222-43b4-9956-93fe0018a5a0}vehicleYear'], saveInto: ri!vehicle['recordType!{1787d8a4-970c-45b8-996e-b9cc6daa0bb3}AAX Vehicle.fields.{fd164a36-3222-43b4-9956-93fe0018a5a0}vehicleYear'], required: false ) ) } ), a!textField( label: "Color", labelPosition: "ABOVE", value: ri!vehicle['recordType!{1787d8a4-970c-45b8-996e-b9cc6daa0bb3}AAX Vehicle.fields.{bcf14603-0c85-4a4c-a990-6aa68232cccd}vehicleColor'], saveInto: ri!vehicle['recordType!{1787d8a4-970c-45b8-996e-b9cc6daa0bb3}AAX Vehicle.fields.{bcf14603-0c85-4a4c-a990-6aa68232cccd}vehicleColor'], characterLimit: 55, required: false ), a!integerField( label: "Mileage", labelPosition: "ABOVE", value: ri!vehicle['recordType!{1787d8a4-970c-45b8-996e-b9cc6daa0bb3}AAX Vehicle.fields.{ed530b7c-9c3e-46dc-b359-eeeeb194182d}vehicleMileage'], saveInto: ri!vehicle['recordType!{1787d8a4-970c-45b8-996e-b9cc6daa0bb3}AAX Vehicle.fields.{ed530b7c-9c3e-46dc-b359-eeeeb194182d}vehicleMileage'], required: false ), a!textField( label: "Vin", labelPosition: "ABOVE", value: ri!vehicle['recordType!{1787d8a4-970c-45b8-996e-b9cc6daa0bb3}AAX Vehicle.fields.{2581e89f-c7ba-461a-85cc-b0485a5cd806}vehicleVin'], saveInto: ri!vehicle['recordType!{1787d8a4-970c-45b8-996e-b9cc6daa0bb3}AAX Vehicle.fields.{2581e89f-c7ba-461a-85cc-b0485a5cd806}vehicleVin'], characterLimit: 17, required: false ) } ), a!columnLayout( contents: { a!dropdownField( label: "Category", labelPosition: "ABOVE", placeholder: "--- Select a Value ---", choiceLabels: local!category['recordType!{0063da9e-52e1-4f6e-af28-f0fa2eefe66f}Category.fields.{142b6584-3be7-42c3-852f-600471549007}label'], choiceValues: local!category['recordType!{0063da9e-52e1-4f6e-af28-f0fa2eefe66f}Category.fields.{142b6584-3be7-42c3-852f-600471549007}label'], value: ri!vehicle['recordType!{1787d8a4-970c-45b8-996e-b9cc6daa0bb3}AAX Vehicle.fields.{511faf25-0220-4286-8c04-0647ef015010}vehicleCategory'], saveInto: ri!vehicle['recordType!{1787d8a4-970c-45b8-996e-b9cc6daa0bb3}AAX Vehicle.fields.{511faf25-0220-4286-8c04-0647ef015010}vehicleCategory'], searchDisplay: "AUTO", required: true, validations: {} ), a!dropdownField( label: "Condition", labelPosition: "ABOVE", placeholder: "--- Select a Value ---", choiceLabels: local!condition['recordType!{b86e3be8-f076-4bf4-9f37-ba3d2ecd6815}Condition.fields.{1b84c63a-9805-4988-844c-2bb03b83abe8}label'], choiceValues: local!condition['recordType!{b86e3be8-f076-4bf4-9f37-ba3d2ecd6815}Condition.fields.{1b84c63a-9805-4988-844c-2bb03b83abe8}label'], value: ri!vehicle['recordType!{1787d8a4-970c-45b8-996e-b9cc6daa0bb3}AAX Vehicle.fields.{1691c499-182a-4f6b-a362-74296cd3d0fd}vehicleCondition'], saveInto: ri!vehicle['recordType!{1787d8a4-970c-45b8-996e-b9cc6daa0bb3}AAX Vehicle.fields.{1691c499-182a-4f6b-a362-74296cd3d0fd}vehicleCondition'], searchDisplay: "AUTO", required: true, validations: {} ), a!sideBySideLayout( items: { a!sideBySideItem( item: a!dateField( label: "Date Added", labelPosition: "ABOVE", value: today(), saveInto: ri!vehicle['recordType!{1787d8a4-970c-45b8-996e-b9cc6daa0bb3}AAX Vehicle.fields.{62ceee63-396a-4078-9a53-fe20f6736036}vehicleDateAdded'], required: false, readOnly: true ) ), a!sideBySideItem( item: a!dateField( label: "Last Maintenance", labelPosition: "ABOVE", value: ri!vehicle['recordType!{1787d8a4-970c-45b8-996e-b9cc6daa0bb3}AAX Vehicle.fields.{5b049ada-7fd2-49a7-a874-4b5e5fb53e38}vehicleLastMaintenanceDate'], saveInto: ri!vehicle['recordType!{1787d8a4-970c-45b8-996e-b9cc6daa0bb3}AAX Vehicle.fields.{5b049ada-7fd2-49a7-a874-4b5e5fb53e38}vehicleLastMaintenanceDate'], required: false ) ), a!sideBySideItem( item: a!dateField( label: "Next Maintenance", labelPosition: "ABOVE", value: ri!vehicle['recordType!{1787d8a4-970c-45b8-996e-b9cc6daa0bb3}AAX Vehicle.fields.{483abf1a-aee0-4aa3-bb47-b62144259bf2}vehicleNextMaintenanceDate'], saveInto: ri!vehicle['recordType!{1787d8a4-970c-45b8-996e-b9cc6daa0bb3}AAX Vehicle.fields.{483abf1a-aee0-4aa3-bb47-b62144259bf2}vehicleNextMaintenanceDate'], required: false, validations: if(todate(ri!vehicle['recordType!{1787d8a4-970c-45b8-996e-b9cc6daa0bb3}AAX Vehicle.fields.{483abf1a-aee0-4aa3-bb47-b62144259bf2}vehicleNextMaintenanceDate']) < todate(ri!vehicle['recordType!{1787d8a4-970c-45b8-996e-b9cc6daa0bb3}AAX Vehicle.fields.{5b049ada-7fd2-49a7-a874-4b5e5fb53e38}vehicleLastMaintenanceDate']), "The next maintenance date must be after the last maintenance date.", null) ) ) } ), a!fileUploadField( label: "Image", labelPosition: "ABOVE", target: cons!AAX_DOCUMENTS_FOLDER_POINTER, maxSelections: 1, value: ri!vehicle['recordType!{1787d8a4-970c-45b8-996e-b9cc6daa0bb3}AAX Vehicle.fields.{42b27e86-5c46-4b41-8ecc-1b2aa1dbc8f2}vehicleImage'], saveInto: ri!vehicle['recordType!{1787d8a4-970c-45b8-996e-b9cc6daa0bb3}AAX Vehicle.fields.{42b27e86-5c46-4b41-8ecc-1b2aa1dbc8f2}vehicleImage'], validations: {} ) } ) } ) }, buttons: a!buttonLayout( primaryButtons: { a!buttonWidget( label: "Add Vehicle", saveInto: { a!save(ri!vehicle['recordType!{1787d8a4-970c-45b8-996e-b9cc6daa0bb3}AAX Vehicle.fields.{62ceee63-396a-4078-9a53-fe20f6736036}vehicleDateAdded'],today()), a!save(ri!vehicle['recordType!{1787d8a4-970c-45b8-996e-b9cc6daa0bb3}AAX Vehicle.fields.{e712ecab-b2c4-49f8-8f8d-d8fcc84f739a}vehicleAddedBy'], loggedInUser()) }, submit: true, style: "PRIMARY", validate: true ) }, secondaryButtons: { a!buttonWidget( label: "Cancel", value: true, saveInto: ri!cancel, submit: true, style: "NORMAL", validate: false ) } ) ) )
Discussion posts and replies are publicly visible
Can you check what you are storing... category labels your storing in DB?? I think you should change Choice values.
Hi there, I think there is no syntactical error in the above code. But you can do a few things -
@vasudev5149
The issue seems to be value and saveinto into rule input of record type. If you want to identify this you can use local variable to save the value and then store in the rule input. By this way we can able to identify the local variable hold the value and rule input does not hold then issue in the rule input of record type.
Let me also do example and send here for your reference. In the meantime please try my concern.
Thanks,
Pradeep Sridharan
I will check the course exercises once and will update the code accordingly. Thanks for your finding.
Sure will check and update here. Thanks
Maybe my blog post might help you: https://appian.rocks/2022/07/05/data-in-interfaces/
Thank you. Will check it.
Vasudeva
Sharing example I tried and its working. Please find the below details,
a!localVariables( local!selectedCategory, local!selectedCondition, local!category :{ a!map( vehicleId:1, vehicleName:"Sedan" ), a!map( vehicleId:2, vehicleName:"SUV" ), a!map( vehicleId:3, vehicleName:"MUV" ), a!map( vehicleId:4, vehicleName:"Luxury" ) }, local!condition :{ a!map( conditionId:1001, conditionName:"Like New" ), a!map( conditionId:1002, conditionName:"Minor Use" ), a!map( conditionId:1003, conditionName:"Average Wear & Tear" ), a!map( conditionId:1004, conditionName:"Noticed use damage" ), a!map( conditionId:1005, conditionName:"Noticed use damage" ) }, a!formLayout( label: "Add Vehicle", contents: { a!columnsLayout( columns: { a!columnLayout( contents: { a!dropdownField( label: "Category", labelPosition: "ABOVE", placeholder: "--- Select a Value ---", choiceLabels: local!category.vehicleName, choiceValues: local!category.vehicleId, value: local!selectedCategory, saveInto:{ local!selectedCategory, a!save(ri!vehicleDetails['recordType!{654c93ff-dc60-41f3-bcf3-863dee32b578}PS Vehicle Detail.fields.{752dd8d3-3636-4a63-bd03-9dcc3925750e}vehicleid'],local!selectedCategory) }, searchDisplay: "AUTO", required: true, validations: {} ), a!dropdownField( label: "Condition", labelPosition: "ABOVE", placeholder: "--- Select a Value ---", choiceLabels: local!condition.conditionName, choiceValues: local!condition.conditionId, value: local!selectedCondition, saveInto:{ local!selectedCondition, a!save(ri!vehicleDetails['recordType!{654c93ff-dc60-41f3-bcf3-863dee32b578}PS Vehicle Detail.fields.{3d641896-6a3c-4a3a-9adf-5c410e65d867}conditionid'],local!selectedCondition) }, searchDisplay: "AUTO", required: true, validations: {} ) } ) } ) }, buttons: a!buttonLayout( primaryButtons: { a!buttonWidget( label: "Add Vehicle", saveInto: { }, submit: true, style: "PRIMARY", validate: true ) }, secondaryButtons: { a!buttonWidget( label: "Cancel", value: true, saveInto: ri!cancel, submit: true, style: "NORMAL", validate: false ) } ) ) )