Notifications
Announcements
No record found.
Hi,
Greetings!
I have created a CoC method and in there I am handling an error generated by the standard code.
But, the standard code generates an error message which is no longer needed.
Can we hide or suppress the error message?
With best regards,
Abhinay
Hi Abhinay,
Normally you can't suppress error messages thrown from the standard code as standard code is always going to be executed. However, if the error message is being thrown based on a certain condition, you might be able to set some values so that the condition evaluated to false and the error message is not thrown.
Could you please share the standard code where the error is being thrown so that we can check if this will be doable?
Hi Gunjan,
Thank you for your reply.
Unfortunately there seems to be no condition to control it.
ProjTable::generateNextSubProjectId
Inside this method
NumberSeq::numInsertFormat
then
NumberSeq::numInsertFormatV2
and
NumberSeq::numInsertFormatInternal
And I do not want to change the behavior of the number sequence related code.
With regards,
You can remove messages from infolog. For example:
int infoLine = infologLine(); ... infolog.clear(infoLine);
But you must be careful - removing all messages may easily be wrong. Even if the current standard code can ever add just the one error message that you want to supress, this may change in any future version. Also, we're talking about CoC, therefore the 'next' may call many other extensions of the same method, and you don't know what they'll be doing. You could hide crucial messages by mistake.
You could make it safer by checking which messages were added and then removing just the one you're interested in. But I think a better approach is making an extensibility request and ask Microsoft to make it possible to skip the code that you don't want to run.
Hi Martin,
Thank you for the suggestion and I will keep these pointers in mind.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 664 Most Valuable Professional
André Arnaud de Cal... 522 Super User 2025 Season 2
Sohaib Cheema 303 User Group Leader