Announcements
No record found.
I had a requirement where I have to update a inventdimid whenever creating a new batch/production order in prodbom table . I have wrote the logic in oninserting event handler of prodbom table. I tried to debug a code (attached snapshot)
In the line ProdBom peodbomup =sender as ProdBom, it is not selected a data, value is null. It would be great help if if anyone suggests a solution.
Thanks
I don't know what the problem is, but can't you avoid the whole situation by simply using CoC?
By the way, I see you're trying to update a record that hasn't been inserted yet, which would obviously fail. Just set the value and don't call update(); let the system to insert the record.
With CoC, the code will look somehow like this:
void insert() { this.InventDimId = BOM::find(this.BOMId).InventDimId; next insert(); }
Thanks and noted the point for update(). But I'm working on standard table and form, I need current instance of the table. How can I achieve that. Sender as table is not selecting any Data.
Are you saying that you think that my code can't be used for a standard table, because you aren't aware of CoC at all? :-o
If so, I have some great news for you...
Actually I'm a newbie, didn't used Coc before.
CoC (Chain of Command) is an absolutely crucial topic for extensiblity. It's an easier and more powerful way for writing extensions. You define an extension class and override methods. Such a method has the same name and parameters as the method you're extending (such as insert()). You'll use the next keyword to call the base method, and put code before or after this next call to execute code either before or after the standard logic.
You can refer to the current object by this.
You can see all these things in my example above.
You can also easily refer to class variables or form controls by name, you can access protected members, add methods, add class fields and so on.
Please read Class extension - Method wrapping and Chain of Command in F&O documentation.
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!
Thanks to all of our 2025 Community Spotlight stars!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
André Arnaud de Cal... 510 Super User 2026 Season 1
Giorgio Bonacorsi 399
Adis 251 Super User 2026 Season 1