Announcements
Seems that in WebApps Expense Reports, a user is able to Unlink an attachment even if the Expense report is Completed/Posted. We want to only allow the Unlink button to appear if the Expense Report is "In Process". I can find references to the Unlink button in the Attachments.vbhtml file in the Source code, but not sure how to add the condition of hiding/disabling the button based on the Expense Report status.
Thanks.
*This post is locked for comments
Works great, thanks!!
Ah...sorry, i assumed detail note.
Yes, put in the HeaderAttachment.vbhtml in the <script> element
Marc,
Thanks, trying to determine where exactly in the vbhtml you are suggesting this code, within the AttachmentUnlink function, or somewhere else?
Also, this would be on the HeaderAttachment.vbhtml, as we have suppressed the ability for users to link attachments for grid entries, and only allowing attachments at the Document level.
Actually...try this
add to your DetailAttachment.vbhtml
$(document).ready(function () {
if ($("#All").css('visibility') != "hidden") {
$('#unlinkPop').hide();
}
else {
$('#unlinkPop').show();
}
});
Hey Mark -
I haven't worked too much with expense, but you could try one of these 2 options...
1. the Attachment.vbhtml file uses ViewData("ReadOnly") and if True, the button is not shown; so you could force the ViewData("ReadOnly") to be True in your controller
2. the Unlink button has an id of "unlinkPop"; write JavaScript in ExpenseGrid.vbhtml to disable it if status != 'In Process' - the disabling would be something like: $('#unlinkPop').addClass('ui-disabled'); or just hide it using $('#unlinkPop').hide(); could tie to the button click that opens the Attachment with a test on status.
Again, haven't tested either, but that's where I'd start.
Good luck!
Marc
André Arnaud de Cal...
294,069
Super User 2025 Season 1
Martin Dráb
232,858
Most Valuable Professional
nmaenpaa
101,158
Moderator