Finding the group from a page level

I have a requirement to detach a particular page from the master page so that i can edit the respective item.
I have written the below script that look for the group inside masterPageItems and then detach the page.
When i printed "currentPage.masterPageItems.length" in alert, it shown me 120 counts. The issue here is that it is looping through all the 120 items to get the group and then detaching it.  Is there a better way to find the group once i get the "currentPage" rather than looping through all the masterpageitems?  Please help if you have a solution for this.  The script takes a lot of time to execute and need to optimize it.  If anybody require i can send you the INDD sample file for testing .  Thanks in advance
             var myDCPDocument = app.activeDocument;
             for (var pageIndex =0; pageIndex < myDCPDocument.pages.length; pageIndex++)
                    var currentPage = myDCPDocument.pages.item(pageIndex);
                     alert(currentPage.masterPageItems.length);
                     for (var masterPageItemIndex =0; masterPageItemIndex < currentPage.masterPageItems.length; masterPageItemIndex++)
                            var currentPageItem = currentPage.masterPageItems[masterPageItemIndex];
                            if (currentPageItem.constructor.name == "Group")
                                 var groupPageItems = currentPageItem.pageItems;
                                 for (var pageItemIndex = 0; pageItemIndex < groupPageItems.length; pageItemIndex++)
                                      var cntrl = groupPageItems[pageItemIndex];  
                                       if (cntrl.label == "Markets")
                                            var table = cntrl.tables[0];
                                            alert("Total No of Cells :" + tbl.cells.length );
                                            currentPageItem.override(currentPage);
                                            break;

Hi Peter,
That was a good information.  I was able to get the Markets section of the document.  I modified the code as per your suggestion below.
              for (var pageIndex =0; pageIndex < myDCPDocument.pages.length; pageIndex++)
                    var currentPage = myDCPDocument.pages.item(pageIndex);   
                    var currentPageItem = currentPage.masterPageItems[0];
                    var tables = myDCPDocument.stories.everyItem().tables.everyItem().getElements();
                    for (i = 0; i < tables.length; i++)
                            if (tables[i].parent.label == "Markets")
                                   var table = tables[i];
                                   alert("Total No of Cells :" + table.cells.length );
                                   currentPageItem.override(currentPage);
                                   break;
But i am unable to override the pageItem.  Neither it doesn't throw any error nor i am unable to apply the swatch (code pasted below).  Do you think the above code is still having problem? 
Apply swatch on to the detached Markets group
             for (var pageIndex =0; pageIndex < myDCPDocument.pages.length; pageIndex++)
                    var currentApplyPage = myDCPDocument.pages.item(pageIndex);
                     for (var applyGroupIndex = 0; applyGroupIndex < currentApplyPage.groups.count(); applyGroupIndex++)
                           var applyPageItems =currentApplyPage.groups[applyGroupIndex].pageItems;
                           for (var applyPageItemIndex = 0; applyPageItemIndex < applyPageItems.length; applyPageItemIndex++)
                                    var tableControl = applyPageItems[applyPageItemIndex];    
                                    if (tableControl.label == "Markets")
                                        var applyTable = tableControl.tables[0];
                                        for (cellIndex = 0; cellIndex < applyTable.cells.length; cellIndex++)
                                                var applyCellInfo = applyTable.cells[cellIndex];
                                                if (applyCellInfo.contents == "MW-2" )
                                                    applyCellInfo.fillColor = slugNoFillSwatch;
                                                    break;
                                                    //alert('NoFill Swatch is applied for MW-2 market segment sucessfully');
                                         break;

