Validate Script in from field

Hi to all
I've got a form field which calculates the sum of a bunch of other fields which works fine. This sum field is marked as read only for it's only purpose is to show the sum.
But the value of the sum must not exceed 100. If I configure the normal validation in the sum field's properties, the message window will pop up when the user fills values in the other fields and the standard message makes not clear that it is the sum which is too high.
So I wrote a little script.
var f = this.getField("Busin_Typ_Sum");
if (f.value >100) {app.alert({ cMsg: "Sum of percent should not exceed 100",cTitle: "Watch the sum"});}
This nearly works fine, the only problem is that the alert pops up when the sum exceeds 100 a second time.
Example:
User types 90 in the first field
User types 20 in the second field Nothing happens
User types 10 in the third field Alert Box appears
The Alarm should go off after filling the second field. Can anybody help?
Thanks a lot,
Otto

You might also want to set the event return code.
// assuming the percentage format is used for the input fields
if (event.value > 1.00)  {
app.alert({ cMsg: "Sum of percent should not exceed 100%",cTitle: "Watch  the sum", nIcon: 1, nType: 0});
event.rc = false;

Similar Messages

  • Validate a rescource form field

    hi,
    what is the best way to validate a resource form field in oim11gr2?
    in my case I would like to verify, that the oracle dbum "user login" field is written in capitals.
    thank you!
    br

    Hi,
    You cannot access the DB from the script. If you want to access the values of a field you should use session variables. Here is a sample to access the values of a form field.
    declare
    ticket_no varchar2(20);
    flight_no varchar2(20);
    blk varchar2(30) := 'DEFAULT';
    begin
    ticket_no := p_session.get_value_as_varchar2(
    p_block_name => blk,
    p_attribute_name => 'A_TICKET_NO');
    flight_no := p_session.get_value_as_varchar2(
    p_block_name => blk,
    p_attribute_name => 'A_FLIGHT_NO');
    end;
    Thanks,
    Sharmila

  • Not able to print the script form from print preview

    Hi Experts,
    I need to print one of the script form from print preview. As per the req. first i need to generate a print preview of this form and if required should be able to print it from this preview.
    i am able to generate print preview and also able to see the print option but when i try to print it is going to the spool (which i dont want). I want it to be printed directly to the printer instead of sending it to the spool.
    Please suggest me
    The way i coded it is
    DATA: arcpar TYPE arc_params,
                pripar TYPE pri_params.
    CALL FUNCTION 'GET_PRINT_PARAMETERS'
        EXPORTING
          layout                 = 'X_65_132'
          line_count             = 65
          line_size              = 132
        IMPORTING
          out_parameters         = pripar
          out_archive_parameters = arcpar
          valid                  = val
        EXCEPTIONS
          archive_info_not_found = 1
          invalid_print_params   = 2
          invalid_archive_params = 3
          OTHERS                 = 4.
      pr_options-tddest = ''.
      pr_options-tdpreview = 'X'.
      pr_options-tdnoprint = ''.
      pr_options-tdsuffix1 = 'STUFF'.
      pr_options-tdsuffix2 = matnr.
      pr_options-tdimmed = ''.
      pr_options-tdlifetime = '2'.
      pr_options-tdprogram = Form-name.
    CALL FUNCTION 'OPEN_FORM'
        EXPORTING
          device   = 'PRINTER'
          dialog   = space
          form     = "purchase or"
          language = sy-langu
          OPTIONS  = pr_options
        EXCEPTIONS
          canceled = 01
          device   = 02
          form     = 03
          OPTIONS  = 04
          unclosed = 05.
      CALL FUNCTION 'START_FORM'.
    ENDFORM.                    " open_and_start_form
    Thank you.

    Hi,
       Just pass the value 'X' to "pr_options-tdimmed" field.Try this.
    I hope,it help you
    <=<< Sharing Knowledge is a way to Innovative  >=>>
    By,
      Yoga

  • Script logic from BPC 5 in BPC 7.5

    Hi,
    I am trying to use some script logic from an appset in BPC 5 in BPC 7.5. When I validate the logic in 5 it works fine but in 7.5 I get validation errors.
    They relate to properties of dimension elements that are not currently used (neither in 5 nor in 7.5) but could well be used in the future. As an example, this bit generates an error
    *WHEN ACCOUNTL.RATETYPE
    *IS END,ENDFLOW
    I currently do not have an account defined with ratetype END but it is quite possible that there will be one in the future. And END is defined as an element in the RATE dimension.
    So, why did BPC 5 accept this and BPC 7.5 does not? And, is there a way around other than defining a dummy element in ACCOUNTL that used ratetype END?
    Thanks
    Edited by: ArnoldWarhonowicz on Aug 5, 2010 4:06 PM

    What I havenoticed is that with the new7.5 Script logic, there are more checks and balances performed during the validation.  So, if you have only AVG, ENDRATE on RATETYPE property and no END for any member, yet your logic is calling a set of members with this parameter, the logic fails to validate. I assume the process is checking for a set of END members based on the request. Since they don't exist, the error occurs.  But I would request that BPC Support verify the behavior as well.
    If you remove END, does the logic validate?
    Hope this helps.

  • .Mac Alias "From field"

    I really like the idea of having aliases they keep you main account protected from all sorts of evil. But i have a question concerning sending mail with one of your aliases as the sender.
    When i send an email the "from" field of that email displays the full alias email address but i would like to show it my full name just like when sending mail from my regular .mac account. I have searched the forums and help files without luck. I suspect this is not possible but would like to check cause maybe i am just overlooking a setting.
    Thanks for you help. I just made the switch from windows to os x and so far i have not one single regret.
    Dirk
    iMac Intel Core Duo   Mac OS X (10.4.6)  

    Dirk,
    you can use the following AppleScript to change the full name attached to each of your .Mac alias in Mail (note that this won't affect the messages sent from the .Mac webmail interface):
    Click to open this script in your Script Editor<pre style="font-family: 'Monaco', 'Courier New', Courier, monospace; overflow:auto; padding: 0.2em; font-size: 10px; width:500px">if ((get system attribute "sysv") < 4160) then -- 4160 = 0x1040 is Sytem version 10.4.0 (Tiger)
    display dialog "This script needs MacOS X version 10.4 or higher" buttons {"OK"} default button 1
    return
    end if
    set mailPlist to ((path to preferences folder from user domain as Unicode text) & "com.apple.mail.plist")
    tell application "System Events"
    activate
    repeat with eachAccount in property list items of property list item "MailAccounts" of contents of property list file mailPlist
    if (get value of property list item "AccountType" of eachAccount) = "iToolsAccount" then exit repeat
    end repeat
    if (get value of property list item "AccountType" of eachAccount) is not "iToolsAccount" then
    display dialog "No .Mac Account defined." buttons {"OK"} default button 1
    return
    end if
    try
    set theAliasDescriptions to (get value of property list item "EmailAliases" of eachAccount)
    on error
    display dialog "No .Mac aliases found in Mail's preferences." buttons {"OK"} default button 1
    return
    end try
    repeat with eachAlias in theAliasDescriptions
    set |name| of eachAlias to text returned of (display dialog "Please enter name to be used for the .Mac alias corresponding to the address
    " & |alias| of eachAlias default answer |name| of eachAlias)
    end repeat
    set value of property list item "EmailAliases" of eachAccount to theAliasDescriptions
    if process "Mail" exists then display dialog "You need to restart Mail for the changes to take effect." buttons {"OK"} default button 1
    end tell
    </pre>
    Andreas

  • Calculate Months from Field Date

    Using: Acrobat X Pro in windows. 
    I have three fields:
    1) Today's Date:___________ [DateToday] -- Automatically filled-in with today's date using script.
    2) Date Last Payment Made:__________ [LastPaymentMade1] -- Filled-in by user in mm/dd/yyyy format.
    3) Months Since Last Payment:______________ [MoBehind] -- Need to calculate from field 1 - 2).
    For #3, how do I custom calculate how many MONTHS it has been (#3) since the date the last payment was made (#2)?
    There's a great discussion here on this topic but I cannot figure out how to modify the script for my purposes: http://forums.adobe.com/message/1907993#1907993
    This appears to be the closest thing to what I want:
    function Floor(fValue) {
    return Math.floor(fValue);
    function Date2Num(sDate, sFormat) {
    var fSecond =1000;
    var fMinute = 60 * fSecond;
    var fHour = 60 * fMinute;
    var fDay = 24 * fHour;
    var oDate = util.scand(sFormat, sDate);
    var fDate = oDate.valueOf();
    var fDate = fDate / fDay;
    var fDate = Floor(fDate);
    return fDate;
    var Start = this.getField("DateToday").value;
    var sFormat = "mm/dd/yyyy";
    var End = this.getField("LastPaymentMade1").value;
    var sFormat = "mm/dd/yyyy";
    var eFormat = sFormat;
    event.value = Date2Num(End, eFormat) - Date2Num(Start, sFormat);
    Here's another one that looks SIMILAR to what i want:
    (function () {
        // Get date from field
        var v = getField("DateToday").value;
        if (v) {
            // Convert string to date
            var d = util.scand('mm/dd/yyyy', v);
            // Add number of days in NUMDAYS field
            d.setDate(d.getDate() - +getField("NumDays").value);
            // Set value of this field to the new date
            event.value = util.printd("mm/dd/yyyy", d);
        } else {
            // Blank field if no date entered
            event.value = "";

    Since the number of days in a month are not constant across a year I do not think you can use the milliseconds in a day.
    I you use the 'getMonth()' and 'getFullYear()' methods for the calculation.
    // get the date values
    var Start = this.getField("DateToday").value;
    var sFormat = "mm/dd/yyyy";
    var End = this.getField("LastPaymentMade1").value;
    var sFormat = "mm/dd/yyyy";
    var eFormat = sFormat;
    // convert to date object
    var oStart = util.scand(sForamt, Start);
    var oEnd = util.scand(eFormat, End);
    // get start month
    var StartMonth = oStrat.getMonth();
    // add start full year as months
    StartMonth = StartMonth + (oStart.getFullYear() * 12);
    // get end month
    var EndMonth = oEnd.getMonth();
    // add end full year as months
    EndMonth = EndMonth + (oEnd.getFullYear() * 12);
    // compute difference in months
    var diffMonths = EndMonth - StratMonth;

  • FormMail-Configuring the 'from' field

    I currently can get formmail to work using the
    nms-cgi.sourceforge script. I'm trying to find out if I can
    configure what appears in the return email in the 'FROM' field. It
    currently defaults to: [email protected]
    Thanks

    > I'm
    > trying to find out if I can configure what appears in
    the return email in the
    > 'FROM' field.
    http://nms-cgi.sourceforge.net/formmail_compat-3.14c1/README
    If you want it set to a value you are collecting in the form,
    such as the
    visitor's email address- name that field exactly email
    As well as all these hidden inputs, there are a couple of
    non-hidden
    inputs which get special treatment:
    email - If one of the things you're asking the user to fill
    in is their
    email address and you call that input 'email', formmail will
    use
    it as the address part of the sender's email address in the
    email.
    realname - If one of the things you're asking the user to
    fill in is their
    full name and you call that input 'realname', formmail will
    use
    it as the name part of the sender's email address in the
    email.
    >It currently defaults to: [email protected]
    Set this value in the script to the address you want as the
    default FROM, it
    will be used if not overridden by a field named email
    $postmaster - The envelope sender address to use for all
    emails
    sent by the script. This address will recieve bounce
    messages if any of the emails cannot be delivered. If
    in doubt, put your own email address here.
    Alan
    Adobe Community Expert, dreamweaver
    http://www.adobe.com/communities/experts/

  • HT5624 Why in my email ( the one on my ipod5 that I use with my apple ID) when I get emails about my use of my apple ID to use a service in the from field it has my fathers name and when I click on it it shows his contact info ????

    Why in my email ( the one on my ipod5 that I use with my apple ID) when I get emails about my use of my apple ID to use a service in the from field it has my fathers name and when I click on it it shows his contact info ???? I also set up my apple ID with a new email account and also I signed up for iCloud but used the same apple I'd email and password but it gave me a I cloud email! I did activate the favorites in my email . Noticed the from field has my fathers name and contact and it is a notification about me using my apple ID to sign in to FaceTime! Something is messed up, not sure how or why???

    i didn't read a lot of your 2nd paragraph, but it seems like the password is the issue, right?
    do a true clean install
    reboot your machine and hold down command+option+r, you should see a spinning globe - if you don't see the globe or anything that reads internet recovery, shut down and try again
    at menu, chose disk utility and once there, find your HD on the left side, select the physical name and erase it as mac journaled
    exit disk utlity
    at menu, choose install OSX
    this time, when it asks for a password just hit continue, it will let you complete without a password
    you should be able to get into your laptop, now figure out what password you'll be able to use with your kb issue

  • How can I change the "From:" field in iOS Mail?

    This is a weird one.
    I have a gmail work email account that has been set up for me. There's a primary email address assigned to it, and a secondary one (which is the one I want to use).
    No problem at all sending from the secondary account on my MacBook Pro. I just hit the drop down menu by the "From:" field, and I can select it from there.
    However, when I send from my iPhone, I'm only given the option of sending from my primary email address, not the secondary one. This is despite the fact that I've synced Mail accounts via iTunes.
    Any idea how I might fix this so I can send from the secondary account on my iPhone?

    First of all, please fill in the Computer Model and Operating System fields on your My Settings’s profile (and click Save). This is essential information that should always be provided when asking for help.
    Now, what does “I can't change it” mean? What appears in the From header of the messages you send is determined by your Mail > Preferences > Accounts > Account Information settings...

  • How to use alias in "From" field when I send a mail with utl_smtp ?

    Hi all,
    I'm using a PL/SQL package with an Oracle 11G database to send mails. It works fine but instead of use of my mail in "From" field like "[email protected]" as sender E-mail address, I would like to have "Toto" in the sender address. I tryied to use utl_smtp.mail(l_connection, '<toto> [email protected]') but it doesn't work. The only way I can send mail is when I set utl_smtp.mail(l_connection, '<[email protected]>') directly. When I use the Alias, I have an error from smtp server telling that I use a bad syntax address.
    Does someone know how to use the alias ? Where do I do a mistake ?
    Thank you for your help.
    sis2b

    Thank you, I find how to solve the problem thanks to your link.
    I try to send HTML E-mail so I had the From in the from field writen in the header of the mail and not to initialize the connection.
    sis2b.

  • Apple Mail "From:" Field Customization

    I have several IMAP accounts in Apple Mail. One of them is a Gmail account that I use as a conduit account for work, so when I reply to messages or compose new mail, I would like it to display a specific address in the "From:" field, instead of selecting it every time (I added my work account to Mail as well, though I forward messages to my Gmail account). So, for example, my Gmail account is "[email protected]" and my work email is "[email protected]".
    When I compose messages from the Gmail account I would like the "From:" field to display "[email protected]" instead of "[email protected]". I am able to set up Gmail web interface to do this, but have not been able to set up Apple Mail to do the same (aside from instructing it to send messages using my work server, instead of the Gmail server).
    In Lion, Mail was able to specify that address if I was replying to a messages sent to "[email protected]" but would show "[email protected]" for every new message. In ML, even replying to a message sent to "[email protected]" shows "[email protected]" in the "From:" field.
    Does anyone know how to instruct Mail to choose only "[email protected]" when replying or composing new messages?
    Thanks for your help!

    What you are describing is what is known as "articulation work". To quote Suchman, "'Articulation work' names the continuous efforts required in order to bring together discontinuous elements - of organizations, of professional practices, of technologies - into working configurations". That makes it sound better than it is.
    Ideally, your non-profit needs a decent webhost like Dreamhost that can transparently integrate with Google Mail and make the whole problem go away.
    asmystiq wrote:
    I configured Mail to use the work SMTP server to send messages from the Gmail account.
    This is what is known as e-mail spoofing.
    In the web Gmail interface, everything works smoothly.
    Yes. Google is known for ignoring laws and facilitating any kind of network traffic, legitimate or not, in order to track activity and build value for its advertising business.
    In Mail, even if the message was sent to [email protected], Mail replies show up with [email protected] in the "From:" field
    Yes. That is the way it is supposed to work.
    I also set up a rule for redirecting Sent messages to Gmail and moving the original copies to Trash on the work account. In Lion, all was well and the replies indicated [email protected] in the "From:" field and when I manually applied the rule to the Sent messages, they were sent to the Gmail account.
    That's the "articulation work" in action.
    I've looked at some of the discussion you linked (thank you for that) and found it enlighening, though I am not done reading all of it yet.
    There are a number of different issues going on. Modern e-mail is extraordinarily complicated.
    What I do now is not forward work email and keep the daily workflow focused on the Inbox of the [email protected] account, which handles replies appropriately. I then set up a rule to redirect any mail from the work account that is over a day old to the Gmail account. I then organize it on the web interface (which is not optimal, but cuts down my time spent on the web interface from "always" to once daily or so).
    You could probably improve that by creating folders in GMail from within Apple Mail. Once you move an old message from the work server to GMail where you have more room, you can have additional rules to move it around within GMail.
    The only real, definitive solution is to have more room for e-mail. You should contact your system administrator and suggest switching to GMail or Microsoft's version. Everyone hates dealing with e-mail. That is why these transparent e-mail services are so popular. Once it gets setup, all the magic happens in the name servers and all anyone ever sees is "work.org". Plus, you will likely gain some additional functionality that Microsoft Exchange supports that older systems do not.
    In the interim, the best solution is to show the "Reply-to:" field and put your "[email protected]" address in there. Replies will be directed to that address but you will still have to move everything around after receipt. You should be able to configure your "work.org" e-mail system to automatically forward all you rmail to the GMail account. Combined with "Reply-to:", that is about as good as it is going to get.
    If you need more clarification, let me know. Though I think that ML is behaving in a way that is not convenient and I don't see a way to create a hack to fix it. It seems like it would be an easy feature to add, but who knows what Apple folks are thinking...
    What you have described is e-mail spoofing and Apple doesn't support that. No legitimate internet e-mail provider should support it. If Google does, then that is Google's problem. Most other e-mail servers would not allow that and that is why Apple doesn't support it. And, in general, Apple software is simply not very amenable to "hacks".
    I have though about writing an Apple Mail plugin to automatically add a "Reply-to:" to certain e-mail messages. It will be a few months before I get time for that, so don't hold your breath.

  • HT1277 how can i remove the email add from a deleted mailbox from the prompts of the 'from' field?

    how can i remove the email add from a deleted mailbox from the prompts of the 'from' field?

    Thanks a lot, roam! That worked

  • The incorrect iCloud email (in the from field)address is appearing

    The incorrect iCloud email (in the from field) address is appearing on my iPod touch, but not on my MacBook Pro. The I Pod's ICloud email account is using my account for Itunes etc., not the icloud email address, how can I reset the "from" address?

    ok thanks, so if I do nothing straight away, they won't free the address up and give it to someone else, correct?

  • Can I have Mail format the "From" field based on my Address book entries?

    I have most of my contacts in my address book, but Mail still displays the "From" field in the message list pane with the normal email address header.
    Here's an example:
    User A emails me a message from this address:
    "User A" <[email protected]>
    In my Address Book, I have User A's info as this:
    First Name: Bob
    Last Name: Marley
    Email Address: [email protected]
    In Mail, though, the "From" field in the message list view still says ...
    User A
    ... when I want it to say ...
    Bob Marley
    Does that make sense? How can I do this?

    All you need is a plug adaptor, if required. Apple sells an adapter kit:
    http://store.apple.com/us/product/MB974ZM/B?fnode=MTY1NDEwMQ&mco=MTA4NDE3MDQ

  • From field in shared mailbox displays LegacyexchangeDN instead of person's email address.

    We have a situation where a group of users who utilize a shared mailbox are getting a weird issue from time to time.  They will take mail from their own mailbox and drag it to the shared mailbox.  Sometimes the email show up fine, other times the
    from field shows the GUID of the person's mailbox rather than their email address after they move it.  See attached pictures.  Any idea what would cause this and how I would fix it?  It appears this way in everyone's Outlook and OWA.  

    Hi,
    DisplayName is an Active Directory property which represents the display name of a recipient in an appropriate format to display to the end-user. This is a Unicode property which may contain non-ASCII characters so that a user name may contain DBCS characters.
    In your case, you need to create a registry entry on Outlook side.
    For more information, here is a helpful thread for your reference. (Note: Though it is Exchange 2010, it also replies to Exchange 2013 about this issue.)
    Outlook 2013 and Exchange 2010
    https://social.technet.microsoft.com/Forums/exchange/en-US/16e80e30-411c-4325-a7a7-1eb51a78700d/outlook-2013-and-exchange-2010?forum=exchangesvrclientslegacy
    Hope this can be helpful to you.
    Best regards,
    If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Amy Wang
    TechNet Community Support

Maybe you are looking for

  • NWDS SPS 09: Jars not in external Library - Patch available?

    Hello experts, I am facing the problem described here: https://forums.sdn.sap.com/click.jspa?searchID=131779&messageID=2755058 The result of the discussion is that the jars not being included in the external library is a bug of NWDS SP 9. Is there al

  • Upgrading to 10.5.x: checking apps version minimums

    Hopefully, a softball... Finally about to upgrade to OS 10.5--but wondered if there is an easy, one-stop place to check for minimums required of my basic software, rather than be surprised after 10.5 is installed? (I go down my list, checking my soft

  • Help with external hard drive and firewire?

    2 questions:  1) Does anyone know if there is a hub made for the firewire 800 to allow more than 1 device to be hooked up at 1 time? ex... capture deck and external hard drive.  2) I was cleaning up my external hard drive.  I ejected it and now it wo

  • Darwin/BSD message on boot up....

    I formatted my drive and installed OSX 10.4 and ran all updates. Sometimes when i load up the computer it boots up fine. Other times, it gives me this message Darwin/BSD (Kind-Videos-Power-Mac-g4.local) (console) Login: Why is this????

  • Installer Log File

    when i installed office, it seemed that an installer log file was created on the HD. i dragged it somewhere else, but later when i installed other programs (keyserver, acrobat, etc) other installer log files were again created on the HD. I got tried