Change subform presence based on pageCount?

I am losing my mind here! There's got to be a way to do this:
Trying to restrict the total number of pages in a dynamic form with a repeating subform.
The "Restrict Page Occurrence" option on the Master Page object tab does not work properly because of the repeating subform in the form.
I have two master pages. MasterPage1 is the first page of the document and MasterPage2 is pages 2+.
The form starts off as 1 page and if the user creates a few instances of the repeating subform, it'll automatically flow onto master page #2.
I created two buttons at the end of the form, each within their own subforms.
subform1.SubmitButton1 the actual Submit button and its presence should be "visible" if the total document page count is equal to or less than 3.
subform2.SubmitButton2 is a fake submit button set up with an error message on its click event and its presence should be set to "visible" if the total document page count is greater than 3 (it should be hidden otherwise).
I cannot for the life of me get the presence of these subforms to work! I'm not sure if I put code on the PageCount item on master page #2, or on the subform1 and subform2... 
Here's what I was trying:
if (xfa.layout.pageCount>3){
     Page1.subform1.SubmitButton1.presence = "hidden";
     Page1.subform2.SubmitButton2.presence = "visible";
} else {
     Page1.subform1.SubmitButton1.presence = "visible";   
     Page1.subform2.SubmitButton2.presence = "hidden";  
Where am I going wrong? Thanks for any help you can provide!

I figured it out! Here was the solution:
I wrapped my two buttons (Submit and fake submit) in a subform called "buttons". (Without wrapping them in the subform the functionality still worked but the buttons ended up at the top of page 1 instead of at the end of the form.)
Then I put this Javascript in the layout:ready event of SubmitButton1 (the real submit button):
if (xfa.layout.pageCount()>3) {
  Page1.buttons.SubmitButton1.presence = "hidden";
else {
  Page1.buttons.SubmitButton1.presence = "visible";
And I put this Javascript in the layout:ready event of SubmitButton2 (the fake submit button):
if (xfa.layout.pageCount()>3) {
  Page1.buttons.SubmitButton2.presence = "visible";
else {
  Page1.buttons.SubmitButton2.presence = "hidden";
The presence of both buttons is set to "Hidden" in the Object - Field tab.
On the click event of SubmitButton2 I have this JavaScript:
xfa.host.messageBox("Per the instructions on page 1 of this form, this document must be no longer than 3 pages. Please delete some text from the document before you submit it so that it is 3 pages or less or else it will be rejected.", "Exceeded Allowed Number of Pages", 1);

Similar Messages

  • Script for changing objects presence based on amount range

    Hello,
    Is there a way to change an objects presence (either a field or a subhead) based on the entered amount range in a numeric field? 
    For example:
    -The numeric field amount entered is a range between 1 and 49,999, then "Signature Subhead 1" appears.
    -The numeric field amount entered is a range between 50,000 and 250,000, then "Signature Subhead 2" appears.
    Etc.
    Any advice for this script would be appreciated.
    Thanks!

    Hi Bruce,
    Your solution worked perfectly.  If I was to expand the ranges (let's say to three ranges), would I just have to add another "case this" logic section such as this?
    switch (true)  
    case this.rawValue >= 1 && this.rawValue <= 49999:  
      SignatureSubhead1.presence = "visible";  
      SignatureSubhead2.presence = "hidden";
      SignatureSubhead3.presence = "hidden"; 
      break;  
    case this.rawValue >= 50000 && this.rawValue <= 249999:  
      SignatureSubhead1.presence = "hidden";  
      SignatureSubhead2.presence = "visible";
      SignatureSubhead3.presence = "hidden";    
      break;
    case this.rawValue >= 250000 && this.rawValue <= 500000:    
      SignatureSubhead1.presence = "hidden";  
      SignatureSubhead2.presence = "hidden";
      SignatureSubhead3.presence = "visible";    
      break;  
    default:  
      SignatureSubhead1.presence = "hidden";  
      SignatureSubhead2.presence = "hidden";
      SignatureSubhead3.presence = "hidden";   
    Appreciated,
    Eric

  • How to restrict lync user to change their presence

    Is it possible to restrict users to set their presence manually in Lync client.
    Some user in organization manually change their presence which is very panic some time

    Yes, you can get it from the back end database. Take a look here:
    http://blogs.technet.com/b/dodeitte/archive/2011/05/11/how-to-get-the-last-time-a-user-registered-with-a-front-end.aspx
    and
    http://gallery.technet.microsoft.com/office/List-last-time-a-User-b905cf5f
    If this helped you please click "Vote As Helpful" if it answered your question please click "Mark As Answer"
    Georg Thomas | Lync MVP
    Blog www.lynced.com.au | Twitter
    @georgathomas
    Lync Edge Port Check (Beta)
    This forum post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • Changing a field based on another field

    hi one and all
    i am looking for a way to change a field based on another field. if i have item 2 and item 8 on the page and item 8 needs to be required based on item 2 based on a requirement, how would this be done.
    ex if item 2 has a PO inputed, when it is moved off the field, item 8 should be changed from required false to required true. i have tried in both the process request and process form request with no luck
    any suggestions.
    thanks

    hello again
    after your input and after reviewing the tutorial ( which i accomplished based on data from a table but not a field ) , i did the following and have been fighting it for a day. am i doing this correctly
    on the itemid OrgRptCode1 i changed the action type to firePartialAction and the event is name o1
    then i added this code to see if the action would fire
    if (pageContext.getParameter("OrgRptCode1") !=null) // either line will be commented out
    if (pageContext.getParameter("o1") !=null) // either line will be commented out
    System.out.println("Field is not empty");
    else
    System.out.println("Field is empty");
    am i missing a step . also
    when i enter the page i get Field is empty. when i enter the field and tab off i get the error page w/ this msg
    oracle.apps.fnd.framework.OAException: java.lang.NullPointerException
         at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:888)
         at oracle.apps.fnd.framework.webui.OAPageErrorHandler.prepareException(OAPageErrorHandler.java:1064)
         at oracle.apps.fnd.framework.webui.OAPageErrorHandler.processErrors(OAPageErrorHandler.java:1294)
         at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2396)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1512)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:463)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:384)
         at OA.jspService(OA.jsp:40)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
         at java.lang.Thread.run(Thread.java:534)
    ## Detail 0 ##
    java.lang.NullPointerException
         at uaboaf.oracle.apps.xxuab.hr.orghierarchy.webui.manageOrgCO.processFormRequest(manageOrgCO.java:289)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:734)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:352)
         at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(OAPageLayoutHelper.java:943)
         at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(OAPageLayoutBean.java:1546)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:929)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:895)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:751)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:352)
         at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(OAFormBean.java:373)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:929)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:895)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:751)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:352)
         at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(OABodyBean.java:340)
         at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2392)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1512)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:463)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:384)
         at OA.jspService(OA.jsp:40)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
         at java.lang.Thread.run(Thread.java:534)
    java.lang.NullPointerException
         at uaboaf.oracle.apps.xxuab.hr.orghierarchy.webui.manageOrgCO.processFormRequest(manageOrgCO.java:289)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:734)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:352)
         at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(OAPageLayoutHelper.java:943)
         at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(OAPageLayoutBean.java:1546)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:929)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:895)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:751)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:352)
         at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(OAFormBean.java:373)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:929)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:895)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:751)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:352)
         at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(OABodyBean.java:340)
         at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2392)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1512)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:463)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:384)
         at OA.jspService(OA.jsp:40)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
         at java.lang.Thread.run(Thread.java:534)

  • Change page header based on group being printed

    I have a report that is grouping by two fields, field A & B.  When the report is printing group A I would like the page header to be "Group A Header" when the report is printing the groups for field B I would like the page header to be "Group B Header".  I can't seem to find a way to change the header based on which group is being printed.  If I do "If GroupNumber = 1 Then "Group A Header"" it prints "Group A Header for the first group and the first record of the second field group.
    Basically what I am trying to do is create a report that has a chart that is un-grouped followed by charts that are grouped.  I've accomplished this by creating a formula that is always true for the un-grouped chart and adding it as a group.  below that I have a field group for the charts I want filtered by group.   When the un-grouped charts are printed I want the page header to reflect that, when the grouped charts are printed I want the page header to contain the group name.

    Not enough info. Try CR 2008 it has more control over printing.

  • How do I change the "home based" computer for my IPOD to a new laptop?

    How do I change the "home based" computer for my IPOD to a new laptop?  When I plug in y IPOD classic, I get a msg asking me to erase the IPOD.  What I'd like to do is make the laptop my "home base" vs. my desktop.  I have had no success when using icons from ITUNES. 

    You need to move the iTunes library from your home computer to your new laptop first.  From there you'll be able to continue syncing your iPod as before.  This iTunes support article covers the different methods available for moving your iTunes library from one PC to another.
    iTunes: How to move your music to a new computer
    B-rock

  • How to change datasource name based on the partition in configplan

    Hi
    Can any one please give me some solutions regarding how to change datasource name based on the partition in
    configplan.
    can't we do this in configuration plan?

    If you want to change template based on parameter. you have to use below syntax
    v_layout boolean
    V_LAYOUT:= FND_SUBMIT.add_layout(template_appl_name => 'SQLAP' -- application short name
    ,template_code => 'HUBAPAPN' -- template name
    ,template_language => 'en'
    ,template_territory => '00'
    ,output_format => 'PDF');
    Above can be used in plsql stored procedure before submitting Concurrent Program (Bi Publisher report) or may be you can try to add this code in Oracle reports after report or before report trigger
    Thanks
    Kamalakar

  • Change Master Page based on Text Content

    Hello,
    I have found a few examples relating to changing Master pages based on Style.
    However, I would like to change all Pages that flag "True" with the query of the "2-1134" to to "Master-C" for example.
    I have 12 master Pages with different strings that I don't mind editing the script to make work.
    The document is close to 1,000 pages.
    I am having trouble merging so many different scripts into something that will work.
    Platform: Indesign CS4 6.0.5 - OS X (Intel)
    Thank you so much for your input, help and guidence.

    This is what layers are for. Open the Layers panel and make at least one more layer. Put the graphic on the lower layer and the footer on the upper layer.

  • Change Template Logo based on the selected values...

    Hi All,
    It is possible to change the logo based on the values or company I've selected. Its for invoice template since we have multiple client. The management want to change logo every time they select specific company invoice. Thanks
    Whel

    yes..you can achieve with one conditional formatting report..I am Talking about OBIEE reports only not publisher thing
    1)upload all your images in /Images folder of server
    2)create one Report with Company name column,click edit Column properties--> conditional formatting--->add conditions as required like Company name ='Oracle'-->In format window select Image and select Custom Image -->fmap:images/oracle.jpg-->in default select "Image only" option-->repeat for all images-->Make this company column as "is prompted" -->save the Report-->put this report on the dash board where that company prompt is available...and see results :).I implemented it successfully

  • How do I change the Linux based LMS 4.2 root password

    How do I change the Linux based LMS 4.2 root password?  I tried "passwd" and "passwd root" while in shell mode and it said "passwd: all authenticaiton tokens updated successfully."  However it makes me use the old password to get into the shell.

    Hi,
    Did you saved the config after updating the password ?
    try this command " copy run start" after changing the password.
    Thanks-
    Afroz
    ****Ratings Encourages Contributors ***

  • Changing ERS & GR based IV flags

    SAP Experts,
    Is it possible to change the GR based IV and ERS flags on a schedule agreement after it has been released against? The problem we have is AP is forced to enter invoice only after GR has been performed and we would like to change that however the fields in the schedule agreement are grayed out. The only time it allows us change is before any materials have been released against it.
    Is there a supported way to change those fields after they have been released against?
    thanks,

    Hi,
    If the ERS functionality is used, it is logical that SAP will recommend the setting of GR-based IV indicator as in this particular case, invoices will be generated based upon GR posting.
    Cheers,
    HT

  • Way to change the  Message based on Imported IDoc

    Hi,
    I just want to know if there is way to change the message based on Imported IDoc?
    Basically I imported an IDoc from R/3, this Imported Object would display just one of the Segment for where there are  max allowable limit is n segment (the same segment), now during message mapping I need to have more than one Segment of same type...Wasn't sure how to add more segments?
    Thanking in advance

    Hi Rajan,
    If I have understood you correctly you,you mean that you have imported an Idoc with a segment with cardinality 0..unbounded(n) and you want to reproduce the segment n times in the target structure.
    you need not change the cardinality.This needs to be done in the mapping itself.just map the source structure to the target segment, handling the context properly such that for every occurence of the source structure the corresponding segment is produced in the target.
    Regards,
    Sulakshana

  • Changing from Menu Based to Auto Play

    How do I change from menu based to auto play when burning a project to DVD. It used to and some how it changed to menu based, and I wan autoplay. Thanks

    Gink
    The bottom line is at the end of this whole write up...
    Are you expecting to see a button, like in earlier versions, that specifically is labelled AutoPlay?
    If so, Premiere Elements 11 and 12 does not have such a button.
    Once you hit Reset, that resets back to the no menu stage which represents AutoPlay. In that state, when you click Done, your project has no menus and is classed as AutoPlay.
    Are you trying to get navigation of the DVD-VIDEO using the TV Remote and just the Timeline markers with no menus in the project? Or are you content to place your DVD-VIDEO on DVD disc in the DVD player and let it play out to completion without any TV Remote Navigation?
    I will stay with you on this until we figure out where we are differing in the discussion exchange.
    WAIT - Light bulb may have just lit...
    I think that I see where you are coming from on this. Is this it? Given that you have burned your Timeline to DVD-VIDEO as AutoPlay and that you go back into the program and decide to burn another "AutoPlay" DVD-VIDEO. You have long since click Done to the Movie Menu section.
    If you click Tools Menu/Movie Menu, you will be faced with menu choice which do not include an AutoPlay one.
    So what you can do instead, keep away from Tools Menu/Movie Menu, go directly to Publish+Share/Disc. In that process, you will be greeted by the following pop up
    Just click No and proceed with your burn to DVD-VIDEO on DVD disc.
    What that it?
    Looking forward to your reply.
    Thanks.
    ATR

  • Change submit destination based on form selection

    Is it possible to change the recipient of a form based on the info that was filled? for example
    checkbox A is selected -> form emailed to recipient A
    checkbox B is selected -> form emailed to recipient B
    checkbox A and B is selected -> form emailed to recipient A and B

    Thanks for your answers.
    I have already checked those links.
    Now th problem what I am facing is,
    I am not able to call the function ChangeLanguage through javascript.
    I have created a dropdwon using Hovermenu and added English and German.
    Now when I click on these the function should be called.
    Please help me in getting how setClientSideScript() can be used to call a function.
    or any other way to call the function after clicking on Hovermenu Item.
    Thanks in advance,
    Sumangala

  • RE:Header and Footer change in CCP Based on User....

    After enable header and footer in Administration ,i can change the header and footer in login and signup page but i can not change those for particular user where they are adding in Organization unit...so i need steps to add header and footer for particular user which is based on css...pls send ur suggestions to [email protected]..

    Cisco Cloud Portal modules may be customized to provide different appearances for different users. The appearace (CSS stylesheet) shown to the user depends on what stylesheet is associated to that user's Home OU. One style may be designated as the Default. If a default is specified, it is used for any user whose home organization (OU) has not be assigned a style. If no default is specified, the default Cloud Portal stylesheets is used. If a hierarchical organization structure (like in Cisco IA for Cloud) is used, you may specify that a style is inherited by all child OUs of a parent.
    The high level steps to creating and applying custom stylesheets for individual organization units are:
    Create a new folder in RequestCenter.WAR/custom e.g. RequestCenter.WAR/custom/ABC-Company;
    Add the custom style sheets (copy and customize). Filenames must be custom.css and portal-custom-header.css.
    In CP, go to Administration>Settings>Custom Styles.  Add a new stylesheet by clicking Add and then navigate to the folder you created.
    Assign OUs to this stylesheet.  Note that a user may be a member of many OUs, but CSS stylesheets associated based on the user's Home OU.  For example, if Sarah belongs to the Finance Team, the Marketing Team, but her Home OU is Operations, she will get the Operations stylesheet appearance.
    Resources:
    CP 9.4 Configuration Guide – Chapter 4

Maybe you are looking for