jdbruijn:
I think you have to pass a foundset in the function as a parameter and you have to return that foundset. Something like this:
function followOnDocuments(fs) {
fs.addFoundSetFilterParam( 'referenzid', '=', id, 'follow-on documents' );
fs.loadAllRecords();
fs.sort( 'id asc' );
return fs;
}
And where you pass the function into showLookupWindow you have to remove the parentheses like this:
scopes.svyLookupWindows.showLookupWindow( event, null, ‘Charter Fakturierung’, null, followOnDocuments );
I tried the 2 following approaches, that both doesn’t work:
function showFollowOnDocuments() {
/** @type {JSEvent} */
var event = arguments[5];
var fsFollowOnDocuments = foundset.duplicateFoundSet();
var followOnDocuments = function ( fsFollowOnDocuments ) {
fsFollowOnDocuments.addFoundSetFilterParam( 'referenzid', '=', id, 'follow-on documents' );
fsFollowOnDocuments.loadAllRecords();
fsFollowOnDocuments.sort( 'id asc' );
return fsFollowOnDocuments;
}
scopes.svyLookupWindows.showLookupWindow( event, null, 'Charter Fakturierung', null, followOnDocuments );
}
In the above case, I get the warnings: “Parameter fsFollowOnDocuments hides a variable” and “The function showLookupWindow([JSEvent],String,String,[String],[String],[Object],[Array],[String],[Boolean],[String],[String],[String],[String]) is not applicable for the arguments (JSEvent,null,String,null,Function)”. So tried tried the following too:
function showFollowOnDocuments() {
/** @type {JSEvent} */
var event = arguments[5];
var followOnDocuments = function () {
var fsFollowOnDocuments = foundset.duplicateFoundSet();
fsFollowOnDocuments.addFoundSetFilterParam( 'referenzid', '=', id, 'follow-on documents' );
fsFollowOnDocuments.loadAllRecords();
fsFollowOnDocuments.sort( 'id asc' );
return fsFollowOnDocuments;
}
scopes.svyLookupWindows.showLookupWindow( event, null, 'Charter Fakturierung', null, followOnDocuments );
}
Then I get this warning: “The function showLookupWindow([JSEvent],String,String,[String],[String],[Object],[Array],[String],[Boolean],[String],[String],[String],[String]) is not applicable for the arguments (JSEvent,null,String,null,Function)”