Using a script to "recolor" forms

Hello,
I don't know if this is possible, but I thought I'd ask. We maintain forms applications that exist in a Real World Mode and a Test Mode. The only difference is what database I connect to , and the color of the forms. Is there a way to write a script (maybe in perl) that could modify the .fmb files and change the form colors without having to bring up the forms developer and slop through all the forms? I've looked at the .fmb files and unfortunately they appear to not be entirely ascii....

> How do you tell which database you're attached to?
Each db has a table with one row and column with 'Test' or 'Production' in it. The startup form that each user is required to use queries that table and stores the value in a global variable.
> I would also like to see the sample code
Not sure what good seeing the code is, but here is our PLL library procedure called by each form's pre-form trigger:
PROCEDURE PLL_PRE_FORM IS
    Cur_form    Varchar2(30);
BEGIN
--*   Common initialization procedures
  COPY('0','SYSTEM.MESSAGE_LEVEL');
  DEFAULT_VALUE(' ','GLOBAL.BACKGROUND_COLOR');
  -- SDSU globals
  DEFAULT_VALUE(' ','GLOBAL.SD_FORMS_TYPE');
  DEFAULT_VALUE(' ','GLOBAL.SD_DATABASE_TYPE');
  DEFAULT_VALUE(' ','GLOBAL.SD_BACKGROUND_COLOR');
  Cur_form := GET_APPLICATION_PROPERTY(CURRENT_FORM_NAME);
  IF GET_APPLICATION_PROPERTY(OPERATING_SYSTEM) <> 'MACINTOSH' THEN
    DECLARE
      WINDOW_ID        WINDOW;
      WTitle           Varchar2(100);
      p_version        varchar2(20); --for sd
      sd_forms_type    varchar2(20); --for sd
      sd_database_type varchar2(20); --for sd
      sd_bgd_color     varchar2(20); --for sd
    BEGIN
      WINDOW_ID   := FIND_WINDOW('ROOT_WINDOW');
      IF ID_NULL(WINDOW_ID) THEN
        WINDOW_ID := FIND_WINDOW('WINDOW0');
        IF ID_NULL(WINDOW_ID) THEN
          PLL_MSGF('  PLL_PRE_FORM:  '
                    ||'Window must be named ROOT_WINDOW OR WINDOW0');
        END IF;
      END IF;
      Set_Window_Property(Window_Id,Window_State,Maximize);
      WTitle := Get_Window_Property(Window_Id,Title);
      WTitle := nvl(WTitle,Cur_form);
      -- SD globals:
      If Cur_form <> 'S100' then
        p_version        := NAME_IN('PARAMETER.VERSION');
        sd_forms_type    := ltrim(NAME_IN('GLOBAL.sd_forms_type'));
        sd_database_type := ltrim(NAME_IN('GLOBAL.sd_database_type'));
      End if;
      -- for SD, add form version, and change if Testing database.
      IF  sd_database_type = 'PRODUCTION'
      AND sd_forms_type    = 'PRODUCTION' THEN
        WTitle := SUBSTR(WTitle || ' v.' || p_version  ,1,100);
      Elsif sd_forms_type    is not null
      or    sd_database_type is not null then
        --sd testing instance
        WTitle := SUBSTR(WTitle ||' v.'         || p_version
                                ||', Form: '    || sd_forms_type
                                ||', Database: '|| sd_database_type
                         ,1,100);
        sd_bgd_color := ltrim(NAME_IN('GLOBAL.SD_BACKGROUND_COLOR'));
        if sd_bgd_color is not null then
          copy(sd_bgd_color,'GLOBAL.BACKGROUND_COLOR');
        end if;
      End if; -- end of SD-specific code
      If Get_Application_Property(User_Interface) = 'WEB' then
        --Web forms:  set MDI title, erase W0 title.
        Set_Window_Property(Window_Id,Title,' ');
        Set_Window_Property(Forms_MDI_Window,Title,' ' || WTitle);
        --- Check if running SeparateFrame=False (form within browser)
        If get_window_property(forms_mdi_window,title) is null then
          --Cannot set browser title; need to set Window0 title--
          Set_Window_Property(Window_Id,Title,' ' || WTitle);
        end if;
      Else -- client/server forms
        Set_Window_Property(Forms_MDI_Window,Title,' ');
        Set_Window_Property(Window_Id,Title,' '||WTitle||' ');
      End if;
    END;
  END IF;
  -- Set background color of canvas if user has changed it.
  Declare
    Cnv1 canvas  := FIND_CANVAS('CANVAS1');
  Begin
    If NOT id_null(Cnv1) then
      -- store original (design-time) color
      PLL_MB.CNV_BGD_COLOR:= get_canvas_property(Cnv1,background_color);
    End if;
    If NOT id_null(Cnv1)
    and NAME_IN('GLOBAL.BACKGROUND_COLOR') <> ' ' then
      SET_CANVAS_PROPERTY(Cnv1,
                   BACKGROUND_COLOR,NAME_IN('GLOBAL.BACKGROUND_COLOR'));
    End if;
  End;
  -- Set window size at least as large as Window0.
  -- Reduce size if H and W are more than 110% of Window0 size
  Declare
    H          number;
    W          number;
    Win0_id    window := FIND_WINDOW('WINDOW0');
    MDI_id     window := Forms_MDI_Window;
    B_continue boolean := false;
  Begin
    If  NOT id_null(Win0_id)
    and NOT id_null(MDI_id) then
      W := Get_Window_Property(Win0_id,Width)  + 1;
      H := Get_Window_Property(Win0_id,Height) + 1;
      If  W between 640 and 700
      and H between 400 and 450
      and Get_Window_Property(MDI_Id,window_state)='NORMAL' then
        B_continue := true;
      end if;
    End if;
    If Get_Application_Property(User_Interface) = 'WEB' then
      W := W + 14; -- Web forms
      H := H + 124;
    end if;
    if  B_continue then
      -- set window to minimum height and width
      if Get_Window_Property(MDI_id,Width )<W  then
         Set_Window_Property(MDI_id,Width,  W);
      end if;
      if Get_Window_Property(MDI_id,Height)<H then
         Set_Window_Property(MDI_id,Height, H);
      end if;
      -- If H and W are both more than 110% of window H,W,
      -- then set to 110% of H,W.
      if  Get_Window_Property(MDI_id,Width )>1.1 * W + 1
      and Get_Window_Property(MDI_id,Height)>1.1 * H + 1 then
          Set_Window_Property(MDI_id,Width,  1.1 * W );
          Set_Window_Property(MDI_id,Height, 1.1 * H );
      end if;
    end if;
  End;
