Announcements
No record found.
Hi guys,
In a standard table, usually there is a ValidateWrite() method. Can we create CoC on this method and overwrite it ? or in other words is "overidden" some condition in the existing method.
Thanks
Hello,
You can not override a standard method but you can extend it. What you actually do with the CoC is either, you let Microsoft code run first then, yours run after, or you run yours first then, the standard's.
Which ever way, the standard code must run.
Hi, You can bypass standard logic by manipulating some code but its not always possible. By override, if you mean to suprress call to standard method then its not possible. If you have a requirement, please share so we can try to help.
Hi both,
Thanks, yes I have a requirement to suppress the validateWrite for throwing error, replace by Warning only on this part in table RevRecDeferredLine
public boolean validateWrite() { boolean ret; if (this.RecognizeAmount >= 0 && (this.RemainingAmount > this.RecognizeAmount)) { //Revenue to release is greater than remaining revenue to recognize return checkFailed("@RevenueRecognition:RevenueToReleaseGreaterThanRemainingRevenueToRecognize"); } if (this.RecognizeAmount < 0 && (this.RecognizeNowAmount < this.RecognizeAmount)) { //Revenue to release is less than remaining revenue to recognize return checkfailed("@RevenueRecognition:RevenueToReleaseLessThanRemainingRevenueToRecognize"); } }
It has other condition, but I only need to change this to warning only instead checkfailed. Is it possible in CoC ?
Hi, You can try doing it like this code so it bypass standard code and then you can throw warning instead of error.
public boolean validateWrite() { Amount RemainingAmountLocal, RecognizeAmountLocal; RemainingAmountLocal = this.RemainingAmount; RecognizeAmountLocal = this.RecognizeAmount; this.RemainingAmount = 0; this.RecognizeAmount = 0; boolean ret = next validateWrite(); this.RemainingAmount = RemainingAmountLocal; this.RecognizeAmount = RecognizeAmountLocal; if (this.RecognizeAmount >= 0 && (this.RemainingAmount > this.RecognizeAmount)) { //Revenue to release is greater than remaining revenue to recognize warning("@RevenueRecognition:RevenueToReleaseGreaterThanRemainingRevenueToRecognize"); } if (this.RecognizeAmount < 0 && (this.RecognizeNowAmount < this.RecognizeAmount)) { //Revenue to release is less than remaining revenue to recognize warning("@RevenueRecognition:RevenueToReleaseLessThanRemainingRevenueToRecognize"); } return ret; }
It doesn't throw an error. Calling checkFailed("x") does exactly the same thing as warning("x"). The difference is elsewhere - in the return statement. return checkFailed("x") is an equivalent of this:
warning("x"); return false;
Therefore you would like to keep the warning (no need to call it again) and return true instead of false. But... you should change the return value only if it failed on these particular conditions and no other.
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.
Congratulations to our 2026 Super Stars!
We are thrilled to have these Champions in our Community!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Giorgio Bonacorsi 733
André Arnaud de Cal... 461 Super User 2026 Season 1
Syed Haris Shah 278 Super User 2026 Season 1