I cannot able to sort it out I am passing id that id is not having degree certificate document but still the document download link is showing
Discussion posts and replies are publicly visible
balajib2642 Your query is not clear . what i understand is , are you trying to show and hide document link on the basis of a column id. could you please also put your code here. to identify the issue
a!localVariables(
/*local!data:rule!GHR_GetPersonalDetails(resourceId:ri!rid ),*/ local!document:rule!GHR_GET_MAIN_DOCUMENT_DATA_QE(rid: ri!rid), /*local!education:rule!GHR_GET_EDUCATION_DETAILS_QE(resourceId: ri!rid),*/ local!account:rule!GHR_GET_ACCOUNT_DETAILS_QE(rid: ri!rid), /* The selected navigation section */ local!activeLightweightNavSection: 1, /* The navigation sections */ local!lightweightNavSections: { "Address", "Qualification", "Previous Employment", "Accounts & Statutory", "Photo", "Resume", "Bank Statements", "LOA", "Education" }, a!columnsLayout( columns: { /* Navigation column */ a!columnLayout( contents: { a!cardLayout( contents: { a!forEach( items: local!lightweightNavSections, expression: a!cardLayout( contents: { a!sideBySideLayout( items: { a!sideBySideItem( width: "MINIMIZE" ), a!sideBySideItem( item: a!richTextDisplayField( labelPosition: "COLLAPSED", value: { a!richTextItem( text: fv!item, color: "ACCENT", style: if( local!activeLightweightNavSection = fv!index, "STRONG", "PLAIN" ) ) } ) ) } ) }, link: a!dynamicLink( saveInto: { a!save(local!activeLightweightNavSection, fv!index) } ), style: "#F7F7F7", padding: "NONE", marginBelow: "STANDARD", showBorder: false, decorativeBarPosition: "START", decorativeBarColor: if( local!activeLightweightNavSection = fv!index, "ACCENT", "#F7F7F7" ), accessibilityText: if( fv!index = local!activeLightweightNavSection, "Selected section.", "Unselected section. Press enter to select section." ) ) ) }, style: "#F7F7F7", padding: "STANDARD", showBorder: false ), a!cardLayout( height: "TALL", showWhen: not(a!isPageWidth("PHONE")), style: "#F7F7F7", padding: "STANDARD", showBorder: false ) }, width: "NARROW" ), /* Content column */ a!columnLayout( contents: { a!cardLayout( contents: a!localVariables( local!sectionLabel: index( local!lightweightNavSections, local!activeLightweightNavSection, "" ), { choose( local!activeLightweightNavSection, a!sectionLayout( label: local!sectionLabel, contents: { a!boxLayout( label: "Address",
contents: a!cardLayout( contents: a!columnsLayout( columns: { a!columnLayout( contents: { a!richTextDisplayField( value: { a!richTextItem( text: "Present Address",
link: a!documentDownloadLink( document:index(local!document,"aadhaarPic",null)
), showWhen:and(if(a!isNotNullOrEmpty(index(local!document,"aadhaarPic",{})),true(),"Not uploaded"), if(a!isNotNullOrEmpty(local!document),true(),false()) )
), a!richTextItem( text: " " ), a!richTextIcon( icon:"download", showWhen: if(a!isNotNullOrEmpty(index(local!document,"aadhaarPic",{})),true(),"Not uploaded") ) } ),
a!richTextDisplayField( value: { a!richTextItem( text: "Permanent Address", link: a!documentDownloadLink( document:index(local!document,"panPic",null)
), showWhen: if(a!isNotNullOrEmpty(index(local!document,"panPic",{})),true(),"Not uploaded") ), a!richTextItem( text: " " ), a!richTextIcon( icon:"download", showWhen: if(a!isNotNullOrEmpty(index(local!document,"panPic",{})),true(),"Not uploaded") ) } )
} /*showWhen: if(a!isNullOrEmpty(local!document),true(),"Not uploaded")*/ ), a!columnLayout( contents: {} ) } ), showBorder: false ), style: "#ffffff", isCollapsible: true() )
} ), a!sectionLayout( label: local!sectionLabel, contents: { a!boxLayout( contents: { a!columnsLayout( columns: { a!columnLayout( contents: { a!richTextDisplayField( labelPosition: "COLLAPSED", value: { a!richTextItem( text: "Degree Certificate", link: a!documentDownloadLink( document:index(local!document,"degreeCertificate",null) ), showWhen: and( if(a!isNotNullOrEmpty(index(local!document,"degreeCertificate",{})),true(),"Not uploaded"), if(a!isNotNullOrEmpty(local!document),true(),false())) ), a!richTextItem( text: " " ), a!richTextIcon( icon:"download", showWhen: if(a!isNotNullOrEmpty(index(local!document,"degreeCertificate",{})),true(),"Not uploaded") ) } ) } ), a!columnLayout( contents: { a!textField( label: "Uploaded By", labelPosition: "ABOVE", value:if(a!isNullOrEmpty(index(local!document,"createdBy",null)),{},index(local!document,"createdBy",null)), saveInto: {}, refreshAfter: "UNFOCUS", showWhen: if(a!isNotNullOrEmpty(index(local!document,"createdBy",{})),true(),"Not uploaded"), readOnly: true(), validations: {} ) } ) } /*showWhen: if(a!isNotNullOrEmpty(local!document),true(),"Not uploaded")*/ ), a!columnsLayout( columns: { a!columnLayout( contents: { a!richTextDisplayField( labelPosition: "COLLAPSED", value: {} ) } ), a!columnLayout( contents: { a!textField( label: "Uploaded On", labelPosition: "ABOVE", value:index(local!document,"createdOn",null), saveInto: {}, refreshAfter: "UNFOCUS", showWhen: if(a!isNotNullOrEmpty(index(local!document,"createdOn",{})),true(),"Not uploaded"), readOnly: true(), validations: {} ) } ) } )
}, style: "#ffffff", isCollapsible: true() ) } ), a!sectionLayout( label: local!sectionLabel, contents: { a!boxLayout( contents: { a!columnsLayout( columns: { a!columnLayout( contents: { a!richTextDisplayField( labelPosition: "COLLAPSED", value: { a!richTextItem( text: "Previous Employement", link: a!documentDownloadLink( document:index(local!document,"experienceCertificate",null) ), showWhen: if(a!isNotNullOrEmpty(index(local!document,"experienceCertificate",{})),true(),"Not uploaded") ), a!richTextItem( text: " " ), a!richTextIcon( icon:"download", showWhen: if(a!isNotNullOrEmpty(index(local!document,"experienceCertificate",{})),true(),"Not uploaded") ) } ) } /*showWhen: if(a!isNotNullOrEmpty(local!document),true(),"Not uploaded")*/ ), a!columnLayout( contents: { a!textField( label: "Uploaded By", labelPosition: "ABOVE", value:index(local!document,"createdBy",null), saveInto: {}, refreshAfter: "UNFOCUS", showWhen: if(a!isNotNullOrEmpty(index(local!document,"createdBy",{})),true(),"Not uploaded"), readOnly: true(), validations: {} ) } ) } )
}, style: "#ffffff", isCollapsible: true() ) } ), a!sectionLayout( label: local!sectionLabel, contents: { a!boxLayout( contents: { a!columnsLayout( columns: { a!columnLayout( contents: { a!columnsLayout( columns: { a!columnLayout( contents: { a!richTextDisplayField( labelPosition: "COLLAPSED", value: { a!richTextItem( text: "Aadhar", link: a!documentDownloadLink( document:index(local!document,"aadhaar",null)
), showWhen: if(a!isNotNullOrEmpty(index(local!document,"aadhaar",{})),true(),"Not uploaded") ), a!richTextItem( text: " " ), a!richTextIcon( icon:"download", showWhen: if(a!isNotNullOrEmpty(index(local!document,"aadhaar",{})),true(),"Not uploaded") ) } /*showWhen: if(a!isNotNullOrEmpty(local!document),true(),"Not uploaded")*/ ) /*a!documentViewerField(*/ /*document: local!document.aadhaar*/ /*)*/ } ), a!columnLayout( contents: { a!textField( label: "Uploaded By", labelPosition: "ABOVE", value:index(local!document,"createdBy",null), saveInto: {}, refreshAfter: "UNFOCUS", showWhen: if(a!isNotNullOrEmpty(index(local!document,"createdBy",{})),true(),"Not uploaded"), readOnly: true(), validations: {} ) } ) } ), a!columnsLayout( columns: { a!columnLayout( contents: { a!richTextDisplayField( labelPosition: "COLLAPSED", value: { a!richTextItem( text: "Bank PassBook", link: a!documentDownloadLink( document:index(local!document,"bankPassBook",null) ), showWhen: if(a!isNotNullOrEmpty(index(local!document,"bankPassBook",{})),true(),"Not uploaded") ), a!richTextItem( text: " " ), a!richTextIcon( icon:"download", showWhen: if(a!isNotNullOrEmpty(index(local!document,"bankPassBook",{})),true(),"Not uploaded") ) } /*showWhen: if(a!isNotNullOrEmpty(local!document),true(),"Not uploaded")*/ ) } ), a!columnLayout( contents: { a!textField( label: "Uploaded By", labelPosition: "ABOVE", value:index(local!document,"createdBy",null), saveInto: {}, refreshAfter: "UNFOCUS", showWhen: if(a!isNotNullOrEmpty(index(local!document,"createdBy",{})),true(),"Not uploaded"), readOnly: true(), validations: {} ) } ) } ), a!columnsLayout( columns: { a!columnLayout( contents: { a!richTextDisplayField( labelPosition: "COLLAPSED", value: { a!richTextItem( text: "PanCard", link: a!documentDownloadLink( document:index(local!document,"panPic",null) ), showWhen: if(a!isNotNullOrEmpty(index(local!document,"panPic",{})),true(),"Not uploaded")
), a!richTextItem( text: " " ), a!richTextIcon( icon:"download", showWhen: if(a!isNotNullOrEmpty(index(local!document,"panPic",{})),true(),"Not uploaded") ) } /*showWhen: if(a!isNotNullOrEmpty(local!document),true(),"Not uploaded")*/ ) } ), a!columnLayout( contents: { a!textField( label: "Uploaded By", labelPosition: "ABOVE", value:index(local!document,"createdBy",null), saveInto: {}, refreshAfter: "UNFOCUS", showWhen: if(a!isNotNullOrEmpty(index(local!document,"createdBy",{})),true(),"Not uploaded"), readOnly: true(), validations: {} ) } ) } ) } ) } ) }, style: "#ffffff", isCollapsible: true() ) } ), a!sectionLayout( label: local!sectionLabel, contents: { a!boxLayout( contents: { a!columnsLayout( columns: { a!columnLayout( contents: { a!richTextDisplayField( labelPosition: "COLLAPSED", value: { a!richTextItem( text: "Father photo", link: a!documentDownloadLink( document:index(local!document,"fatherPic",null)
), showWhen: if(a!isNotNullOrEmpty(index(local!document,"fatherPic",{})),true(),"Not uploaded") ), a!richTextItem( text: " " ), a!richTextIcon( icon:"download", showWhen: if(a!isNotNullOrEmpty(index(local!document,"fatherPic",{})),true(),"Not uploaded") ) } /*showWhen: if(a!isNotNullOrEmpty(local!document),true(),"Not uploaded")*/ ) } ), a!columnLayout( contents: { a!richTextDisplayField( labelPosition: "COLLAPSED", value: { a!richTextItem( text: "Mother Photo", link: a!documentDownloadLink( document:index(local!document,"motherPic",null) ), showWhen: if(a!isNotNullOrEmpty(index(local!document,"motherPic",{})),true(),"Not uploaded") ), a!richTextItem( text: " " ), a!richTextIcon( icon:"download", showWhen: if(a!isNotNullOrEmpty(index(local!document,"motherPic",{})),true(),"Not uploaded") ) } ) } ) } )
}, style: "#ffffff", isCollapsible: true() ) } ), a!sectionLayout( label: local!sectionLabel, contents: { a!boxLayout( contents: { a!columnsLayout( columns: { a!columnLayout( contents: { a!richTextDisplayField( labelPosition: "COLLAPSED", value: { a!richTextItem( text: "Uploaded Resume", link: a!documentDownloadLink( document:index(local!document,"resume",null) ), showWhen: if(a!isNotNullOrEmpty(index(local!document,"resume",{})),true(),"Not uploaded") ), a!richTextItem( text: " " ), a!richTextIcon( icon:"download", showWhen: if(a!isNotNullOrEmpty(index(local!document,"resume",{})),true(),"Not uploaded") ) } /*showWhen: if(a!isNotNullOrEmpty(local!document),true(),"Not uploaded")*/ ) } ) } ) }, style: "#ffffff", isCollapsible: true() ) } ), a!sectionLayout( label: local!sectionLabel, contents: { a!boxLayout( contents: { a!columnsLayout( columns: { a!columnLayout( contents: { a!textField( label: "Bank Name", labelPosition: "ABOVE", value:index(local!account,"bankName",null), saveInto: {}, refreshAfter: "UNFOCUS", showWhen: if(a!isNotNullOrEmpty(index(local!document,"bankName",{})),true(),"Not uploaded"), readOnly: true(), validations: {} ) } ), a!columnLayout( contents: { a!textField( label: "Bank Branch", labelPosition: "ABOVE", value:index(local!account,"bankBranch",null), saveInto: {}, refreshAfter: "UNFOCUS", showWhen: if(a!isNotNullOrEmpty(index(local!document,"bankBranch",{})),true(),"Not uploaded"), readOnly: true(), validations: {} ) } ) } ) }, style: "#ffffff", isCollapsible: true() ) } ), a!sectionLayout( label: local!sectionLabel, contents: { a!boxLayout( contents: { a!columnsLayout( columns: { a!columnLayout( contents: { a!richTextDisplayField( labelPosition: "COLLAPSED", value: { a!richTextItem( text: "Letter of Appontment", link: a!documentDownloadLink( document:index(local!document,"loa",null) ), showWhen: if(a!isNotNullOrEmpty(index(local!document,"loa",{})),true(),"Not uploaded") ), a!richTextItem( text: " " ), a!richTextIcon( icon:"download", showWhen: if(a!isNotNullOrEmpty(index(local!document,"loa",{})),true(),"Not uploaded") ) } /*showWhen: if(a!isNotNullOrEmpty(index(local!document),true(),"Not uploaded")*/ ) } ) } ) }, style: "#ffffff", isCollapsible: true() ) } ), a!sectionLayout( label: local!sectionLabel, contents: { a!boxLayout( contents: { a!columnsLayout( columns: { a!columnLayout( contents: { a!richTextDisplayField( labelPosition: "COLLAPSED", value: { a!richTextItem( text: "10th Marksheet", link: a!documentDownloadLink( document:index(local!document,"TenthMarksheet",null), showWhen: if(a!isNotNullOrEmpty(index(local!document,"TenthMarksheet",{})),true(),"Not uploaded") ) ), a!richTextItem( text: " " ), a!richTextIcon( icon:"download", showWhen: if(a!isNotNullOrEmpty(index(local!document,"TenthMarksheet",{})),true(),"Not uploaded") ) } ) } ), a!columnLayout( contents: { a!richTextDisplayField( labelPosition: "COLLAPSED", value: { a!richTextItem( text: "Twelth Marksheet", link: a!documentDownloadLink( document: index(local!document,"TwelthMarksheet",null) ), showWhen: if(a!isNotNullOrEmpty(index(local!document,"TwelthMarksheet",{})),true(),"Not uploaded") ), a!richTextItem( text: " " ), a!richTextIcon( icon:"download" ) }, showWhen: if(a!isNotNullOrEmpty(local!document),true(),"Not uploaded") ) } ) } ) }, style: "#ffffff", isCollapsible: true() ) } ) ) } ), padding: "STANDARD", showBorder: "NONE" ) } ) } ) )
Are you saying the id what you are holding is not the correct document Id . the document id is not available or not holding the degree document in it .
is the document name upload a common name or it can be any random name
/*local!data:rule!GHR_GetPersonalDetails(resourceId:ri!rid ),*/ local!document:{ aadhaarPic:46 }, /*local!education:rule!GHR_GET_EDUCATION_DETAILS_QE(resourceId: ri!rid),*/ /*local!account:rule!GHR_GET_ACCOUNT_DETAILS_QE(rid: ri!rid),*/ /* The selected navigation section */ local!activeLightweightNavSection: 1, /* The navigation sections */ local!lightweightNavSections: { "Address", "Qualification", "Previous Employment", "Accounts & Statutory", "Photo", "Resume", "Bank Statements", "LOA", "Education" }, a!columnsLayout( columns: { a!columnLayout( contents: {
a!richTextDisplayField( value: {
a!richTextItem( text: "Present Address",
)
), a!richTextItem( text: " " ), a!richTextIcon( icon:"download", showWhen: if(a!isNotNullOrEmpty(index(local!document,"aadhaarPic",{})),true(),"Not uploaded") ) }, showWhen: and( if( a!isNotNullOrEmpty(index(local!document, "aadhaarPic", {})), true(), false() ), if( document(todocument(index(local!document, "aadhaarPic", {})),"name")<>"Adhar card", false(), true() ), if( a!isNotNullOrEmpty(local!document), true(), false() ) ) ),
), showWhen: if(a!isNotNullOrEmpty(index(local!document,"panPic",{})),true(),false()) ), a!richTextItem( text: " " ), a!richTextIcon( icon:"download", showWhen: if(a!isNotNullOrEmpty(index(local!document,"panPic",{})),true(),false()) )
}
} /*showWhen: if(a!isNullOrEmpty(local!document),true(),"Not uploaded")*/ ), a!columnLayout( contents: {} ) } ))
actuualy for the particular id there is no document in database it is showing null,... but the document download link is showing ,
I also kept showwhen conditions
could you please provide the data you have for the display purpose . I would like to see the data structure for more clarification . Please print the data in the UI using a textfield() and see what actually you are receiving and also share so that i can try with same data in your UI code