Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
12 replies
Subscribers
7 subscribers
Views
4316 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
We have an issue with a variable overwriting another variable within a sail form
ashleyb
over 9 years ago
We have an issue with a variable overwriting another variable within a sail form. These variables initially have the same value and then one is modified by the user while the other remains a "read only" version. The issue we are having is when the user edit's the editable variable, the values are being overwritten in the "read only" variabe - before anything is saved to the databse (the database is the original source for both).
load(
/*Retrieving fresh exception data from the SQL database before populating to the user (Added with Release 6)*/
ri!eadOnly_exceptionDetails_cdt : rule!CAC_getExceptionByIDAndNotStatus(ri!exceptionDetails_cdt.crsExceptionID, "Cleared"),
ri!exceptionDetails_cdt : rule!CAC_getExceptionByIDAndNotStatus(ri!exceptionDetails_cdt.crsExceptionID, "Cleared"),
local!noDocAttached_bool: if(
getdocumentsfromfolder(
rule!findExactFolderNameMatch(
ri!exceptionDetails_cdt.crsExceptionID
),
...
OriginalPostID-168667
OriginalPostID-168667
Discussion posts and replies are publicly visible
0
ashleyb
over 9 years ago
... true
) = "",
true,
false
),
a!formLayout(
label: "Review " & ri!exceptionDetails_cdt.apnStatus & " Exception #" & ri!exceptionDetails_cdt.crsExceptionID,
firstColumnContents: {
rule!CAC_Exception_Details_Elements_CRSRelease3(
ri!readOnly_exceptionDetails_cdt,
ri!exceptionDetails_cdt,
ri!returnCodeXML_Txt
),
rule!APN_uiSectionTwoColumn(
label: "Document Indexing Information",
column1: if(
local!noDocAttached_bool,
{
a!textField(
label: "",
readOnly: true,
value: "No documents currently attached",
saveInto: ""
)
},
{
a!textField(
label: "Customer Number",
readOnly: true,
value: exceptionDetails_cdt.customerNumber,
saveInto: ""
),
a!textField(
label: "Note Number...
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
ashleyb
over 9 years ago
...",
required: local!noDocAttached_bool,
readOnly: local!noDocAttached_bool,
value: ri!noteNumber_Txt,
saveInto: ri!noteNumber_Txt,
validations: if(
regexmatch(
"^[0-9]*$",
ri!noteNumber_Txt
),
if(
len(
ri!noteNumber_Txt
) > 4,
{
"Enter 4 digits or less."
},
{}
),
{
"Please enter numeric characters only."
}
)
),
/*AJM change to box number adding the "do not show" if statement
CAC-441: "Exception: Show Iron Mountain Box Number only if the current status is Waiting on Original"
*//*a!textField(
label: "Box Number",
readOnly: true,
value: cons!CAC_IRO...
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
ashleyb
over 9 years ago
... N_MOUNTAIN_BOX_NBR
)
*/if(
isnull(
ri!readOnly_exceptionDetails_cdt
),
{},
if(
exceptionDetails_cdt.apnStatus = "Waiting on Original",
a!textField(
label: "Box Number",
readOnly: true,
value: cons!CAC_IRON_MOUNTAIN_BOX_NBR/*saveInto: ri!exceptionDetails_cdt.ironmtnbxnum
can not save in to as the field is read only, will use a script task to populate the data*/
),
{}
)
)
}
),
/*end if no doc attached*/column2: if(
local!noDocAttached_bool,
{},
{
a!dropdownField(
label: "Document Type",
instructions: "",
required: local!noDocAttached_bool,
readOnly: local!noDocAttached_bool,
placeholderLabel: "Select...
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
ashleyb
over 9 years ago
... a document type...",
choiceLabels: cons!CAC_CM_DOCUMENT_TYPES,
choiceValues: cons!CAC_CM_DOCUMENT_TYPES,
value: ri!documentType_text,
saveInto: ri!documentType_text
),
a!textField(
label: "Auxiliary",
readOnly: local!noDocAttached_bool,
value: ri!auxiliary_text,
saveInto: ri!auxiliary_text
)
}
)/*end if no doc check*/
),
rule!CAC_Exception_Display_Documents(
ri!exceptionDetails_cdt
),
a!textField(
label: "",
readOnly: true,
refreshAfter: "KEYPRESS",
value: if(
local!noDocAttached_bool,
{},
if(
contains(
cons!CAC_CM_ACCEPTED_FILE_EXTENSIONS,
ri!DocumentExtension_Txt
),
{},
cons!CAC_CM_ACCEPTED_FILE_EXTENSIONS_MSG & ri!DocumentExtensio...
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
ashleyb
over 9 years ago
... n_Txt & cons!CAC_CM_ACCEPTED_FILE_EXTENSIONS_MSG2
)
)
),
if(
isnull(
ri!readOnly_exceptionDetails_cdt.collateralid
),
{},
rule!CAC_Exceptions_CRS_Detail_Selector(
ri!exceptionDetails_cdt,
CusipHolder_Txt
)
),
rule!APN_uiSectionTwoColumn(
label: "Exception Comments",
column1: {
a!paragraphField(
label: "Processor Comments",
labelPosition: "ADJACENT",
readOnly: false(),
value: ri!processorComments_text,
saveInto: ri!processorComments_text
),
a!linkField(
label: "Comments in News Feed",
links: a!safeLink(
uri: "/suite/tempo/entry/" & ri!exceptionDetails_cdt.entryID,
label: "Click here to see all comments for this Exception"
)
),
a!textField(
label: "",
...
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
ashleyb
over 9 years ago
... readOnly: true,
value: ""
)
},
column2: {
a!paragraphField(
label: "Officer Comments",
labelPosition: "ADJACENT",
readOnly: true(),
value: ri!officerComments_text,
saveInto: ri!officerComments_text
)
}
),
rule!APN_uiSectionOneColumn(
label: "Document Imaging",
contents: if(
local!noDocAttached_bool,
{
a!textField(
label: "",
readOnly: true,
value: "No Documents Attached"
)
},
{
a!radioButtonField(
label: "Send to QC?",
instructions: "",
required: true,
choiceLabels: {
"Yes",
"No"
},
choiceValues: {
"Yes",
"No"
},
va...
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
ashleyb
over 9 years ago
... lue: "No",
saveInto: ri!sendToODC_text
)
}
)/*end if */
)
},
buttons: a!buttonLayout(
primaryButtons: {
a!buttonWidgetSubmit(
label: "Clear Exception",
value: "clear",
style: "PRIMARY",
saveInto: ri!action_text
),
if(
ri!exceptionDetails_cdt.apnStatus = index(
cons!CAC_EXCEPTION_STATUSES,
cons!CAC_EXCEPTION_STATUS_WAITING_INDEX,
"Waiting on Original"
),
{},
a!buttonWidgetSubmit(
label: "Waiting on Original",
value: "waiting",
saveInto: ri!action_text
)
),
a!buttonWidgetSubmit(
label: "Waive Exception",
value: "waive",
confirmMessage: (
"Are you sure you want to waive this exception?"
),
saveInto: ri!action_text
),
a!buttonW...
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
ashleyb
over 9 years ago
... idgetSubmit(
label: "Reject",
skipValidation: true,
confirmMessage: (
"Are you sure you want to reject this exception?"
),
value: "reject",
saveInto: ri!action_text
)
}
)
)
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Eliot Gerson
Appian Employee
over 9 years ago
Can you please be more specific about the behavior that you're seeing? Which variable is overwriting which variable? Also, for readability, please put your SAIL code into a text file and attach it.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
ashleyb
over 9 years ago
Our ri!exceptionDetails_cdt variable is overwriting the values of our ri!reaOnlyExceptionDetails_cdt variable although they are separately set and are never saved into eachother.
Any suggestions are appreciated.
sailIssues.txt
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
>