Groovy expression for error message in validation

hi...
using groovy expression i want to display a dynamic error message...(ie.i have a date field the date cant be a past date..if i enter the past date like (02-04-2012 )the error message should display with this date)

For a validation rule on an entity attribute, you can use a Groovy expression to decide whether
an error or a warning message should be displayed using the following expression:
adf.error.raise("THIS_IS_AN_ERROR_MESSAGE")
adf.error.warn("THIS_IS_A_WARNING_MESSAGE")
In your case, you can customize the message and access the date attribute in the message as source.HireDate(Assuming HireDate is the date attribute)
Hope it helps.

Similar Messages

  • Using groovy expressions in error messages

    Hi,
    Suppose I have an error message with tokens. Eg: The value of {ATTRIBUTE1} must not be {VALUE1}.
    We use source.hints.<AttributeName>.label to get the label of an attribute from the current EO. I need to way to access the attribute name of another VO. What is the syntax for this?

    Sure. I am using Jdev Studio Edition Version 11.1.1.6.0.
    Suppose I have a parent EO called CarsEO. It has an attribute called CarModel.
    I have a child for this called CarSparePartsEO. It has an attribute called CarSparePartType.
    I have a validation for CarSparePartsEO.CarSparePartType and the error message should be something like this
    The car model {ATTRIBUTE1} cannot have value {VALUE1} when {ATTRIBUTE2} is {VALUE2}.
    ATTRIBUTE1 - CarModel's label
    VALUE1 - CarModel's value
    ATTRIBUTE2 - CarSparePartType's label
    VALUE2 - CarSparePartType's value
    How do I get the label and value of CarModel attribute?

  • Error message - "Overlapping validity areas were found for country BR"

    Hi Experts,
    For a certain output type Y953 (e.g. for the shipment 2002355665 related to the DN 3087912658), an error message "Overlapping validity areas were found for country BR" is coming in as error.
    The error message is appearing during the idoc processing of the shipment.
    This is an incident of Dangerous Goods.
    I would like to know if it is technically / functionally possible to find out as to why exactly this mesage is coming and how can we rectify the problem.
    From technical point of view we checked that this message was not being called in the SAP system but was dynamically called.
    kindly let me know of any breakthrough as this issue is critical as dangerous goods are being transported without needed documents printed.
    Thanks in advance.
    RIttik

    Check whether note 836139 helps you.
    thanks
    G. Lakshmipathi

  • I have OS10.6 and when I try to update I receive error message after validating packages and updates to not tke.

    I have OS10.6 and when I try to upload updates I receive an error message when validating the packages. No updates take place.

    Are you using Software Update? And what is the error message?
    You are on 10.6.0? Why don't you download the combo updater for 10.6.8 directly from Apple and try to install it from there:
    http://support.apple.com/kb/DL1399

  • Error Code :-5002 Error Message :Enter valid currency  , '51100000-01-001-0

    Hi all,
             I have found a error "Error Code :-5002 Error Message :Enter valid currency  , '51100000-01-001-01'" while adding the DELIVERY document.
    I have made a customer and assign then "EURO" currency and add delivery document then it prompts error.
    Could anyone solve this problem. is there any setting which i am missing..??
    Regards
    Sandesh

    HI Sandesh,
    Check Sap note :1252328
    and also check below thread of similar issue:
    Re: 'Invalid Currency' error when attempting to deliver order
    Hope this will solve your issue.
    Thanks,
    Neetu

  • Error message: "Enter valid currency [Message 173-57]" during Deposit transaction

    Hi All,
    Is there a specific reason why can't I deposit from a "Multi-currency" cash account to a "specific (i.e., USD)" cash account using the Banking> Deposits> Deposit module.
    I have already read below threads related to this issue.
    Error message "Enter valid currency [Message 173-57]" during cash deposit
    Can't Create Cash Deposit of Journal Entry due to "Invalid Currency" Error
    Transfer Between bank accounts in different currencies
    GL Postings between different currency accounts
    foreign currency transactions
    SAP Business One Note: 1260658 - Transfer monies between different monocurrency accounts
    I have posted successfully e  cash transfer from multicurrency to monocurrency cash account thru Journal Entry, However, I wanted to know the reason why it is not possible to post this transaction thru the Banking> Deposit module.
    Appreciate your feedback on this matter.
    Thanks!

    Hi,
    Same error message is appeared in 8.81 PL10. So this is not due to PL. If you select other than local currency at deposit currency, this error appears.
    Let me check and update.
    Thanks & Regards,
    Nagarajan

  • Re:Groovy Expression for time

    Hi All,
    Iam using Jdeveloper 11.1.2.3.0 ,my requirement is that :Groovy expression for time
    Can any one send me the above requirement
    Thanks,
    Sandeep

    What time?
    Yesterday noon?
    Now?
    You need to give us a use case.
    Check out GroovyCookbook: Dates and Times
    Timo

  • Fiedl Validation for Warning Message not for Error Message

    hi all,
    we know for field validation, once it not meet the validation, it will throw out the error message and don't allow you to save the record.
    But is there any way to show warning message just a note then user can continue the operation?
    Thanks
    Amanda

    hey ady,
    Is there any authoritative explanation from oracle which mention this part? As I need to follow it to our client which explain this is impossible.
    Thanks
    Amanda

  • How to display an error message after validation in Formatted Search?

    Hi SBO experts,
    if an error is detected on validation in a Formatted Search, how to display an error message to the user entering the data?
    Thanks & Regards,
    Raghu Iyer

    i created a formatted search query & attached it to the field 'Quantity' at Line Item level in Sales Order screen. just for testing purpose, i eneterd the following code lines in the query validating 'Quantity'
    if $[$38.11.0] > 50
    begin
    select @error = 1
    select @error_message = 'Vendor code cannot begin to X sign.'
    end
    the system throws the error : Internal error (8180) occurred [Message 131-183]
    actually, i need to display an error message to the user if Quantity is not in multiples of the OITM.SalFactor2
    if $[$38.11.0] % (SELECT T0.[SalFactor2] FROM OITM T0 WHERE T0.[ItemCode]  = $[$38.1.0]) > 0
    begin
    select @error = 1
    select @error_message = 'Error in Quantity.'
    end
    but, this expression to get the remainder itself seems to have some error
    $[$38.11.0] % (SELECT T0.[SalFactor2] FROM OITM T0 WHERE T0.[ItemCode]  = $[$38.1.0])
    i guess, % operator is used for modulo (to find the remainder of one number divided by another.) ? am i right ?
    Regards,
    Raghu Iyer

  • Error message on validation script

    Hi Guys,
        I created a validation script for MA to check the fill on the extention collection as below.
    productColln = doc.getExtensionCollection("PROD_HIER");
    productItr= productColln .iterator();
    for(member : productItr){
              if(!hasValue(member.get("fieldA"))){
                   exception.chainAtEnd(member.createApplicationException("fieldA","Please enter Max Value"));
              if(!hasValue(member.get("fieldB"))){
                   exception.chainAtEnd(member.createApplicationException("fieldB","Please enter the Unit Price"));
    if(exception.getChain() != null){
        throw exception.getChain();
        1. When the 'fieldA' and 'filedB' are blank, the error message is shown only for 'fieldA'. After i complete 'fieldA' the error message will be shown for 'fieldB'. It seem like it will show only for first one which is put in the chain. I would like the message to show all message in the chain.
        2. When the error message is shown the both fileds are covered by the red line but i would to have the red ' ! ' appear on the tab (ex. for product tab) as well. How can i implement that?
    Noppong,
    Thank you in advance

    Hi Noppong
    My understanding is once system gets an exception, it skips to throw statement and the subsequent exceptions, if any ,are skipped. Use of chain exception allows one to write one throw statement in the code rather than multiple throws at various points.
    I may be wrong so appreciate if someone can validate this.
    Regards
    Mudit Saini

  • Error message: no valid initialization after client copy

    Hi,
    We recently did a client copy of our quality BW and R/3 systems from preproduction. In the 'new' clients we have problems with the delta process for 2LIS_13_VDITM. We get an error message that there was no valid initialization in the system, where in fact a valid initialization has taken place (everything from preprodcution was copied).
    The source systems setting where corrected using BDLS, but the entries in R/3 tables roosprmsf / roosprmsc were still pointing to the old system. This has now been corrected.
    One problem remains. There is no entry for 2LIS_13_VDITM in table RSSDLINIT. I suspect that this causes the error message. Can anybody confirm this ? Is there a standard way to add the correct entry (with the package number of the init package) in table RSSDLINIT or realign table RSSDLINIT with table roosprmsf in R/3 ?
    Thanks in advance !

    Hi,
    After system copy. You will ahve delet your whole data and reload every thing.
    In case you are getting dump when you double click infopacakge then delete your data source entry in RSA7 in source system and then go for fresh init load and then continue with delta load. Before goign for fresh init load you will have to first delet the init load entry.
    This must help
    Regards,
    Rohini
    Message was edited by: Rohini Garg

  • Scripting for error messages

    Hi,
    1.On a selection-screen with four select -options as s_vbeln,s_vkorg,s_vtweg,s_spart. I need to validate and write a error message ' enter atleast one field' if it is executed without any values.
    2.Also validation should be done that the entered value is correct or incorrect and if it is incorrect it should show the error message concerned to the fields for example if the vkorg value is entered incorrect , it should display'' please enter valid entry' respectively to all the fields.
    Can anyone send me a code on how to perform this.
    Thanks,
    Stalin.

    Using function module 'FORMAT_MESSAGE' you can capture the messages.
    Here is a sample of the program code for that:
    LOOP AT it_messtab.
    CALL FUNCTION 'FORMAT_MESSAGE'
    EXPORTING
    id = it_messtab-msgid
    lang = it_messtab-msgspra
    no = it_messtab-msgnr
    v1 = it_messtab-msgv1
    v2 = it_messtab-msgv2
    IMPORTING
    msg = g_msg
    EXCEPTIONS
    OTHERS = 0.
    IF it_messtab-msgtyp = 'S'.
    it_sucess-sucess_rec = g_msg.
    it_sucess-lifnr = it_header-lifnr." Based on your field
    it_sucess-tabix = v_lines.
    APPEND it_sucess.
    ELSEIF it_messtab-msgtyp = 'E'.
    it_error-error_rec = g_msg.
    it_error-lifnr = it_header-lifnr.
    it_error-tabix = v_lines.
    APPEND it_error.
    ELSE.
    it_info-info_rec = g_msg.
    it_info-lifnr = it_header-lifnr.
    it_info-tabix = v_lines.
    APPEND it_info.
    ENDIF.
    ENDLOOP.

  • VA01 Error Message - Partners Validation

    Hi Experts,
    I have written a code to validate the partners(Sold-to & Ship-to) while creating a sales order in VA01 (program 'MV45AFZB') ( user exit form: USEREXIT_CHECK_VBAK).
    If an invalid relationship is detected, this enhancement will display an error message and stop the sales order creation until the correct sold-to/ship-to relationship is entered or maintained.
    I could able to give the error message based on the validation but the all the fields(Sold-to & Ship-to) on the screen are grayed out and are not ready for input.
    Please suggest if there is any way to make these fields input enabled.
    We are using SAP version ECC 6.0
    Thanks in advance,
    Anil

    Hi Keshav,
        Thanks for your reply. By including the code in SAVE_DOCUMENT_PREPARE of MV45AFZZ I could able to give the error message. Still all the fields are grayed out. and I need to rerun the transaction VA01 with the correct sold-to and ship-to partner data.
         Please suggest is there any other way to correct the ship-to data without re running the transaction VA01. After displaying the error I want the Ship-to and sold-to fields should be displayed as input enabled fields.
    Thanks,
    Anil

  • Error Message on Validations

    HI ALL,
    How do we customize item validation error msg? such that my error msg Inline in Notification should look like this:
    <label of PX_ITEM1> : Value must be specified
    <label of PX_ITEM2> : Numeric value must be specified
    <label of PX_ITEM5> : Value must be specified
    this way, users may know which items (or fields) was validated with error. this can be done manually for each item validation, but is there a way to create a template for all error messaging with format <label of item> : <error msg> ?
    Thanks!
    BROKEN.

    Broken,
    you may take a look at the following links:
    http://inside-apex.blogspot.com/2007/01/one-small-step-for-man-one-giant-leap.html
    http://inside-apex.blogspot.com/2007/01/apexlib-automatic-required-and-format.html
    http://inside-apex.blogspot.com/2006/12/hacking-apex-error-page.html
    They will handle your default errors like field required, number or date picker check already in the browser and also for security reasons again on the server. The raised errors are customizable with a template.
    Patrick
    Check out my APEX-blog: http://inside-apex.blogspot.com

  • Error message "No valid source context supplied"

    Hii,
    I will add buttons to my html page. So far, I inserted the following code to my bsp page:
    <% DATA: ls_button type CRMT_THTMLB_BUTTON,
                      lt_button type CRMT_THTMLB_BUTTON_t.
                      CLEAR ls_button.
                      ls_button-type = cl_thtmlb_util=>gc_icon_edit.
                      ls_button-on_click = ''.
                      ls_button-enabled = 'X'.
                      ls_button-text = 'Cancel'.
                      append ls_button to lt_button'.
    %>
    <thtmlb:areaFrameSetter toolbarButtons = "<%= lt_button %>"
                                            maxButtonNumber = "1" />      
    When I remove the buttons, that I inserted before with the configuration tool (button Coniguration) and test my page, I get the following error message:
    Cannot display view Z_SHOW/Upload of UI Component Z_SHOW
    An exception has occured
    Exception Class  CX_BSP_ELEMENT_EXCEPTION-:No valid source context supplied
    Methode              CL_BSP_ELEMENT=>IF_BSP_ELEMENT~RAISE_ERROR
    Source Test Row: 3
    Can anyone explain me, how to fix the error message?
    Thanks and regards,
    Harris

    I have the same error,could you tell me how to solve it .thanks !
    无法显示视图 ZGSWIDET/DetailsEF
    已出现异常 例外分类  CX_BSP_ELEMENT_EXCEPTION - : No valid source context supplied 
    方法:  CL_BSP_ELEMENT=>IF_BSP_ELEMENT~RAISE_ERROR 
    源文本行:  3

Maybe you are looking for

  • Multiple Libraries & duplicates

    I am sure that my problem is common so hopefully this post will help other people solve similar problems. It may have been answered in other posts although nothing has popped out as a clear and concise way to solve how to deal with multiple libraries

  • Wake up, MacBook!

    I rarely close my computer and let it sleep , but when I do (yeah, I wish I had a picture of The Most Interesting Man, too) it doesn't wake up when I open it; it stays black (although the hard drive does make the short 'I'm waking up!' sound), and al

  • WEB-INF/web.xml

    Hi: I need to add <security-constraint> to my Flex Builder-3 project. How and where do I add this with FB3. After I have used the authentication J2EE basic authentication mechanism, how do I get a reference to the role-name that has logged in? Thanks

  • "decomposing" nested sequences for online re-link/tape capture

    I have been "nesting" sequences within my timeline as follows: (for discussion purposes I have redcued my timeline to a small sub-section) Nesting is a feature I'm learning to really love and use a lot of in my edits! Gives me a great range for apply

  • Authenticate linux users with OID

    Hi all I need to make my linux box to authenticate to OID. Any clue? Thanks a lot.