• JDELIST is celebrating its 20 year anniversary today!
  • Introducing Dark Mode! Switch by clicking on the lightbulb icon next to Search or by clicking on Default style at the bottom left of the page!

Suppress Warnings

nkuebelbeck

VIP Member
Is there a way to suppress warnings on a specific form all together?

OR

Specifically, I'm trying to suppress warning when executing B4200310.F4211FSEditline

Thanks
 

BOster

Legendary Poster
The only way I have managed to do anything like this in the past is to wrap the called BSFN in another BSFN and then use:

jdeErrorSetToFirstEx
jdeErrorGetNextDDItemNameInfoEx
jdeErrorSetToFirstEx

to interrogate the error stack and if there are ONLY warnings/info then call

jdeErrorClearEx

If there is at least one error then effectively show all errors and warnings:

psuedo code:
Code:
ID MyF4211FSEditLineWrapperSuppressWarn(LPBHVRCOM lpBhvrCom, LPVOID lpVoid, LPDSD4200310F lpDS)
{
	idReturn = callObject(F4211FSEditLine, lpBhvrCom, lpVoid, lpDS);
	
	jdeErrorSetToFirstEx;
	
	while(jdeErrorGetNextDDItemNameInfoEx returns next error in stack)
	{
		If(is error type)
		{
			hasError=TRUE;
		   break;
		}
	}
	
	jdeErrorSetToFirstEx;

	if(!hasError)
		jdeErrorClearEx;
		
	return idReturn;
}
 

BOster

Legendary Poster
I have used this technique on several occasions and it appears to work. Kind of weird when there is an error because all of a sudden the user gets the error along with all the warnings that would normally be suppressed. In general I usually try and stay away from doing something like this because it just feels kind of "fragile" for lack of a better term. But I have used it.

FYI, just looked and I have used it as recently as 2011. Snippet from production code:

Code:
	/* Suppress Warnings */
	acmeCallObject(AcmeGetErrorCount, lpBhvrCom, lpVoid, &dsErrCount);

	if(dsErrCount.nWarningCount > 0 && dsErrCount.nErrorCount == 0)
		jdeErrorClearEx(lpBhvrCom, lpVoid);
 
Last edited:
Top