hi,
I have a search field in which i have search email text field and a grid. Values is saved in local ! searchemail variable.The search field should work after i click submit button , but its showing results whenever I click outside text box.
Please help.
attached code also.
load( local!caseId, local!search, local!exp, local!caseCategory, local!caseStatus, local!requestFromDate, local!requestToDate, local!toDate, local!allCases, local!department, local!searchEmail, local!pagingInfo: a!pagingInfo( startIndex: 1, batchSize: 20, sort: a!sortInfo( field: "rag_status", ascending: true() ) /*sort: a!sortInfo(*/ /*field: "case_id",*/ /*ascending: false()*/ /*)*/ ), { a!sectionLayout( label: "Search Criteria", contents: { a!columnsLayout( columns: { a!columnLayout( contents: { a!textField( label: "Case ID", value: local!caseId, saveInto: local!caseId ), a!dateField( label: "From Date", value: local!requestFromDate, saveInto: local!requestFromDate ) } ), a!columnLayout( contents: { a!dropdownField( label: "Case Category", placeholderLabel: "---Select a value---", choiceLabels: cons!APAC_SGP_EMAIL_CASE_CATEGORY_LABELS, choiceValues: cons!APAC_SGP_EMAIL_CASE_CATEGORY_VALUES, value: local!caseCategory, saveInto: local!caseCategory ), a!dateField( label: "To Date", value: local!requestToDate, saveInto: local!requestToDate ) } ), a!columnLayout( contents: { a!dropdownField( label: "Case Status", placeholderLabel: "---Select a value---", choiceLabels: cons!APAC_SGP_EMAIL_CASE_STATUS_LABELS, choiceValues: cons!APAC_SGP_EMAIL_CASE_STATUS_VALUES, value: local!caseStatus, saveInto: local!caseStatus ), a!textField( label: "Search Email", value: local!searchEmail, saveInto: local!searchEmail ) } ), a!columnLayout( a!dropdownField( label: "Department", placeholderLabel: "----Select----", choiceLabels: cons!APAC_DD_DEPARTMENTS, choiceValues: cons!APAC_DD_DEPARTMENTS, value: local!department, saveInto: local!department ) ) } ), a!textField( readOnly: true() ), a!buttonLayout( primaryButtons: a!buttonWidget( label: "Submit", value: ri!buttonAction, saveInto: { ri!buttonAction, a!save( local!pagingInfo.startIndex, 1 ), a!save( ri!caseDashboard.case_id, local!caseId ), a!save( ri!caseDashboard.case_status, local!caseStatus ), a!save( ri!caseDashboard.case_ctgry, local!caseCategory ), a!save( ri!caseDashboard.department, local!department ), a!save( ri!caseDashboard.creation_ts, local!requestFromDate ), a!save( local!toDate, local!requestToDate ), a!save( local!exp, local!searchEmail ), }, style: "PRIMARY" ), secondaryButtons: a!buttonWidget( label: "Reset", value: ri!buttonAction, saveInto: { ri!buttonAction, a!save( local!caseId, null ), a!save( local!caseStatus, null ), a!save( local!caseCategory, null ), a!save( local!department, null ), a!save( local!requestFromDate, null ), a!save( local!requestToDate, null ), a!save( local!toDate, null ), a!save( ri!caseDashboard.case_id, null ), a!save( ri!caseDashboard.case_status, null ), a!save( ri!caseDashboard.case_ctgry, null ), a!save( ri!caseDashboard.department, null ), a!save( ri!caseDashboard.creation_ts, null ), a!save(local!searchEmail,null) } ) ) } ), a!sectionLayout( label: "Search Results", contents: { a!gridField( label: "", emptyGridMessage: "No Data to Display", data: rule!APAC_getEmailIntegrationCases( caseId: ri!caseDashboard.case_id, caseCategory: ri!caseDashboard.case_ctgry, caseStatus: ri!caseDashboard.case_status, requestFromDate: ri!caseDashboard.creation_ts, requestToDate: local!toDate, pagingInfo: local!pagingInfo, teamName: ri!teamName, department: ri!caseDashboard.department, searchEmail: local!searchEmail ), columns: { a!gridColumn( label: "Case ID", sortField: "case_id", value: a!linkField( links: { a!recordLink( label: fv!row.case_id, recordType: cons!APAC_RECON_RECP_DASHBOARD, identifier: fv!row.case_id ) } ) ), a!gridColumn( label: "Case Category", sortField: "category_val", value: fv!row.category_val ), a!gridColumn( label: "Case Status", sortField: "status_val", value: fv!row.status_val ), a!gridColumn( label: "Department", sortField: "department", value: fv!row.department ), /*a!gridColumn(*/ /*label: "Pending Reason",*/ /*sortField: "reason",*/ /*value: fv!row.reason*/ /*),*/ a!gridColumn( label: "Request Date", sortField: "creation_ts", value: if( isnull( fv!row.creation_ts ), fv!row.creation_ts, datetext( fv!row.creation_ts, "default" ) ) ), a!gridColumn( label: "Assigned To", sortField: "assigned_to", value: rule!APAC_displayFullUserName( fv!row.assigned_to ), ), a!gridColumn( label: "From Email", sortField: "from_email", value: fv!row.from_email ), a!gridColumn( label: "To Email", sortField: "to_email", value: fv!row.to_email ), a!gridColumn( label: "Email Subject ", sortField: "email_subject", value: fv!row.email_subject ), a!gridColumn( label: "RAG Status", sortField: "rag_status", value: a!imageField( images: a!documentImage( document: if( cons!APAC_SGP_RAG_STATUS_VALUES[1] = trim( fv!row.rag_status ), a!iconIndicator( "PROGRESS_STOPPED" ), if( cons!APAC_SGP_RAG_STATUS_VALUES[2] = trim( fv!row.rag_status ), a!iconIndicator( "PROGRESS_RUNNING" ), if( cons!APAC_SGP_RAG_STATUS_VALUES[3] = trim( fv!row.rag_status ), a!iconIndicator( "PROGRESS_PAUSED" ), a!iconIndicator( "PROGRESS_STOPPED" ) ) ) ), caption: if( cons!APAC_SGP_RAG_STATUS_VALUES[1] = trim( fv!row.rag_status ), cons!CNAM_RAG_STATUS_LABELS[3], if( cons!APAC_SGP_RAG_STATUS_VALUES[2] = trim( fv!row.rag_status ), cons!CNAM_RAG_STATUS_LABELS[1], if( cons!APAC_SGP_RAG_STATUS_VALUES[3] = trim( fv!row.rag_status ), cons!CNAM_RAG_STATUS_LABELS[2], cons!CNAM_RAG_STATUS_LABELS[5] ) ) ), ), size: "GALLERY" ), align: "CENTER" ) }, pagingSaveInto: local!pagingInfo ) } ) } )
Discussion posts and replies are publicly visible
Hi Shikat,
You are calling the rule APAC_getEmailIntegrationCases in the data part of the grid field, instead try calling that rule on the saveInto of the submit button,save the result in a local variable and then use that in the data part of the grid field
Hiii , what difference does it make to call the rule via data part or the submit button ? please explain .
The grid data part re-execute every time you update the field value. So having the rule on the saveInto of submit button restricts it to re-execute only on the button click.
saravanann0001 said:Does your rule APAC_getEmailIntegrationCases has with() in it? If it has, then the data part re-execute every time you update the field value.
This isn't really accurate information, though. Whether the query re-executes has nothing to do with whether the expression rule contains a with() statement - a!queryEntity() itself generally re-executes any time any of the search parameters is changed, unless it's been set up specifically not to, such as in a load() variable or in an a!refreshVariable with the (default true) "refreshAfterReferencedVarChange" parameter set to FALSE.