How to throw message on particular fieldd validation

Hi, I have requirement that when I open fixed asset from Modules → Fixed Assets–>open any fixed

When I open fixed asset I have to check asset quantity and display some message bases the quantity…

Where Can I write my logic and how to get that particular asset id, please suggest if any

If you want to run the logic when you select a fixed asset record, you can do it in active() method of the data source. Because we’re talking about a standard form, you’ll need an extension. Either create a data source extension class and extended active() method via CoC, or handle the OnActivated event.
Note that the usual approach is validating data when a record is being saved or when a value was modified.

Hi Martin,

I have to show message when I open Fixed asset, Fixed Asset ID filed is hyperlink , when we click on hyperlink I need to show the message to user… Can I use COC on data source active()?

This is strange design, because the link merely switches the view of the current asset. I suspect that you didn’t take some scenarios into account.

  • You can work with assets directly in the grid view without ever switching to details.
  • You can switch to the detail view by a different means than by clicking the link, i.e. by using a keyboard shortcut, using Options > Page options > Go to > Details or by navigating directly to a particular record.
  • You can switch records in the detailed view without going back to the grid view and clicking a link. For example, by pressing Ctrl+F8 and Ctrl+[Down Arrow] in the detailed view.

active() wouldn’t help in your case, because you’re still looking at exactly the same asset - you merely show more fields for it. active() is called when you switch to another asset.