i everyone ,
i am pratik and i am trying to build one form where user can search the candidate from dropdown which is comes throw database using query rule. and on selection of that choice i want to display the all information of that perticular person in read only component . and after that i want to add some more component in interface and store that into other table . but when i refresh my page that time i get the below errors.
Could not display interface. Please check definition and inputs. Interface Definition: Expression evaluation error at function a!integerField [line 42]: Invalid index (-2147483647) for list: valid range is 1..3
load( local!availableCandidates:rule!dms_query_demo(), local!selectedCandidate, local!selectedIndex, local!selectedTitle, a!formLayout( label: "Document Uploading page", contents: { a!columnsLayout( columns: { a!columnLayout( contents: { a!dropdownField( label: "Class", labelPosition: "ABOVE", placeholder: "--- Select the Class ---", choiceLabels: local!availableCandidates.name, choiceValues: local!availableCandidates.name, value: local!selectedCandidate, saveInto: { local!selectedCandidate, a!save(local!selectedTitle, null), a!save(local!selectedIndex, wherecontains(local!selectedCandidate, local!availableCandidates.name)) } ) } ), a!columnLayout( contents: {} ) } ), a!boxLayout( label: " Student information", contents: { a!columnsLayout( columns: { a!columnLayout( contents: { a!integerField( label: "Student Id", labelPosition: "ABOVE", value: local!availableCandidates.id[local!selectedCandidate], saveInto:ri!dms_student.id , refreshAfter: "UNFOCUS", readOnly: true, disabled: true, validations: {} ), a!textField( label: "Address", labelPosition: "ABOVE", value: local!availableCandidates.address[local!selectedIndex], saveInto: ri!dms_student.address, readOnly: true, disabled: true, validations:{} ), a!textField( label: "Mob", labelPosition: "ABOVE", value: local!availableCandidates.mob[local!selectedIndex], saveInto: ri!dms_student.mob, disabled: true, readOnly: true, validations: {} ) } ), a!columnLayout( contents: { a!textField( label: "Name", labelPosition: "ABOVE", value: local!availableCandidates.name[local!selectedIndex], /**/ saveInto: ri!dms_student.name, disabled: true, readOnly: true, validations:{} ), a!textField( label: "Department", labelPosition: "ABOVE", value: local!availableCandidates.department[local!selectedIndex], saveInto: ri!dms_student.department, disabled: true, readOnly: true, validations: {} ), a!textField( label: "Class", labelPosition: "ABOVE", value: local!availableCandidates.class[local!selectedIndex], saveInto: ri!dms_student.class, readOnly: true, disabled: true, validations: {} ) } ) } ) }, style: "#9900ff", marginBelow: "STANDARD" ), a!columnsLayout( columns: { a!columnLayout( contents: { a!dropdownField( label: "Document Type", labelPosition: "ABOVE", placeholder: "--- Select a Document ---", choiceLabels: cons!dms_doc_type_cons, choiceValues: cons!dms_doc_type_cons, value: ri!dms_document.type, saveInto: ri!dms_document.type, searchDisplay: "AUTO", validations: {} ) } ), a!columnLayout( contents: { a!fileUploadField( label: "Upload Document Here..", labelPosition: "ABOVE", target: cons!dms_document_folder_cons, value: ri!dms_document.document, saveInto:ri!dms_document.document, validations: {} ) } ) } ) }, buttons: a!buttonLayout( primaryButtons: { a!buttonWidget( label: "Submit", /*saveInto: a!save(ri!dms_student, local!availableCandidates[local!selectedIndex]),*/ submit: true, style: "PRIMARY" ) }, secondaryButtons: { a!buttonWidget( label: "Cancel", value: true, submit: true, style: "NORMAL", validate: false ) } ) ) )
Discussion posts and replies are publicly visible
pratiks0003
I think the issue is in the index logic that you have done. From the code, local!availableCandidates.id[local!selectedCandidate] - seems like you're trying to index based on the variable local!selectedCandidate, but it is wrong. You're trying to index based on a text value.
On analyzing your code, I could infer that local!selectedIndex is the variable that contains the index position. So, if you replace local!selectedCandidate by local!selectedIndex, then this will work.
Also, I prefer to used index() function as a best practice to avoid errors.
ok thanks selvakumar ,
i will be try this ones