END PLL_PRE_FORM;

Similar Messages

  • How to get the context data using java script in interactive forms

    Hi All,
    How to get the context data using java script in interactive forms by adobe,  am using web dynpro java
    thanks.

    Hi venkat,
    Please Refer this link.
      Populating one Drop-Down list from the selection of another Drop-down list
    Thanks,
    Raju.

  • How to use Java Script in Oracle Forms 10g

    Hello,
    Appreciate if anyone could help me using Java Script in Oracle Forms 10g?
    Thanks
    GM

    Thank you for your reply. I was reading on the metalink that we could use the to call the java script from oracle Forms 10g (Doc ID 265863.1)
    Example:
    WEB.SHOW_DOCUMENT ('javascript:void(window.open("http://www.oracle.com","","location=no,toolbar=no,menubar=no,status=no,"));self.close()','_blank');
    I tried it but it did not open the any window as it claims. Am I missing anything? Is there any IE related setting which I need to modify for the above to work?
    Regards
    GM

  • Oracle apex popup using java script in tabular form select list(Am new to apex help me out... )

    Hi ...
      i have a tabular form
      have two columns in that form, kept as a select list by selecting that 1st select list data the related datas has to be popup after selecting that it has to be displayed in the  2nd column by using
    java script
    eg:
    1st column empno-----by selecting the empno the related empname has to be popup
                     dept no....by selecting the deptno the related deptname has to be popup 
    thanks in advance,
    kishore

    This is a very common question, see
    https://forums.oracle.com/thread/2359498

  • Can i use java scripts in d2k forms and reports

    Good day all,
    Can i use the above said, if yes any assistance or eg.
    thanks in advance.

    Hi,
    The appropriate Forum for this question would be
    Forms
    (Forums Home » Oracle Technology Network (OTN) » Products » Developer Suite » Forms)
    Thanks
    Vineet

  • How to use a script to kill only forms sessions idle for over 30 minutes?

    We want to use a script to kill forms users idle for over 30 minutes, but we don't want to kill background concurrent processes waiting for resources. even though we set up the timeout but it won't work for users who exit forms ungracefully.
    thanks!

    Java runs at the serverside, while you need a clientside solution. Javascript is perfectly suitable. Pass the current maxInactiveInterval() value to a Javascript variable and write a function around it. You can use for example the onkeypress attribute of the body to clear the timeout counter.

  • Condition verification in java script on Adobe form.

    Hello Experts,
    I am using a interactive forma text element on my view. (java web dynpro)
    It's a simple application. I am trying to figure out how it works with java script.
    I have a text field. which displays employ is sales or production dept
    the values in the data view and its the output element of a BAPI which returns XF,TF,HF and XK,JK,HK
    (record.dept)
    if its XF, TF, HF on the text field in the adobe form should print sales else production.
    I have never used java script on adobe form.
    I figured the strip above the form in adobe designer is used for java script.
    can any one, let me know how I can manipulate.  the record value
    Here is what I am trying record.dept = XF |TF|JF . but i dont know how to run the java script or its syntax.
    Your help is highly appreciated.

    James,
    xfa.host.messageBox should show you an alert dialog box to check data you are getting.
    And yes you are right. You can set the value of textfield using code you mentioned.
    if(record.dept.equalsIgnoreCase("XF")
                 || record.dept.equalsIgnoreCase("TF")
                          record.dept.equalsIgnoreCase("JF"))
       xfa.host.messageBox("The value is Sales");
       <Text-field id>.value = "Sales";
    else
       xfa.host.messageBox("The value is Production");
      <Text-field id>.value = "Production";
    You can even set the texfields to be readOnly, hide some of them etc. But for that I would suggest you going thru the LiveDesigner help. It would solve most of your doubts :-).
    Chintan
    Edited by: Chintan Virani on Feb 19, 2008 3:37 PM

  • Hiding Pages in ADOBE form using formcalc scripting.

    Hi Experts,
    I am new to ADOBE form and currently working on invoice print output. (NOT an  Interactive adobe form)
    My requirement is
    i wanted to print one main page and 5  different annexures(anexures are having different layouts so is in diff forms and contained in diff pages)
    Deppending on 'Oreder reason' (made as global variable)  , i need to select appropriate annexure and print
    main page and any one of the annexure.
    so i should hide all other annexure, to achive this i used formcalc scripting.
    i tried hiding annexure 2 by following code,
    data.Annexure2::ready:form - (FormCalc, client)
    if ( data.G_F_ORDER_REASON.rawValue == "ANX" )
    then $.presence = "hidden"
    endif
    i have passed value 'ANX' to this , i could see the value of order reason printed on page Annexure2 but it is not executing (getting in to if condition) condition and not hiding the page ...
    Experts please help me...
    this way i have to hide 4 other annexures...please help me or give me some other option to achive this.
    thanks and regards
    varun
    Edited by: skyblue on Aug 6, 2011 3:30 PM

    coding Formcalc is a pain.
    But you're doing the right thing by passing in a variable and hiding based on the content of it.
    Here's an example of where I'm hiding a subform on a page.
      if ( main_sf2.charter_only.CHARTER_DOC.rawValue eq "X" ) then
       main_sf2.pts_sf.presence = "visible"
      else
       main_sf2.pts_sf.presence = "hidden"
    endif
    Looks like your code is similar - try changing
    ( data.G_F_ORDER_REASON.rawValue == "ANX" )  to
    ( data.G_F_ORDER_REASON.rawValue  eq "ANX" )
    or instead of $.presence = "hidden"  fully qualify the name of your page to  data.Annexure2.presence = "hidden"

  • Adobe Form : detect page break using java script

    Hi,
    How can we detect a page break at a runtime using java script? I need to display a data in internal table at header and unique for a document number. i've 10 order list which has multiple items, each of the orders are printed in a new page and i wanted to know this event using a java script which could help me to add some additional logic at header.....pls can someone help on this?

    Hello Prabhu,
         From your doubt, what I understand is that, You have designed a header in Master Page. You need to fill this header using the Item table which is already designed in the design view(body page). Means you want to fill the Item details(which are in body page) into the header(which is in the master page).
    To read the contents from body page into master page, you need to write Javascript code on the header fields(which is in the master page) in the Layout Ready Event.
    For example, if you want to fill the field Order_description in header(master page) from the column Order_Description which is in the Item table(body page)
    In the form layout, select the order_description field and in the event READY LAYOUT write the below JavaScript code.
    var currpage = xfa.layout.page(this);------> Get the current page
    var fields = 0;------> Variable to store the number of fields in that page.
    fields = xfa.layout.pageContent(currpage-1, "field", 0); ------> Get the number of fields
    for ( i=0; i<= fields.length-1; i++ ) ------> Loop on each field on the page
        if ( fields.name == "ORDER_DESCRIPTION" ) ------> Check if the corresponding field is in the Item table
             this.rawValue = fields.item(i).rawValue; ------> Assign that value in the Header field
    Repeat the same steps for other fields in the Header. This will work for all Purchase Orders spanned across multiple pages.

  • ADOBE form page hiding using formcal scripting

    Hi Experts,
    I am new to ADOBE form and currently working on invoice print output. (NOT an Interactive adobe form)
    My requirement is
    i wanted to print one main page and 5 different annexures(anexures are having different layouts so is in diff forms and contained in diff pages)
    Deppending on 'Oreder reason' (made as global variable) , i need to select appropriate annexure and print
    main page and any one of the annexure.
    so i should hide all other annexure, to achive this i used formcalc scripting.
    i tried hiding annexure 2 by following code,
    data.Annexure2::ready:form - (FormCalc, client)
    if ( data.G_F_ORDER_REASON.rawValue == "ANX" )
    then $.presence = "hidden"
    endif
    i have passed value 'ANX' to this , i could see the value of order reason printed on page Annexure2 but it is not executing (getting in to if condition) condition and not hiding the page ...
    Experts please help me...
    this way i have to hide 4 other annexures...please help me or give me some other option to achive this.
    thanks and regards
    varun
    Edited by: skyblue on Aug 6, 2011 3:30 PM
    Moderator message: please do not cross-post.
    Edited by: Thomas Zloch on Aug 8, 2011 11:29 AM

    Hi Experts,
    I am new to ADOBE form and currently working on invoice print output. (NOT an Interactive adobe form)
    My requirement is
    i wanted to print one main page and 5 different annexures(anexures are having different layouts so is in diff forms and contained in diff pages)
    Deppending on 'Oreder reason' (made as global variable) , i need to select appropriate annexure and print
    main page and any one of the annexure.
    so i should hide all other annexure, to achive this i used formcalc scripting.
    i tried hiding annexure 2 by following code,
    data.Annexure2::ready:form - (FormCalc, client)
    if ( data.G_F_ORDER_REASON.rawValue == "ANX" )
    then $.presence = "hidden"
    endif
    i have passed value 'ANX' to this , i could see the value of order reason printed on page Annexure2 but it is not executing (getting in to if condition) condition and not hiding the page ...
    Experts please help me...
    this way i have to hide 4 other annexures...please help me or give me some other option to achive this.
    thanks and regards
    varun
    Edited by: skyblue on Aug 6, 2011 3:30 PM
    Moderator message: please do not cross-post.
    Edited by: Thomas Zloch on Aug 8, 2011 11:29 AM

  • New to Flash, create a flash form which is emailed using CGI script when submit button is pressed

    I'm trying to build a form in flash that is emailed using CGI
    script. I'm just lost and confused and I just can't seem to figure
    this out.
    This is the CGI coding for HTML and I just need to convert it
    to use in CS3:
    <form action="
    http://www.hostmonster.com/monstermail"
    enctype="multipart/form-data" method="POST">
    Name: <input type="text" name="Name"><br>
    Email: <input type="text" name="mailfrom"><br>
    Phone: <input type="text" name="Phone"><br>
    Service: <input type="text" name="Service"><br>
    <input type="hidden" name="sendtoemail"
    value="[email protected]"><br>
    <input type="submit" value="Send Email">
    </form>
    This is a link to what I'm working on:
    http://www.alternativesolutionsforyou.com/contact.htm

    OK, sorry....no more errors when I test the movie but when I
    test it live....nothing happens???? Here's the link again:
    http://www.alternativesolutionsforyou.com/contact.htm
    Code as it is:
    lv=new LoadVars();
    lv.Name=name.text;
    lv.mailfrom=email.text;
    lv.Phone=phone.text;
    lv.Service=service.text;
    lv.sendtoemail="[email protected]"
    yourSubmitButton.onPress=function(){
    lv.sendAndLoad("
    http://www.hostmonster.com/monstermail",lv,"POST");
    lv.onData=function(){
    // data successfully sent
    // this will execute if your cgi script returns something
    after executing
    I haven't adjusted what happens after you his the submit
    button yet.....just trying to get the email working.

  • I have a infopath form and i want to publish this form using powershell script(No central admin usage) and i am using Infopath 2010.

    How to publish infopath form using powershell script in infopath 2010?
    Is any approach for such solution.

    Hi,
    Try below command:
    Uninstall the existing solution (based on the from file name):
    Uninstall-SPInfoPathFormTemplate -Identity Exampleform.xsn
    Install the new solution (based on the from file name):
    Install-SPInfoPathFormTemplate -Path C:\Form.xsn
    Disable feature on site collection level
    Disable-SPInfoPathFormTemplate -Identity "Form.xsn" -Site http://SPSite
    Enable feature on site collection level
    Enable-SPInfoPathFormTemplate -Identity "Form.xsn" -Site "http://SPSite"
    See this blogs for your ref:
    http://rgielen.blogspot.in/2010/11/deploy-infopath-2010-forms-with.html
    http://mysharepointwork.blogspot.in/2010/09/deploy-infopath-forms-with-powershell.html
    Hope it could help
    Hemendra: "Yesterday is just a memory,Tomorrow we may never see"
    Whenever you see a reply and if you think is helpful, click "Vote As Helpful"! And whenever
    you see a reply being an answer to the question of the thread, click "Mark As Answer

  • How to do Front End Validation for JSP Forms using Java Script with 9iJD...

    How to do Front End validation using 9iJD. Any wizard is there. We need to do the val. using Java Script. If its not available, please include that in the Production Release.

    Thanks a lot. When is the Production Release is scheduled. Please tell us whether itll be available for Free Download. Bec, we couldnt buy. Bec, if its working fine with all the options without any bug only, we can ask our company to buy 9iJD by stating the advantages. Just explain us.

  • Unable to capture the adf table column sort icons using open script tool

    Hi All,
    I am new to OATS and I am trying to create script for testing ADF application using open script tool. I face issues in recording two events.
    1. I am unable to record the event of clicking adf table column sort icons that exist on the column header. I tried to use the capture tool, but that couldn't help me.
    2. The second issue is I am unable to capture the panel header text. The component can be identified but I was not able to identify the supporting attribute for the header text.

    Hi keerthi,
    1. I have pasted the code for the first issue
    web
                             .button(
                                       122,
                                       "/web:window[@index='0' or @title='Manage Network Targets - Oracle Communications Order and Service Management - Order and Service Management']/web:document[@index='0' or @name='1824fhkchs_6']/web:form[@id='pt1:_UISform1' or @name='pt1:_UISform1' or @index='0']/web:button[@id='pt1:MA:0:n1:1:pt1:qryId1::search' or @value='Search' or @index='3']")
                             .click();
                        adf
                        .table(
                                  "/web:window[@index='0' or @title='Manage Network Targets - Oracle Communications Order and Service Management - Order and Service Management']/web:document[@index='0' or @name='1c9nk1ryzv_6']/web:ADFTable[@absoluteLocator='pt1:MA:n1:pt1:pnlcltn:resId1']")
                        .columnSort("Ascending", "Name" );
         }

  • Unable to turn column headers bold in Word table using VB Script

    I have created a table in Microsoft Word 2010 using VB Script (this is via the script engine that forms part of HP Quality Centre functionality).  The table itself is OK, 2 columns with centred headers.  However, I am unable to make the column
    headers bold.  I have spent hours searching the net and trying various options to no avail can somebody please help me.
    Set objWord = CreateObject("Word.Application")
    Set objDocument = objword.Documents.Open(Src_Dir & template_file
    Const wdAlignParagraphCenter = 1'var to control justification of the table columns
    Const NUMBER_OF_ROWS = 1 'number of rows in intial table
    Const NUMBER_OF_COLUMNS = 2 'number of colums in the intitial table
    'search for the "TAA_TABLE" bookmark embedded in the document template, this is where the table will be created
    Set objRange=objDocument.Bookmarks("TAA_TABLE").Range
    'create the table
    objDocument.Tables.Add objRange, NUMBER_OF_ROWS, NUMBER_OF_COLUMNS
    Set objTable = objDocument.Tables(2)
    'populate column headers
    objTable.Cell(1, 1).Range.Font.Bold = True
    objTable.Cell(1, 1).Range.Text = "Sub Contractor"
    objTable.Cell(1, 2).Range.text = "TAA Number"
    'centre the column headers
    objDocument.Tables(2).Rows(1).Select
    Set objSelection = objWord.Selection
    objSelection.ParagraphFormat.Alignment = wdAlignParagraphCenter
    'format the table with plain grid lines
    objTable.AutoFormat(16)
    'set the column widths
    objTable.Columns(1).Setwidth 230,0
    objTable.Columns(2).Setwidth 230,0
    Any help is graetfully appreciated, as this is driving me wild.
    Cheers,

    Hi Citronax,
    I haved noticed that you used objTable.AutoFormat to format the table. Based on my understanding, this fuction will applie a predefined look to a table.
    After I move the code which bolder the text behind this line of code, it works well for me.
    'format the table with plain grid lines
    objTable.AutoFormat (16)
    objTable.Cell(1, 1).Range.Font.Bold = True
    Regards & Fei
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for