Similar Messages

  • How to find the group ids from which the mail has been sent

    Hi,
    We are able to see the list of mails have been sent to respective mail ids with the help of tcode SOST.
    Is there any way to find through which group ids the mails have been sent.
    Tehe details showing as the mail has been sent by Batchusr.
    Please suggest how to find the group id from where the the mails have been triggered.
    Regards,
    Jena.

    Hi
    This is not helpfull
    If you open any notification QM03, there you will get tab " Action Log"
    If you click on action log , there are two fileds
    Date and time for task release
    I want to fetch these fileds in one of Z report.
    I am unable to find table name for these two fileds
    Task release Date
    Task release Time
    Can we add 'QN CHANGE DATE' parameter in the selection screen (just like QN creation date) w/ range?  The user want to run the report by QN change date as well.

  • Pages IPad: how to  'Find' occurrence of a word in a range starting from somewhere in the middle of document to the end. It seems that 'Find' feature always defaults to finding the word from the start of the document. Thanks

    Pages IPad: how to  'Find' occurrence of a word in a range starting from somewhere in the middle of document to the end. It seems that 'Find' feature always defaults to finding the word from the start of the document. Thanks

    Pages IPad: how to  'Find' occurrence of a word in a range starting from somewhere in the middle of document to the end. It seems that 'Find' feature always defaults to finding the word from the start of the document. Thanks

  • How can I find the index from a specific container?

    How can I find the index from a specific container?
    For example, if I'm traversing through textframes like so (an example, not tested):
    var doc = app.activeDocument;
    var story = doc.pages[0].textFrames[0].parentStory;
    for (var i=0, l=story.textContainers.length; i<l; i++) {
         var textFrame = story.textContainers[i];
         if (textFrame.constructor.name == "TextFrame") {
              var lastPara = textFrame.paragraphs.lastItem();        //How can I find the index of this in relation to the story?
    How can I find the index of "lastPara" in relation to the story rather than the current container?
    I tried:
    var newPara = story.paragraphs[lastPara.index];
    but this results in an invalid object. . .
    alert(newPara.isValid);      //returns false

    The .index property is the character offset. So lastPara will begin at story.characters[lastPara.index].

  • I am trying to reset my Apple TV.  Where to I find the Apple TV Summary page .  Thank you for your help. Gary

    I am trying to reset my Apple TV. 
    Where to I find the Apple TV Summary page . 
    Thank you for your help. Gary

    Thanks for trying to help
    I should have been clearer  My 3rd generation apple tv stoped working. Will not turn on. Battery in the remote changed, new and tested so that is not the issue. I am following the apple support directions to reset from a windows computer (directions from apple support page) and number 5 says to "clicl restore apple tv from the apple tv summary page"  which I can not find anywhere.
    any help would be appreciated

  • How to find the group name for a section programatically?

    I have these display formulas that are being repeated in each group footer.  The only thing that changes are the group names.
    How can I find the group name for the current section?
    The bolded(or starred) items are what I'm trying to create a generic function for.
    Ontario
         Bob
                   1000     Sales     Other
                   2000     Random     Billing
                   200     Phone     Billing
         *Total for Bob*      3200
         Sally
                   2000     Sales     Client
                   1000     Random     Billing
                    300     Cell     Billing
         *Total for Sally* 3300
    *Total for Ontario*       6500
    Thanks in advance,
    J

    I'm not sure if the GroupingLevel or GroupNumber fuctions will help.  (There description in the on-line help leaves much to be desired, IMHO...)
    If not, you could try adding formula fields to each level that sets a global variable to tell your other formula fields what level it is on.  If you only have one or two other formulas, and only one or two groups, this really wouldn't be a whole lot easier.  But if you had a lot of groups or a lot of formula fields that you want to make "group independent" it could help.
    So for each footer, create a formula field like (basic syntax):
    WhilePrintingRecords
    global geoupLevel as String
    groupLevel = "Province"
    formula = ""
    (changing the name given to groupLevel for each footer).  Then in your "generic" formula you could put something like:
    WhilePrintingRecords
    global groupLevel as string
    select case groupLevel
      case "Province"
        formula = "Total for " + {Province}
      case "Name"
        formula = "Total for " + {Name}
      else
        Formula = "Totals"
    end select
    HTH,
    Carl

  • Does anyone know how I can create "facing pages" in new Pages? I could do it in Pages 09, but can't find the option in new Pages.

    Does anyone know how I can create "facing pages" in new Pages? I could do it in Pages 09 but can't find the option in new Pages. I have documents created in Pages 09 and want to do some further work on them, but am now using new pages.

    There were 100+ features that didn't make it into the "new & improved, rewritten from the ground up” Pages 5. Some have returned with the updates & there are some new features that are worthwhile, but there are still 90+ features missing. Leave feedback for the Pages team using the link in the Pages menu and review & rate the new versions in the Mac App Store.
    If you previously had iWork '09, those apps are still in your Applications folder in a folder named iWork '09. You can continue to use them to get things done.

  • How can we export the data from OAF Page to Excel instead of .csv or .txt

    Hello,
    How can we export the data from OAF Page to Excel instead of .csv or .txt
    When i click on the export button it is exporting to txt file, But i need to export the data into Excel by default
    Please help me
    Thanks in advance
    Thanks,
    Raju
    We have changed the below profile option to get the data in excel by default
    Profile Name Export MIME type
    Profile Code FND_EXPORT_MIME_TYPE+
    Existing Value: text/tab-separated-values+
    Change as: Excel
    Thank you,
    Raju
    Edited by: 1006649 on May 21, 2013 10:55 AM

    We have changed the below profile option to get the data in excel by default
    Profile Name Export MIME type
    Profile Code FND_EXPORT_MIME_TYPE+
    Existing Value: text/tab-separated-values+
    Change as: Excel
    Thank you,
    Raju

  • Getting the error while calling the report from oaf page

    Dear all
    when i am calling the report from oaf page
    if (pageContext.getParameter("PrintPDF") != null)
    DataObject sessionDictionary =
    (DataObject)pageContext.getNamedDataObject("_SessionParameters");
    HttpServletResponse response =
    (HttpServletResponse)sessionDictionary.selectValue("HttpServletResponse");
    try
    ServletOutputStream os = response.getOutputStream();
    // Set the Output Report File Name and Content Type
    String contentDisposition = "attachment;filename=EmpReport.pdf";
    response.setHeader("Content-Disposition", contentDisposition);
    response.setContentType("application/pdf");
    // Get the Data XML File as the XMLNode
    XMLNode xmlNode = (XMLNode)am.invokeMethod("getEmpDataXML");
    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
    xmlNode.print(outputStream);
    ByteArrayInputStream inputStream =
    new ByteArrayInputStream(outputStream.toByteArray());
    ByteArrayOutputStream pdfFile = new ByteArrayOutputStream();
    //Generate the PDF Report.
    TemplateHelper.processTemplate(((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getAppsContext(),
    "XXCRM", "XXCRM_EMP",
    ((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getUserLocale().getLanguage(),
    ((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getUserLocale().getCountry(),
    inputStream,
    TemplateHelper.OUTPUT_TYPE_PDF, null,
    pdfFile);
    // Write the PDF Report to the HttpServletResponse object and flush.
    byte[] b = pdfFile.toByteArray();
    response.setContentLength(b.length);
    os.write(b, 0, b.length);
    os.flush();
    os.close();
    } catch (Exception e)
    response.setContentType("text/html");
    throw new OAException(e.getMessage(), OAException.ERROR);
    pageContext.setDocumentRendered(false);
    i am getting the error java.classcastexception at this line
    DataObject sessionDictionary =
    (DataObject)pageContext.getNamedDataObject("_SessionParameters");
    regards
    Sreekanth

    check if you have import oracle.cabo.ui.data.DataObject; in your import statement.
    --Prasanna                                                                                                                                                                                               

  • Could not find the group name.

    HI,
    I executed the below VBS  file in Windows 7 Enterprise Edition workstation and received "Could not find the group name. Code :800708ac"
    GetObject("WinNT://" + WScript.CreateObject("WScript.Network").ComputerName + "/Administrators").Add"WinNT://MYDOMAIN/TEST-TESTWorkstationAdmins"
    I am able to add the "TEST-TESTWorkstationAdmins" in Administrator group manually but not able to add using the script.
    "TEST-TESTWorkstationAdmins" is Global Security Group. Please help me to fix the problem. 
    Regards,
    Boopathi S

    The code in VBScript would look like this:
    Dim AdminGroup
    Set AdminGroup = GetObject("WinNT://" & CreateObject("WScript.Network").ComputerName & "/Administrators,Group")
    AdminGroup.Add "WinNT://MYDOMAIN/TEST-TESTWorkstationAdmins"
    But I would recommend using Group Policy to update local Administrators group membership rather than using a script.
    -- Bill Stewart [Bill_Stewart]

  • Developing a 2 page form, username on the 1st page, password on 2nd how can i force FF to use the username from previous page when it asks to remember acct info?

    I am developing a 2 page signup form, where the person enters their username on the 1st page and password on the 2nd.
    When I test the form, FF asks to remember my password for the site - however it thinks the zipcode (field above the password) is the username on the account.
    I have tried to put their username/email in a hidden field on the 2nd page, just above the password field - and that did not work.
    How can i force FF to use the username from previous page when it asks to remember acct info?

    This website is using autocomplete=off to prevent Firefox from saving and filling the name and password.
    You can remove autocomplete=off with a bookmarklet to make Firefox save names and passwords and other form data.
    *http://kb.mozillazine.org/User_name_and_password_not_remembered

  • Which table find the matching options of invoice level in ap in oracle apps

    hi
    which table find the matching options of invoice level in ap in oracle apps
    thnks

    Hi,
    Have a look at the following note:
    Note: 190156.1 - AP: Which Tables Are Populated When Invoices Are Matched To A PO?
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=190156.1
    Refer to [eTRM |http://etrm.oracle.com] for more details about the tables.
    Regards,
    Hussein

  • Best Practise to find the Calculations from BRD

    Hi Experts,
    I am facing lot of difficulties to find the required calculations and the required Business Rules as I am new to the Hyperion Planning Implementation.
    Could any one please suggest me the best practise to find the calculations from the Business Requirement Document.
    Thanks In advance..
    Chinna.

    Many Thanks Rahul..As of now we are done with the Metadata Load..We need to create the Dataforms now..
    The Main problem started now..need to find the related calculations to attach with dataforms..I am struck there to find the calculations..
    anyway will get back to you if i need any further help..
    Thanks again.

  • Where do I find the Group account number in SAP system

    Hi All,
    I have the same problem. I work in a company where all was installed and configured before my arrival and so I always need to do a lot of research to solve a problem.
    I tried somedays ago using txcode FS00 to create a new GL account but got stocked because the system requested a Group Account Number (Consolidation data in Charts of Accounts).
    I do not know where to find this number in the system. After a very long search, I have given up searching and hereby ask for your help.
    Can anyone tell me where to find the Group Account Number in the system. Is there a txcode for this? I tried already OBD4.
    As I am new in the SAP world, a step by step explanation will be appreciated.
    Many thanks in advance

    Hello aolowu
    Group Account Number field has lot of year/period end ramifications. Here is the definition " When you define the balance sheet and PL structures, then accounts are assigned to line items within the balance sheet and PL. This assignment is made either via the G/L account number or alternatively via the group account number given in this field. The usage of the group account number offers the advantage that by specifying a number, a group of accounts can be assigned immediately to the balance sheet or P+L item".  Suggest you work with a FI guy.
    To quickly get over however, you can enter the same number that you are creating in that field. At my current client, I have seen several accounts set up like this, although many of them have a different number there.

  • My RGB colors are turning to cmyk while bringing image from illustrator or photoshop. Why?  Removing the image from that page bright RGB colors are back.. hmm

    My RGB colors are turning to cmyk while bringing image from illustrator or photoshop. Why? 
    Removing the image from that page bright RGB colors are back.. hmm

    Edit > Transparency Blend Space > Document RGB

Maybe you are looking for

  • How do I sync my iPhone 5 with my iPad ?

    how do I sync my iPhone with my iPad so my pictures and other content from my phone go to my iPhone?

  • EBS - BAI2 file format

    Hi Guys We are using BAI file format as the format which has been send by our banker and the same is working fine. T- Code used to upload is FF_5 and the algarithm used is 011 Now our banker has changed the file format to BAI2 In the given file we ha

  • PCR: Characteristics vs form interface

    Hi, While creating a new PCR or modifying an existing PCR, I am not sure what to do with the Characteristcs in QISRSCENARIO. Is this the one used in SFP to do the drag and drop. In that case, what for is the interface. Can anyone pl explain. Regards

  • Dynamic create synonym script

    we want to create few synonyms dynamicalyy, (ie) we will aceept the owner Name,DB link Names as parameter (ex) I need to create dynamic statement create synonym A.ATAB FOR B.ATAB@link1 while i execute the statement as create synonym A.ATAB FOR &OWNER

  • CS4 Brush tool

    The brush tool loses the outline of the tool as the diameter gets larger. e.g. at 175px there is a fill outline of the tool. At 200px only a semi-circle is shown. Is this a bug or a feature or what? Thanks