Message Dialog Box and - InfoPath Dev
in

InfoPath Dev

Message Dialog Box and

Last post 10-14-2008 06:42 AM by chandrakanth. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 10-13-2008 07:43 PM

    Message Dialog Box and

    hello. im new to infopath. i hope someone can help me with this. i have a repeating table containing diff. courses with its respective course fee, days, participants, and total fee.

    two of the courses has a provision that if this course has been chosen : the client will be billed for a minimum of 10 persons.

    course = CourseA, CourseB 

    for example the course fee of CourseA is 20,000.00, the participants = 3

    so, the total fee = 20,000 * 10 participants bec. of the provision.

    now, to inform the user of the form about this, i would like to use a "Show a dialog box message".

    i've tried this, it works but the dialog box prompts several times before it displays the total fee and until it gets an error saying that the ONAFTERCHANGE has reached its limit. something like that...

    i dont know about ONAFTERCHANGE, i've seen this in the Data Validation under Script (Events). im only using Rules.

    can u please help me how to fix this using rules?

    and also what should be the right usage of rules since these courses has its own conditions/provisions. it seems like when i set each course's conditions, it's not functioning well. it seems like the provision of the other course is functioning at the wrong course. Since, i have many courses listed in my drop down box. can u give me a step by step procedure on this? i'll give a few example. thanks a lot.

    course               coursefee             days              participants             totalfee

    COURSEA         20,000.00             1                   (to be filled up)        (PROVISIONS/ CONDITIONS should be set up) - if participants <=9, the total fee should be equal to coursefee*10

    COURSEB         30,000.00             2                   (to be filled up)        (PROVISIONS/ CONDITIONS should be set up) - if participants <=9, the total fee should be equal to coursefee*10

    COURSEC         40,000.00             3                   (to be filled up)        total fee = coursefee*participants less discount (discount = 20% if participant = 5-10 persons)

    COURSED         50,000.00             5                   (to be filled up)        total fee = coursefee*participants less discount (discount = 20% if participant = 5-10 persons)

    COURSEE         60,000.00             11                  (to be filled up)        total fee = coursefee*participants less discount (discount = 20% if participant = 5-10 persons)

    can you help me how to do this so as not to mixed up all the formulas. thanks alot.

     

     

  • 10-13-2008 09:56 PM In reply to

    • ravig
    • Top 500 Contributor
    • Joined on 06-21-2008
    • Posts 27

    Hi,

    Please write the code as mentioned below

            bool valueChanged = false;                                                     public void valuechanged_OnAfterChange(DataDOMEvent e)

            {

              if (valueChanged)

             {    

               return;

             }                                     valueChanged = false;

             //Execute your statements over here.

             valueChanged = true;                                  //Write your alert statement over here.

          }

     

    Ravi G
  • 10-13-2008 10:07 PM In reply to

    hi Ravi,

     thank you for your response. im sorry but im not also familiar in writing codes. can u step me through where to insert these codes? is there a way to do this in rules? thanks a lot.

  • 10-14-2008 06:42 AM In reply to

    Hi,

    Please follow these steps for adding OnAfterChange functionality for a control.

    ·         Before writing OnAfterChange for a control make sure that your InfoPath form template code language type is “C#”.

    o   For changing the “InfoPath form template code language” please follow the below steps:

    §  In the menu bar select “Tools”à “Form Options” à “Programming”

    §  By default the programming language is “JScript”. So change that into “C#”. By selecting the “Programming Language” dropdown.

    Now add “OnAfterChange” for the control.

    ·         For adding OnAfterChange for a control please follow the below steps.

    o   Right click on the control to which you want to add “OnAfterChange” functionality.

    o   Select “Programming”. In that Select “On After Change Event”.

    Chandrakanth/GGKTech
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.