Hello,
I have a table which have 5 fields. I am showing 3 non null fields on UI as user input and storing them in the record input of CDT type to that table.
The other 2 fields (UserloggedIn and Unique Identification Number), I want to set it as default value to those record input fields on submit button but it is now working. I don't want to show this field in UI and allow modifcation by User.
Placing my code below. Please suggest what is the mistake here or how to achieve it. Thank you.
Interface:
Code:
load( local!reportedBy: loggedInUser(), local!uin:"TEST000000000005", a!formLayout( label: "Kk Testing Kk", contents: { a!columnsLayout( columns: { a!columnLayout( contents: { a!textField( label: "Tstclientname", labelPosition: "ABOVE", value: ri!record.tstclientname, saveInto: ri!record.tstclientname, characterLimit: 55 ), a!dateField( label: "Tstmasterdate", labelPosition: "ABOVE", value: date(2022, 03, 06), saveInto: ri!record.tstmasterdate ) } ), a!columnLayout( contents: { a!dropdownField( label: "Project Type", labelPosition: "ABOVE", placeholder: "--Select type--", choiceLabels: {"New", "Existing"}, choiceValues: {"New", "Existing"}, value: ri!record.tstproducttype, saveInto: ri!record.tstproducttype ) } ) } ) }, buttons: a!buttonLayout( primaryButtons: { a!buttonWidget( label: "Submit", saveInto: { a!save(ri!record.uin, local!uin), a!save(ri!record.tstaddedby, local!reportedBy) }, submit: true, style: "PRIMARY" ) }, secondaryButtons: { a!buttonWidget( label: "Cancel", value: true, saveInto: ri!cancel, submit: true, style: "NORMAL", validate: false ) } ) ))
Error:
Discussion posts and replies are publicly visible
The same is working if I place those 2 fields on UI and input them manually.
I can see that in the ri!record input that the field value appears to be "tstuin" and not just "uin". So when trying to save into ri!record.uin the error message is telling you that the field you have specified doesn't exist.
Hi,
Error states some type conversation problem. Your local!uin is of type Text, Can you check what is the data type of your ri!record.uin?
No, it's not a conversion problem. It's an indexing problem.
Besides the indexing issue, a few hints for improvements:
- use a!localVariables() instead of load()
- use keyword syntax: https://docs.appian.com/suite/help/22.1/Expressions.html#by-keyword
Hi ajhick,
Yes, you are right my field name is tsuin where as I was using a wrong name uin which don't exist. I referring ri!record.uin instead of ri!record.tstuin. After correcting it worked.
Thanks a lot.
Thank you. I was using the wrong field name in the CDT which doesn't exist. it was mere a spelling mistake which wasn't caught in the editor validation. After correcting it worked.