= load( local!selectAllLoans: null, local!selectLoans: null, local!poData: {}, local!selectGrid: 25, local!test: 0, local!pagingInformation: a!pagingInfo( startIndex: 1, batchSize: - 1 ), local!pagingInfoSearch: a!pagingInfo( startIndex: 1, batchSize: local!selectGrid, sort: a!sortInfo( field: "dataCorrectionRequestIdentifier", ascending: true ) ), local!pagingInfo: a!pagingInfo( startIndex: 1, batchSize: local!selectGrid, sort: a!sortInfo( field: "dataCorrectionRequestIdentifier", ascending: true ) ), local!gridSelection: a!gridSelection( pagingInfo: local!pagingInfo ), local!pagingInfoExport: a!pagingInfo( startIndex: 1, batchSize: - 1, sort: a!sortInfo( field: "dataCorrectionRequestIdentifier", ascending: true ) ), local!selectedLoans: {}, local!loanCount: 0, local!searchPFDC: 'type!{com.freddiemac.pfdc}PFDC_searchPFDC'(), local!searchPFDCExisting: 'type!{com.freddiemac.pfdc}PFDC_searchPFDC'(), local!totalCount: if( or( rule!PFDC_isBlank( ri!searchPFDC ), local!searchPFDC = ri!searchPFDC ), local!test, rule!PFDC_getSearchCount( ri!searchPFDC, local!pagingInformation ) ), local!poDataToLoad: if( or( rule!PFDC_isBlank( ri!searchPFDC ), local!searchPFDC = ri!searchPFDC ), {}, if( local!totalCount > cons!PFDC_DC_SEARCH_RESULT_LIMIT_COUNT, todatasubset( rule!PFDC_getCompleteDataset( ri!searchPFDC, cons!PFDC_DC_SEARCH_RESULT_LIMIT_COUNT ), local!pagingInfo ), rule!PFDC_queryDataCorrection( ri!searchPFDC, local!pagingInfo ) ) ), local!selectedDataCorrections: if( rule!PFDC_isBlank( ri!selectedDataCorrections ), {}, ri!selectedDataCorrections ), local!searchAction: if( rule!PFDC_isBlank( ri!searchPFDC ), {}, "searchPFDC" ), local!dataCorrectionResult: {}, local!searchLoanOrPfdc: "PFDC", local!isGridAction: false(), local!selectedDcList, local!isClear: false, local!isBillable: false, /*tushar*/ local!billableValidation: false, local!loggedInSeller: rule!PFDC_getSellerNumber(), local!loggedInServicer: rule!PFDC_getServicerNumber(), local!isSellerNumberAvailable: if( rule!PFDC_isBlank( local!loggedInSeller ), false(), true() ), local!isServicerNumberAvailable: if( rule!PFDC_isBlank( local!loggedInServicer ), false(), true() ), local!defaultReviewGroupList: index( cons!PFDC_APPROVAL_GROUPS_CHOICE_VALUES, wherecontains( getgroupnames( getgroupsformemberuser( loggedInUser() ) ), cons!PFDC_APPROVAL_GROUPS_CHOICE_VALUES ) ), local!defaultReviewGroup: if( rule!PFDC_isExternalUser( loggedInUser() ), "", if( rule!PFDC_isBlank( local!defaultReviewGroupList ), "", local!defaultReviewGroupList[1] ) ), local!originalDefaultReviewGroup: local!defaultReviewGroup, local!originalDefaultSellerNumber: local!loggedInSeller, local!originalDefaultServicerNumber: local!loggedInServicer, local!isExternalUserLoggedIn: if( rule!PFDC_isExternalUser( loggedInUser() ), true, false ), local!selectedDataCorrectionDetails_currentPage, local!selectedDataCorrectionDetails, local!selectedDataCorrectionDetails_total, local!completeDatasubset, with( local!isError: rule!PFDC_isBlank( rule!PFDC_textValidation( ri!searchPFDC.fmLoanNumber, 9 ) ), /* check if search criteria is empty for validation */ local!isSearchPFDCNull: if( and( rule!PFDC_isBlank( ri!searchPFDC ), rule!PFDC_isBlank( local!defaultReviewGroup ), and( rule!PFDC_isBlank( local!loggedInSeller ), rule!PFDC_isBlank( local!loggedInServicer ) ) ), "true", if( and( rule!PFDC_isSearchPfdcEmpty( ri!searchPFDC, if( isExternalUserLoggedIn, "external", "internal" ) ), rule!PFDC_isBlank( local!defaultReviewGroup ) ), "true", "false" ) ), local!totalCount: if( rule!PFDC_isBlank( local!poDataToLoad ), {}, if( and( local!isGridAction, ri!searchAction = "searchPFDC", not( local!isSearchPFDCNull ) ), rule!PFDC_getSearchCount( local!searchPFDCExisting, local!pagingInformation ), local!totalCount ) ), local!datasubset: if( rule!PFDC_isBlank( local!poDataToLoad ), {}, if( and( local!isGridAction, ri!searchAction = "searchPFDC", not( local!isSearchPFDCNull ) ), if( local!totalCount > cons!PFDC_DC_SEARCH_RESULT_LIMIT_COUNT, todatasubset( rule!PFDC_getCompleteDataset( local!searchPFDCExisting, cons!PFDC_DC_SEARCH_RESULT_LIMIT_COUNT ), local!gridSelection.pagingInfo ), rule!PFDC_queryDataCorrection( local!searchPFDCExisting, local!gridSelection.pagingInfo ) ), local!poDataToLoad ) ), local!toDeselectAll: if( rule!PFDC_isBlank( local!datasubset ), false, if( or( local!datasubset.totalCount = local!loanCount, /*length(local!completeDatasubset) = local!loanCount*/ if( rule!PFDC_isBlank( local!selectedDataCorrectionDetails_total ), "false", length( local!selectedDataCorrectionDetails_total ) = local!loanCount ) ), "true", "false" ) ), { /* List of input fields to provide search criteria */ a!sectionLayout( label: "", firstColumnContents: { a!richTextDisplayField( label: "", labelPosition: "COLLAPSED", value: a!richTextItem( text: "Data Correction Created Date", style: "STRONG" ) ), a!dateField( label: "From:", labelPosition: cons!PFDC_LABELPOSITION, value: ri!searchPFDC.DCCreatedFromDT, saveInto: { a!save( ri!searchPFDC.DCCreatedFromDT, rule!PFDC_formatDateEDT( save!value ) ), a!save( local!isGridAction, false() ), } ), a!dateField( label: "To:", labelPosition: cons!PFDC_LABELPOSITION, value: ri!searchPFDC.DCCreatedToDT, saveInto: { a!save( ri!searchPFDC.DCCreatedToDT, rule!PFDC_formatDateEDT( save!value ) ), a!save( local!isGridAction, false() ), } ), a!textField( label: "AAA:", labelPosition: cons!PFDC_LABELPOSITION, align: "LEFT", value: ri!searchPFDC.fmLoanNumber, validations: rule!PFDC_midasLoanNumberValidation( ri!searchPFDC.fmLoanNumber, 9 ), saveInto: { ri!searchPFDC.fmLoanNumber, a!save( local!isGridAction, false() ), } ), a!textField( label: "BBB:", labelPosition: cons!PFDC_LABELPOSITION, readOnly: false, align: "LEFT", value: ri!searchPFDC.DCIdentifier, saveInto: { ri!searchPFDC.DCIdentifier, a!save( local!isGridAction, false() ), } ), a!dropdownField( label: "Data Correction Status:", labelPosition: cons!PFDC_LABELPOSITION, choiceLabels: cons!PFDC_DC_STATUS_CHOICE_LABELS, choiceValues: cons!PFDC_DC_STATUS_CHOICE_VALUES, placeholderLabel: " ", value: ri!searchPFDC.DCStatus, saveInto: { ri!searchPFDC.DCStatus, a!save( local!isGridAction, false() ), } ), a!dropdownField( label: "Evaluation Status:", labelPosition: cons!PFDC_LABELPOSITION, choiceLabels: cons!PFDC_EVALUATION_STATUS_CHOICE_LABELS_TO_DISPLAY, choiceValues: cons!PFDC_EVALUATION_STATUS_CHOICE_VALUES_TO_DISPLAY, placeholderLabel: " ", value: ri!searchPFDC.evaluationStatus, saveInto: { ri!searchPFDC.evaluationStatus, a!save( local!isGridAction, false() ), } ), if( rule!PFDC_isExternalUser( loggedInUser() ), {}, a!dropdownField( label: "Pending Action:", labelPosition: cons!PFDC_LABELPOSITION, choiceLabels: cons!PFDC_APPROVAL_GROUPS_CHOICE_LABELS, choiceValues: cons!PFDC_APPROVAL_GROUPS_CHOICE_VALUES, placeholderLabel: " ", value: if( ri!inputDefaultReviewGroup = "default", local!originalDefaultReviewGroup, local!defaultReviewGroup ), saveInto: { a!save( local!defaultReviewGroup, save!value ), a!save( ri!searchPFDC.ReviewAssignedTo, save!value ), a!save( local!isGridAction, false() ), a!save( ri!inputDefaultReviewGroup, "" ) } ) ), }, secondcolumncontents: { a!richTextDisplayField( label: "", labelPosition: "COLLAPSED", value: a!richTextItem( text: "Data Correction Completed Date", style: "STRONG" ) ), a!dateField( label: "From:", labelPosition: cons!PFDC_LABELPOSITION, value: ri!searchPFDC.DCCompletedFromDT, saveInto: { a!save( ri!searchPFDC.DCCompletedFromDT, rule!PFDC_formatDateEDT( save!value ) ), a!save( local!isGridAction, false() ), } ), a!dateField( label: "To:", labelPosition: cons!PFDC_LABELPOSITION, align: "LEFT", value: ri!searchPFDC.DCCompletedToDT, saveInto: { a!save( ri!searchPFDC.DCCompletedToDT, rule!PFDC_formatDateEDT( save!value ) ), a!save( local!isGridAction, false() ), } ), a!textField( label: "User Assigned Name:", labelPosition: cons!PFDC_LABELPOSITION, align: "LEFT", value: ri!searchPFDC.userAssignedName, saveInto: { ri!searchPFDC.userAssignedName, a!save( local!isGridAction, false() ), } ), a!textField( label: "Seller Loan Identifier:", labelPosition: cons!PFDC_LABELPOSITION, value: ri!searchPFDC.SellerLoanIdentifier, saveInto: { ri!searchPFDC.SellerLoanIdentifier, a!save( local!isGridAction, false() ), } ), a!textField( label: "CC:", labelPosition: cons!PFDC_LABELPOSITION, value: ri!searchPFDC.ServicerLoanIdentifier, saveInto: { ri!searchPFDC.ServicerLoanIdentifier, a!save( local!isGridAction, false() ) } ), /* If external user, we don't need to display Seller Number and Servicer Number */if( rule!PFDC_isExternalUser( loggedInUser() ), {}, { a!textField( label: "DD:", labelPosition: cons!PFDC_LABELPOSITION, value: if( ri!defaultSellerNumber = "default", local!originalDefaultSellerNumber, local!loggedInSeller ), disabled: if( local!isSellerNumberAvailable, true(), false() ), saveInto: { ri!searchPFDC.SellerAccountIdentifier, a!save( local!loggedInSeller, save!value ), a!save( local!isGridAction, false() ), a!save( ri!defaultSellerNumber, "" ) } ), a!textField( label: "EE:", labelPosition: cons!PFDC_LABELPOSITION, value: if( ri!defaultServicerNumber = "default", local!originalDefaultServicerNumber, local!loggedInServicer ), disabled: if( local!isServicerNumberAvailable, true(), false() ), saveInto: { ri!searchPFDC.ServicerAccountIdentifier, a!save( local!loggedInServicer, save!value ), a!save( local!isGridAction, false() ), a!save( ri!defaultServicerNumber, "" ) } ) } ), }, validations: if( local!isSearchPFDCNull, a!validationMessage( message: "A value must be provided for at least one field.", validateAfter: "SUBMIT" ), "" ), validationGroup: "searchPFDC", isCollapsible: true ), a!sectionLayout( label: "", firstColumnContents: { a!buttonLayout( primarybuttons: { a!buttonWidget( label: "Search Post Fund Data Correction Record", validate: true(), validationGroup: "searchPFDC", value: if( local!isSearchPFDCNull, "x", "searchPFDC" ), saveInto: { ri!searchAction, a!save( local!isGridAction, false() ), a!save( local!isClear, false ), a!save( local!loanCount, 0 ), a!save( local!selectedDataCorrections, null ), a!save( local!gridSelection.pagingInfo, local!pagingInfo ), /* Setup seller number as search criteria for external users */ a!save( ri!searchPFDC.SellerAccountIdentifier, if( rule!PFDC_isExternalUser( loggedInUser() ), local!loggedInSeller, local!loggedInSeller ) ), /* Setup servicer number as search criteria for external users */ a!save( ri!searchPFDC.ServicerAccountIdentifier, if( rule!PFDC_isExternalUser( loggedInUser() ), local!loggedInServicer, local!loggedInServicer ) ), a!save( ri!searchPFDC.ReviewAssignedTo, if( rule!PFDC_isExternalUser( loggedInUser() ), {}, local!defaultReviewGroup ) ), a!save( local!searchPFDCExisting, ri!searchPFDC ), a!save( local!poDataToLoad, if( or( local!isSearchPFDCNull, not( local!isError ) ), {}, if( rule!PFDC_getSearchCount( ri!searchPFDC, local!pagingInformation ) > cons!PFDC_DC_SEARCH_RESULT_LIMIT_COUNT, todatasubset( rule!PFDC_getCompleteDataset( ri!searchPFDC, cons!PFDC_DC_SEARCH_RESULT_LIMIT_COUNT ), local!pagingInfo ), rule!PFDC_queryDataCorrection( ri!searchPFDC, local!pagingInfo ) ) ) ), a!save( local!gridSelection.selected, {} ) } ) } ) }, secondColumnContents: { a!buttonLayout( secondarybuttons: { a!buttonWidget( label: "Clear Entries", value: "Cancel", validationGroup: "cancel", saveInto: { a!save( ri!searchPFDC, local!searchPFDC ), a!save( local!defaultReviewGroup, local!originalDefaultReviewGroup ), a!save( local!loggedInSeller, local!originalDefaultSellerNumber ), a!save( local!loggedInServicer, local!originalDefaultServicerNumber ), a!save( local!isClear, true ) } ), a!buttonWidgetSubmit( label: "Export to Excel", value: cons!PFDC_USER_ACTION_EXPORT, validate: true(), validationGroup: "searchPFDC", saveInto: { ri!searchAction, a!save( ri!searchPFDC.ReviewAssignedTo, if( rule!PFDC_isExternalUser( loggedInUser() ), {}, local!defaultReviewGroup ) ), a!save( ri!searchPFDC.SellerAccountIdentifier, if( rule!PFDC_isExternalUser( loggedInUser() ), local!loggedInSeller, local!loggedInSeller ) ), a!save( ri!searchPFDC.ServicerAccountIdentifier, if( rule!PFDC_isExternalUser( loggedInUser() ), local!loggedInServicer, local!loggedInServicer ) ), a!save( ri!downloandExcel, null ), a!save( ri!selectedDataCorrections, if( local!isSearchPFDCNull, {}, rule!PFDC_getCompleteDataset( ri!searchPFDC, null ) ) ), } ) } ) } ), if( or( ri!searchAction = "searchPFDC", if( ri!searchAction = "searchPfdcApp", true(), rule!PFDC_isValidUserAction( ri!searchAction ) ) ), { if( ri!searchAction = cons!PFDC_USER_ACTION_EXPORT, if( isnull( ri!downloandExcel ), { if( rule!PFDC_isBlank( ri!exportLimitError ), rule!PFDC_displayErrorMessage( "No items available to Export" ), rule!PFDC_displayErrorMessage( ri!exportLimitError ) ) }, a!linkField( label: "Download Link:", readOnly: true, labelPosition: "ADJACENT", links: a!documentDownloadLink( document: todocument( ri!downloandExcel ), label: "Search Report Excel" ) ) ), { a!sectionLayout( label: "", firstColumnContents: { a!buttonLayout( primaryButtons: {}, secondaryButtons: if( rule!PFDC_isBlank( local!datasubset ), {}, if( local!datasubset.totalCount > 0, { a!buttonWidget( label: if( local!toDeselectAll, "Deselect All", "Select All" ), style: "NORMAL", value: "selectAll", saveInto: { a!save( local!isClear, false ), a!save( local!isGridAction, false() ), a!save( local!selectedDataCorrectionDetails_total, if( local!toDeselectAll, {}, rule!PFDC_getCompleteDataset( ri!searchPFDC, null ) ) ), a!save( local!gridSelection.selected, if( local!toDeselectAll, {}, if( rule!PFDC_isBlank( local!selectedDataCorrectionDetails_total ), {}, local!selectedDataCorrectionDetails_total.dataCorrectionRequestIdentifier ) ) /*rule!test_gridSelected(local!toDeselectAll,local!selectedDataCorrectionDetails_total)*/ ), a!save( local!selectedDataCorrections, if( local!toDeselectAll, {}, if( rule!PFDC_isBlank( local!selectedDataCorrectionDetails_total ), {}, local!selectedDataCorrectionDetails_total.dataCorrectionRequestIdentifier ) ) ), a!save( local!loanCount, if( local!toDeselectAll, 0, count( local!gridSelection.selected ) ) ), a!save( ri!multipleLoanUserActionError, "" ) } ), a!buttonWidget( label: "View Data Correction History", value: "searchDataCorrectionHistory", submit: if( local!loanCount < 1, true, false ), validationGroup: if( local!loanCount < 1, "submit", "" ), saveInto: { ri!searchLink, a!save( local!isClear, false ), a!save( ri!selectedDataCorrections, local!selectedDataCorrectionDetails_total ), a!save( ri!multipleLoanUserActionError, "" ) } ), a!buttonWidgetSubmit( label: "View/Modify", style: "NORMAL", validationGroup: if( local!loanCount < 1, "submit", "submit" ), value: cons!PFDC_USER_ACTION_PFDC_VIEW_MODIFY, saveInto: { local!searchAction, a!save( local!isClear, false ), a!save( ri!searchAction, local!searchAction ), a!save( ri!loanCount, local!loanCount ), a!save( ri!selectedDataCorrections, local!selectedDataCorrectionDetails_total ), a!save( ri!searchLoanOrPfdc, local!searchLoanOrPfdc ) } ), if( and( or( ri!searchAction = cons!PFDC_USER_ACTION_EVALUATE, ri!searchAction = "Refresh" ), local!loanCount < 1 ), a!buttonWidgetSubmit( label: "Refresh", style: "NORMAL", value: "Refresh", saveInto: { local!searchAction, a!save( local!isClear, false ), a!save( ri!searchAction, local!searchAction ), } ), {} ) }, {} ) ) ), }, secondColumnContents: { a!buttonLayout( primarybuttons: {}, secondaryButtons: if( rule!PFDC_isBlank( local!datasubset ), {}, if( local!datasubset.totalCount > 0, { a!buttonWidgetSubmit( label: "Evaluate", style: "NORMAL", confirmMessage: "You are about to start Evaluate process, please use 'Refresh' button to get the status of request. Do you want to continue?", validationGroup: if( local!loanCount < 1, "submit", "" ), value: cons!PFDC_USER_ACTION_EVALUATE, disabled: if( rule!PFDC_canEvaluateLoan( loggedinuser() ), false, true ), saveInto: { local!searchAction, a!save( local!isClear, false ), a!save( ri!searchAction, local!searchAction ), a!save( ri!selectedDataCorrections, local!selectedDataCorrectionDetails_total ) } ), a!buttonWidgetSubmit( label: "Apply", style: "NORMAL", confirmMessage: "Data Correction(s) will be applied", validationGroup: if( local!loanCount < 1, "submit", "" ), value: cons!PFDC_USER_ACTION_APPLY, disabled: if( rule!PFDC_canApplyLoanDataCorrections( loggedinuser() ), false, true ), saveInto: { local!searchAction, a!save( local!isClear, false ), a!save( ri!searchAction, local!searchAction ), a!save( ri!selectedDataCorrections, local!selectedDataCorrectionDetails_total ), } ), a!buttonWidgetSubmit( label: "Withdraw", style: "NORMAL", confirmMessage: "Data Correction(s) will be withdrawn", validationGroup: if( local!loanCount < 1, "submit", "" ), value: cons!PFDC_USER_ACTION_WITHDRAW, disabled: if( rule!PFDC_canWithdrawLoan( loggedinuser() ), false, true ), saveInto: { local!searchAction, a!save( local!isClear, false ), a!save( ri!searchAction, local!searchAction ), a!save( ri!selectedDataCorrections, local!selectedDataCorrectionDetails_total ), } ), a!buttonWidgetSubmit( label: "Approve", style: "NORMAL", confirmMessage: "Data Correction(s) will be approved", validationGroup: if( local!loanCount < 1, "submit", "" ), value: cons!PFDC_USER_ACTION_APPROVE, disabled: if( rule!PFDC_canApproveLoanCorrections( loggedinuser() ), false, true ), saveInto: { local!searchAction, a!save( local!isClear, false ), a!save( ri!searchAction, local!searchAction ), a!save( ri!selectedDataCorrections, local!selectedDataCorrectionDetails_total ), } ), if( rule!PFDC_isUserInvestorReporting( loggedinuser() ), { a!buttonWidget( label: "Billable", style: "NORMAL", /*confirmMessage:"Data Correction(s) will be withdrawn as 'Billable'",*/ validate: true(), validationGroup: if( local!loanCount < 1, "submit", "" ), value: cons!PFDC_USER_ACTION_BILLABE, submit: if( local!billableValidation, true(), false() ), saveInto: { local!searchAction, a!save( local!isBillable, true ), a!save( local!isClear, false ), a!save( ri!searchAction, local!searchAction ), a!save( ri!selectedDataCorrections, local!selectedDataCorrectionDetails_total ), } ), a!buttonWidget( label: "Non Billable", style: "NORMAL", /*confirmMessage:"You are about to make the selected corrcetions as 'Non Billable', Do you want to continue?",*/ validate: true(), validationGroup: if( local!loanCount < 1, "submit", "" ), value: cons!PFDC_USER_ACTION_NONBILLABE, submit: if( local!billableValidation, true(), false() ), saveInto: { local!searchAction, a!save( local!isBillable, true ), a!save( local!isClear, false ), a!save( ri!searchAction, local!searchAction ), a!save( ri!selectedDataCorrections, local!selectedDataCorrectionDetails_total ), } ) }, {} ) }, {} ) ) ) }, validations: if( local!loanCount < 1, a!validationMessage( message: "At least one loan must be selected to Process.", validateAfter: "SUBMIT" ), if( and( local!loanCount > 25 ), a!validationMessage( message: "Maximum loans to view/modify is limited to 25. Please select less than or equal to 25 loans", validateAfter: "SUBMIT" ), if( local!isBillable, if( not( rule!PFDC_isBillableSelectionInRange( ri!selectedDataCorrections.lastUpdatedDateTime ) ), a!validationMessage( message: "Unable to" & if( local!searchAction = cons!PFDC_USER_ACTION_NONBILLABE, " remove fee from ", " assess a fee to " ) & "the data correction", validationAfter: "SUBMIT" ), "" ), "" ) ) ), validationGroup: "submit" ), if( ri!searchAction = "Refresh", if( rule!PFDC_isBlank( rule!PFDC_getProcessErrorsByID( ri!processID ) ), {}, rule!PFDC_applicationErrorForm( rule!PFDC_getProcessErrorsByID( ri!processID ) ) ), {} ), if( and( or( ri!searchAction = cons!PFDC_USER_ACTION_APPLY, ri!searchAction = cons!PFDC_USER_ACTION_NONBILLABE, ri!searchAction = cons!PFDC_USER_ACTION_BILLABE, ri!searchAction = cons!PFDC_USER_ACTION_APPROVE, ri!searchAction = cons!PFDC_USER_ACTION_WITHDRAW, ri!searchAction = cons!PFDC_USER_ACTION_EVALUATE ), true() ), if( rule!PFDC_isBlank( ri!multipleLoanUserActionError ), {}, rule!PFDC_displayErrorMessage( ri!multipleLoanUserActionError ) ), {} ), a!gridField( label: "", instructions: "Total Selected :" & local!loanCount, totalCount: local!datasubset.totalCount, columns: { a!gridTextColumn( label: "User Assigned Name", field: "userAssignedRequestName", data: index( local!datasubset.data, "userAssignedRequestName", {} ) ), a!gridTextColumn( label: "Freddie Mac Loan Number", field: "midasLoanIdentifier", data: index( local!datasubset.data, "midasLoanIdentifier", {} ) ), a!gridTextColumn( label: "Seller Loan Identifier", field: "sellerLoanIdentifier", data: index( local!datasubset.data, "sellerLoanIdentifier", {} ) ), a!gridTextColumn( label: "Servicer Loan Identifier", field: "servicerLoanIdentifier", data: index( local!datasubset.data, "servicerLoanIdentifier", {} ) ), a!gridTextColumn( label: "Borrower Last Name", field: "primaryBorrowerLastName", data: index( local!datasubset.data, "primaryBorrowerLastName", {} ) ), a!gridTextColumn( label: "Investor Contract Identifier", field: "contractIdentifier", data: index( local!datasubset.data, "contractIdentifier", {} ) ), a!gridTextColumn( label: "Pool Number", field: "poolIdentifier", data: apply( rule!PFDC_displayPoolNumber, merge( index( local!datasubset.data, "contractExecutionMethodType", {} ), index( local!datasubset.data, "poolIdentifier", {} ) ), loggedInUser() ) ), a!gridTextColumn( label: "Seller Number", field: "sellerAccountIdentifer", data: index( local!datasubset.data, "sellerAccountIdentifer", {} ) ), a!gridTextColumn( label: "Servicer Number", field: "servicerAccountIdentifer", data: index( local!datasubset.data, "servicerAccountIdentifer", {} ) ), a!gridTextColumn( label: "Data Correction Identifier", field: "dataCorrectionRequestIdentifier", data: index( local!datasubset.data, "dataCorrectionRequestIdentifier", {} ) ), a!gridTextColumn( label: "Data Correction Creation Date", field: "requestCreateDateTime", data: apply( rule!PFDC_displayDateForSearchResults, index( local!datasubset.data, "requestCreateDateTime", {} ) ) ), a!gridTextColumn( label: "Data Correction Last Updated Date", field: "lastUpdatedDateTime", data: apply( rule!PFDC_displayDateForSearchResults, index( local!datasubset.data, "lastUpdatedDateTime", {} ) ) ), a!gridTextColumn( label: "Evaluation Status", field: "overallEvaluationWorkflowStatusType", data: apply( rule!PFDC_displayEvaluationStatus, index( local!datasubset.data, "overallEvaluationWorkflowStatusType", {} ) ) ), a!gridTextColumn( label: "Data Correction Status", field: "dataCorrectionStatusType", data: apply( rule!PFDC_displayDataCorrectionStatus, index( local!datasubset.data, "dataCorrectionStatusType", {} ) ) ), if( rule!PFDC_isUserInvestorReporting( loggedinuser() ), a!gridTextColumn( label: "Billable Status", field: "correctionBillableIndicator", data: apply( rule!PFDC_getBillabelIndicatorDisplayValue, index( local!datasubset.data, "correctionBillableIndicator", {} ) ) ), {} ), /* Needs to be shown only for internal users */ if( rule!PFDC_isExternalUser( loggedinuser() ), {}, a!gridTextColumn( label: "Review Status", field: "dataCorrectionRequestIdentifier", data: apply( rule!PFDC_returnTextForGrid, index( local!datasubset.data, "dataCorrectionRequestIdentifier", {} ), "View Review Status" ), links: apply( a!dynamicLink( value: _, saveInto: ri!selectedDataCorrectionID ), index( local!datasubset.data, "dataCorrectionRequestIdentifier", {} ) ) ) ) }, identifiers: index( local!datasubset.data, "dataCorrectionRequestIdentifier", {} ), value: local!gridSelection, saveInto: { local!gridSelection, a!save( local!isGridAction, true() ), a!save( ri!searchLoanOrPfdc, local!searchLoanOrPfdc ), local!selectedDataCorrections << index( _, "selected", null ), a!save( local!loanCount, count( local!selectedDataCorrections ) ), a!save( local!billableValidation, if( count( local!selectedDataCorrections ) > 0, if( rule!PFDC_isBillableSelectionInRange( if( rule!PFDC_isBlank( ri!selectedDataCorrections ), now(), ri!selectedDataCorrections.lastUpdatedDateTime ) ), "true", "false" ), false ) ), a!save( ri!multipleLoanUserActionError, "" ), a!save( local!selectedDataCorrectionDetails_currentPage, index( local!datasubset.data, wherecontains( cast( 101, local!selectedDataCorrections ), cast( 101, local!datasubset.data.dataCorrectionRequestIdentifier ) ) ) ), a!save( local!selectedDataCorrectionDetails, if( rule!PFDC_isBlank( local!selectedDataCorrectionDetails ), local!selectedDataCorrectionDetails_currentPage, append( local!selectedDataCorrectionDetails, difference( local!selectedDataCorrectionDetails_currentPage, local!selectedDataCorrectionDetails ) ) ) ), a!save( local!selectedDataCorrectionDetails_total, if( rule!PFDC_isBlank( local!selectedDataCorrectionDetails ), {}, filter( rule!PFDC_ifContainsDC, local!selectedDataCorrectionDetails, local!selectedDataCorrections ) ) ) }, selection: true ), } ) }, {} ) } ) )