Well, I did not understand your question right, but just click on the div, because the child click is executed first ...
$(function() {
let appid;
$('#dsmenu').click(function() {
runOrder(appid);
});
$('#dsmenu').children().first().click(function dsFile() {
$(".corpoDsfile").show();
$(".corpoReport").hide();
$(".corpoMonitor").hide();
console.log("RTB1 foi clicado");
appid = "RTB1"
});
$('#dsmenu').children().last().click(function dsFile() {
$(".corpoDsfile").show();
$(".corpoReport").hide();
$(".corpoMonitor").hide();
console.log("RTB2 foi clicado");
appid = "RTB2"
});
function runOrder(appid) {
$("#error").hide() // hide the error from any previous execution
console.log('runOrder(appid), appid=',appid);
}
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><liclass="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">Direct Ship File</a>
<div class="dropdown-menu" id="dsmenu">
<a class="dropdown-item" href="#" id="RTB1">RTB1</a>
<a class="dropdown-item" href="#" id="RTB2">RTB2</a>
</div>
</li>