vaishali_sftdev
24th August 2008, 21:36
Hi,
Is it possible to show custom message instead of default "Record already exist" message for any key(index) voilation?

kaukul
25th August 2008, 08:02
Yes, you will have to modify i.e. customise standard message for this, which is not recommended by BaaN.

1) Open the session for which you wanna modify the message code.
2) Simulate so that the Message will pop up.
3) In the message, note down the message code that appears in header of the message box.
4) Customise this message.

Its impact will be "Where ever this message code has been used, the message will be affected".

vaishali_sftdev
25th August 2008, 09:00
Thank u for reply. Is this the only solution for this. Since, Its a standard message code. It wont be advantageous to change. Cant we have our own message code for Key violation on a particular table?

george7a
25th August 2008, 11:09
You mean you want the same message to appear in all the sessions that uses this table field in a wrong way? This is called DAL and it is not available in Baan IV or below. You can read about it here:
http://www.baanboard.com/programmers_manual_baanerp_help_functions_dal_overview

However, you can write the message in a DLL and use the DLL function in all the scripts. This way, if you needed to change the message, you will change it only in one place.

I hope it helps,

- George

vaishali_sftdev
25th August 2008, 11:26
Yes, but in a function I cannot override "Record already exists" message. Since, what I want is, if second index is violated then i should display custom message rather than the standard message "Record already exist".

george7a
25th August 2008, 11:45
You can not override the message, but you can put another one before that one pops up. Using the "check.input" section you can check your input before the standard message Here is the code:

field.ttmmm.nnnn:
check.input:
| if it already exist then....
message("What ever you want")
input.again()
| endif

I hope it helps,

- George