Tabular forms based on pipelined functions - can it be done?

Hi there,
Pipelined functions are great, specially when you want to encapsulate the access to tables instead of just SELECTing from them (what I am doing a lot in my current project.)
However Apex 4 does not like them, at least not for tabular forms...
I want to handle myself the update/insert/delete process, so I don't need the MRU default functionality (all the access to the data is via APIs). But at the same time I want to just SELECT from my pipelined function and set the item types using the builder interface as with any tabular form (without having to use the apex_item API). Also I want to be able to use tabular form validation.
To start with, you can only create a tabular form based on a table or view. To overcome this issue, I created a dummy view with the fields I wanted and created my tabular form on it. Then I changed the FROM clause to FROM TABLE(myfunction). It didn't work as it seems it tries to select the ROWID for each row... Of course my pipelined function doesn't return one but I don't need one anyway as I will be doing the data manipulation myself based on the PK.
For this to work, I had to create a collection, populate it with the result of the pipelined function in a page process every time the page is loaded, create a view on that collection and base the tabular form on the view... A lot of work and overhead for something that should be very simple in principle.
Then, I found out that if I remove the default MRU process that is automatically created, the tabular form validations stop working (as I posted in another thread). So I have to leave a "dummy" MRU process there with condition = never for it to work.
The application I am working on is all based on API calls and pipelined functions so all this work has to be repeated for each tabular form that is needed.
If it was possible to base a tabular form directly on a pipelined function it would be such an elegant solution.
Is there a better way to implement this? Shouldn't Apex be more compatible with pipelined functions? (at least in regards to tabular forms, they work well with normal forms, reports, LOVs etc)
Thanks
Luis

As I mentioned before, I don't handle inserts (well, I cheat).... On my page, there is a form to set up a request - prompts for a few things, and when submitted, calls a stored procedure:
:P2_REQUEST_RESULT := Simon.Apex_Campus_Guest.Setup_Request(:P2_GROUP_NAME,
       :P2_COAS_ORGN, :P2_START_DATE, :P2_END_DATE, :P2_Quantity, :P2_Generic_Names);
Which creates an APEX collection, which in turn is made visible via a pipelined function turned into a view:
create or replace view Apex_Campus_Guest_Request_va as
select seq_no,
        user_name,
       group_name,
        comments
  from table ( Apex_Campus_Guest.Request_Result )
I have a second region which is tabular form on a query - conditional on select 1 from Simon.apex_campus_guest_request_va (the view defined above).
When this submitted, I have standard MRU and MRD processes (Seq_No is the primary key). This then runs into the appropriate trigger - the update trigger is as follows:
trigger Apex_Campus_Guest_Req_Upd
instead of update on Apex_Campus_Guest_Request_va
for each row
declare
        cg_rec  campus_guest_maint.rec;
begin
        cg_rec := Campus_Guest_Maint.Request(
                        name => :new.user_name,
                        group_name => :new.group_name,
                        comments => :new.comments);
end;I don't know off hand why it isn't asking for a rowid - but may be that I specified a PKEY column. The insert case fails, as it tries to add a "Returning" statement in the original select. I actually find that annoying as a function is defined to allocate the PKEY from a sequence, so it doesn't need to ask for it that way.

Similar Messages

  • Problem in tabular form based on dynamic view and pagination

    Hi All,
    I have a manual tabular form based on a dynamic view. The view fetches the records based on search criteria given by the user in all cases. But this view fetches ALL records when user clicks on pagination, without considering the search criteria. This is the problem I am facing.
    I am doing the following:
    Since tabular form does not support pl/sql function returning query, I cannot use a table directly. I need my results based on search criteria selected by user. Hence I created a dynamic view and used a "INSTEAD OF UPDATE" trigger to update the table.
    I use a set bind variables procedure, on load before header for setting the variables.
    This view fetches the correct data based on user search always. It creates a problem only in one situation, when using pagination in the report.
    The example can be found at:
    http://apex.oracle.com/pls/otn/f?p=19399:1:
    username = [email protected]
    pwd = kishore
    Here if "manager name" is entered as test, we get 5 records in "Summary of requests" report and 5 records in "Inactive Requests" report. When user clicks on Pagination in any of the reports, ALL the 7 records get fetched in "Summary of Requests" and 6 records in "Inactive Requests". How can I overcome this problem?? The report must consider the search variables even when pagination occurs.
    Is this because, the inbuilt "html_PPR_Report_Page" executes the region query once again by considering all search variables as NULL?
    Backend Code is at:
    http://apex.oracle.com/pls/otn/
    workspace: sekhar.nooney
    Username :[email protected]
    pwd: kishore
    application id = 19399
    My region code is something like:
    select *
    from regadm_request_v
    where access_type = :F110_REGADM
    and status <> 'INACTIVE'
    order by request_id
    My view code is:
    CREATE OR REPLACE VIEW REGADM_REQUEST_V
    AS
    SELECT *
    FROM REGREGOWNER.REGADM_REQUEST
    WHERE upper(employee_name) LIKE '%'||nvl(upper(REGADM_REQUEST_PKG.GET_EMPLOYEE_NAME),'%')||'%'
    AND upper(manager_name) LIKE '%'||nvl(upper(REGADM_REQUEST_PKG.GET_MANAGER_NAME),'%')||'%'
    AND upper(employee_sunetid) LIKE '%'||nvl(upper(REGADM_REQUEST_PKG.GET_EMPLOYEE_SUNET_ID),'%')||'%'
    AND upper(manager_sunetid) LIKE '%'||nvl(upper(REGADM_REQUEST_PKG.GET_MANAGER_SUNET_ID),'%')||'%'
    AND upper(request_date) LIKE '%'||nvl(upper(REGADM_REQUEST_PKG.GET_REQUEST_DATE),'%')||'%'
    AND upper(USAGE_AGREEMENT_RECVD) LIKE '%'||nvl(upper(DECODE(REGADM_REQUEST_PKG.GET_USAGE_AGREMNT_RECVD,'~!@',NULL,REGADM_REQUEST_PKG.GET_USAGE_AGREMNT_RECVD)),'%')||'%'
    AND upper(STATUS) LIKE '%'||nvl(upper(DECODE(REGADM_REQUEST_PKG.GET_STATUS,'~!@',NULL,REGADM_REQUEST_PKG.GET_STATUS)),'%')||'%'
    AND upper(REQUEST_APPROVED) LIKE '%'||nvl(upper(DECODE(REGADM_REQUEST_PKG.GET_REQUEST_APPROVED,'~!@',NULL,REGADM_REQUEST_PKG.GET_REQUEST_APPROVED)),'%')||'%'
    AND upper(nvl(APPROVAL_DATE,sysdate)) LIKE '%'||nvl(upper(REGADM_REQUEST_PKG.GET_APPROVED_DATE),'%')||'%'
    AND upper(APRVL_REQUEST_SENT) LIKE '%'||nvl(upper(DECODE(REGADM_REQUEST_PKG.GET_EMAIL_APPROVERS,'~!@',NULL,REGADM_REQUEST_PKG.GET_EMAIL_APPROVERS)),'%')||'%'
    AND upper(NOTIFY_APPROVED) LIKE '%'||nvl(upper(DECODE(REGADM_REQUEST_PKG.GET_APPROVAL_NOTIFICATION,'~!@',NULL,REGADM_REQUEST_PKG.GET_APPROVAL_NOTIFICATION)),'%')||'%'
    I would be glad for any suggestions.
    Andy/Varad any ideas? You both helped me a lot on my problems for the same application that I had faced before in More Problems in Tabular form - Please give me suggestions.
    Thanks,
    Sumana

    Hi Andy,
    The view and the package for setting bind variables work properly in my entire application other than the pagination. A pity that I came across this only now :(
    I have used this same method for holding variables in another application before, where I needed to print to PDF. I used this approach in the other application because my queries were not within the APEX character limit specified for the "SQL Query of Report Query shared component".
    In this application, I initially had to fetch values from 2 tables and update the 2 tables. Updateable form works only with one table right? Hence I had created a view. Later the design got changed to include search and instead of changing the application design I just changed the view then. Still later, my clients merged the 2 tables. Once again I had just changed my view.
    Now, I wanted to know if any method was available for the pagination issue (using the view itself). Hence I posted this.
    But as you suggested, I think it is better to change the page design quickly (as it would be much easier).
    If I change the region query to use the table and the APEX bind parameters in the where clause as:
    SELECT *
    FROM REGADM_REQUEST
    WHERE upper(employee_name) LIKE '%'||nvl(upper(:P1_EMPLOYEE_NAME),'%')||'%' .....
    I also changed the ApplyMRU to refer to the table.
    Here the pagination issue is resolved. But here the "last Update By" and "Last Update Date" columns do not get updated with "SYSDATE" and "v(APP_USER)" values, when update takes place. Even if I make the columns as readonly text field, I am not sure how I can ensure that SYSDATE and v('APP_uSER') can be passed to the columns. Any way I can ensure this? Please have a look at the issue here: http://apex.oracle.com/pls/otn/f?p=19399:1:
    I have currently resolved the "last update" column issue by modifying my view as:
    CREATE OR REPLACE VIEW REGADM_REQUEST_V
    AS
    SELECT *
    FROM REGADM_REQUEST
    I modified my region query to use APEX bind parameters itself as:
    SELECT *
    FROM REGADM_REQUEST_V
    WHERE upper(employee_name) LIKE '%'||nvl(upper(:P1_EMPLOYEE_NAME),'%')||'%' .....
    And I use the "INSTEAD OF UPDATE" trigger that I had initially written for update. The code is:
    CREATE OR REPLACE TRIGGER REGADM_REQUEST_UPD_TRG
    INSTEAD OF UPDATE
    ON REGADM_REQUEST_V
    REFERENCING NEW AS NEW OLD AS OLD
    FOR EACH ROW
    BEGIN
    UPDATE REGREGOWNER.REGADM_REQUEST
    SET MANAGER_EMAIL = :NEW.MANAGER_EMAIL
    , EMPLOYEE_EMAIL = :NEW.EMPLOYEE_EMAIL
    , STATUS_UPDATE_DATETIME = SYSDATE
    , USER_UPDATE_ID = (SELECT v('APP_USER') FROM DUAL)
    WHERE REQUEST_ID = :OLD.REQUEST_ID;
    END;
    Please let me know how I can resolve the "last update" column issue using the table itself. (Just for my learning)
    Thanks,
    Sumana

  • How to add a new row in Tabular Form based on a table

    Hi
    I have tabular form based on a table.
    I want the table to have an empty row when there is no data
    in the table so that I can enter data directly.
    But right now whenever the page is launched, its showing a no data found message and I have to press the 'Add Row' button to enter data.
    Can anyone help me out on this?
    Thanks

    Hi Leo
    Your suggestion works fine in the APEX 2.1
    But in 3.0.1 it gives this error :
    Error in add row internal routine: ORA-01476: divisor is equal to zero
    Error Unable to add rows.
    I am not sure why this happens.

  • Select List in Manual Tabular Form based on a previous column

    I have a manual tabular form that have several columns One column (vendor) is a select list that should be based on a previous column (Vendor Type - Internal/External). So if the user selects Internal for Vendor Type, the Vendor column's select list should only contain those vendors with type of Internal. By the way, it also uses APEX collections.
    select
      apex_item.hidden                   (1,C015) STATUS,
      apex_item.checkbox                 (2,SEQ_ID,'title="check to delete"') CHECKBOX,
      case
        when (c001 is not null and c002 is not null) then
          '<a onclick="return false;" href="f?p='||:APP_ID||':20:'||:APP_SESSION||'::NO:20:P20_ID,P20_REQ_ID,P20_SEQ_ID:'||C001||','||C002||','||SEQ_ID||'"><img alt="" src="/i/ed-item.gif"></a>'
      end ||
      apex_item.hidden                   (4,C001) ID,
      apex_item.hidden                   (5,C002) JOB_QUOTE_ID,
      apex_item.date_popup2              (6,C003,'MM/DD/YYYY',11,2000,'onChange="f_set_end_date(this.id,'|| ROWNUM || ');"') ||
      apex_item.select_list_from_query   (7,C004,'select svcs_description d, svcs_code r from csrsr_service_codes order by 1 asc',null,'YES',null,'-Select-') || '<BR />' ||
      apex_item.date_popup2              (8,C005,'MM/DD/YYYY',11) ||
      apex_item.text                     (9,C006,8,15,'style="text-align:right;"') || '<BR />' ||
      apex_item.select_list              (10,C007,'Staff;S,External;E',null,'YES',null,'-Select-') ||
      apex_item.select_list_from_query_xl(11,C008,'select vendor_name d, vendor_number r from csrsr_vendors_v',null,'YES',null,'-Select-') || '<BR />' ||
      apex_item.text                     (12,C009,50,100,'colspan=2') COL12,
      apex_item.text                     (13,to_char(to_number(C010),'FML999G999G999G999G990D00'),10,15,'style="text-align:right;"') AMT1,
      apex_item.text                     (14,to_char(to_number(C011),'FML999G999G999G999G990D00'),10,15,'style="text-align:right;"') AMT2,
      apex_item.text                     (15,to_char(to_number(C012),'FML999G999G999G999G990D00'),10,15,'style="text-align:right;"') AMT3,
      apex_item.text                     (16,to_char(to_number(C013),'FML999G999G999G999G990D00'),10,15,'style="text-align:right;"') AMT4,
      apex_item.hidden                   (24,C001) ||
      apex_item.hidden                   (25,C002) ||
      apex_item.hidden                   (3,SEQ_ID) ||
      apex_item.text                     (17,to_char(to_number(C014),'FML999G999G999G999G990D00'),10,15,'style="text-align:right;"') CHBK_AMT,
      'value' COLTYPE
    from
      apex_collections
    where
      collection_name = 'CSRSR_JOBCOSTS_C' and
      C015 in ('O','U','N')
    union all
    select
      apex_item.hidden                   (1,null) STATUS,
      apex_item.checkbox                 (2,null,'title="check to delete"') CHECKBOX,
      apex_item.hidden                   (24,null) ||
      apex_item.hidden                   (4,null) ID,
      apex_item.hidden                   (25,null) ||
      apex_item.hidden                   (5,null) JOB_QUOTE_ID,
      apex_item.date_popup2              (6,null,'MM/DD/YYYY',11,2000,'onChange="f_set_end_date(this.id,'|| ROWNUM || ');"') ||
      apex_item.select_list_from_query   (7,null,'select svcs_description d, svcs_code r from csrsr_service_codes order by 1 asc',null,'YES',null,'-Select-') || '<BR />' ||
      apex_item.date_popup2              (8,null,'MM/DD/YYYY',11) ||
      apex_item.text                     (9,null,8,15,'style="text-align:right;"') || '<BR />' ||
      apex_item.select_list              (10,null,'Staff;S,External;E',null,'YES',null,'-Select-') ||
      apex_item.select_list_from_query_xl(11,null,'select vendor_name d, vendor_number r from csrsr_vendors_v',null,'YES',null,'-Select-') || '<BR />' ||
      apex_item.text                     (12,null,50,100,'colspan=2')  COL12,
      apex_item.text                     (13,null,10,15,'style="text-align:right;"') AMT1,
      apex_item.text                     (14,null,10,15,'style="text-align:right;"') AMT2,
      apex_item.text                     (15,null,10,15,'style="text-align:right;"') AMT3,
      apex_item.text                     (16,null,10,15,'style="text-align:right;"') AMT4,
      apex_item.hidden                   (24,null) ||
      apex_item.hidden                   (25,null) ||
      apex_item.hidden                   (3,null) ||
      apex_item.text                     (17,null,10,15,'style="text-align:right;"') CHBK_AMT,
      'value' COLTYPE
    from
      dual
    How can I accomplish this?
    Application Express 4.1.2    
    Oracle 10g Rel 2
    Robert

    Hi,
    Then you are probably looking cascading select list in tabular form?
    http://dbswh.webhop.net/htmldb/f?p=BLOG:READ:0::::ARTICLE:2003800346210117
    Regards,
    Jari

  • Detail tabular form based on two tables

    db11gxe , apex 4.0 , firefox 24 ,
    hi all ,
    i have a master detail form based on two tables , the detail form ofcourse based on one table , the problem is i want to include a column of another
    table into the tabular form , so i have changed the query of the tabular form and included the column in it correctly ,
    but the problem is about saving data , i can not save the data , i think
    because the "mru" process is based on one table , that is because i face an error talking about "mru" process when i try to save the data ,
    Error in mru internal routine: ORA-20001: no data found in tabular form Unable to process update.
    so
    what should i do to save the data ? should i create another "mru" process based on the other table or what ?
    thanks

    Anything beyond "simple" requires that you do it yourself.  I believe that what you want is "beyond simple"
    As far as I know, you can only use the 'mru' on one table.
    (I could be wrong)
    If the conditions are right, you might be able to simplify things such that you can use the 'mru'.
    ie CREATE VIEW on the two tables.
    However, you need to understand how Oracle treats DML operations on views, what type of views can be updated, etc., etc.
    If just creating the view doesn't work, creating an INSTEAD OF trigger on the view come to mind...
    (lol) - at that point, you have already started down the 'dark path' of creating your own 'MRU'
    personal note:  triggers have a really baaaddd habit of hiding code from other developers.  you are better off, in the long run, creating your own 'mru'..
    ie a package with procedures to handle INSERT, UPDATE, and DELETES
    MK

  • Update primary key with a tabular form based on a select list for each row

    Hello!
    I've two tables: Table1 with only one column (primary key) is a foreign key for table2.column1 (primary key). There is also a second primary key column in table2.
    Now I want to change the primary key values in table2.column1 with a tabular form (MRU) based on a select list (LOV based on table1.column1) for each row.
    The user should be able to choose for every row a new value from the select list to change the old primary key value at this position.
    How can I do this with ApEx?
    I've the tabular form and so on, but at the moment I get the following error:
    "Error in mru internal routine: ORA-20001: Fehler in MRU: row= 1, ORA-20001: ORA-20001: Die aktuelle Version der Daten in der Datenbank wurde geändert, seit der Benutzer einen Update-Prozess eingeleitet hat. ..."
    Thank you for your support!
    Kay

    Hello!
    I've two tables: Table1 with only one column (primary key) is a foreign key for table2.column1 (primary key). There is also a second primary key column in table2.
    Now I want to change the primary key values in table2.column1 with a tabular form (MRU) based on a select list (LOV based on table1.column1) for each row.
    The user should be able to choose for every row a new value from the select list to change the old primary key value at this position.
    How can I do this with ApEx?
    I've the tabular form and so on, but at the moment I get the following error:
    "Error in mru internal routine: ORA-20001: Fehler in MRU: row= 1, ORA-20001: ORA-20001: Die aktuelle Version der Daten in der Datenbank wurde geändert, seit der Benutzer einen Update-Prozess eingeleitet hat. ..."
    Thank you for your support!
    Kay

  • Insert a number of rows for tabular form based on frequency value

    Hi,
    I have a page with two search items.
    Based on the values in the search item, a report is created as tabular form.
    The information displayed has a frequency column.
    Values for frequency can be Q, Y, M, D
    I would like to know if it is possible to to load the form with a standard numbers of row depending on the frequency.
    Example: If frequency is Q ,then when i click the go button in the search region, the tabular shoud load with the information displaying 4 rows, even if the information returned is less than 4 rows.
    If frequency is Y ,then when i click the go button in the search region, the tabular shoud load with the information displaying 2 rows, even if the information returned is less than 2 rows.
    When no data is found, the form should load displaying a number of empty rows depending on the frequency.
    Thanks

    Following this example:
    http://apex.oracle.com/pls/otn/f?p=31517:209
    you should be able to achive that.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • URGENT: tabular form based on multiple tables

    Hi All,
    Its very urgent.......Can anybody tell me how to create a single tabular form to insert/update values from different tables.
    I want to create a tabular form with 3 cols. 1st col should be from one table and another two cols from other table.Please help.........
    Thank You
    Regards,
    Vinaya.

    You can use iframes in your page: (an iframe is a frame in your page. In this frame you can load another page) that way you can create three pages. The first page is the master page. The second and third page which also have tabular forms, are loaded as iframes in the first page
    The iframe is created as follows on your first page:
    1.create a html region
    2 create the tabular form on the second and third page
    3.reference the pages by entereing  the following code in the regions that will be used for displaying them:
    <iframe name="Your_region_name"   id="123" frameborder = "0" src=the page referenced width="580 px" height="250px" scrolling = "auto"></iframe>
    for example:
    <iframe name="Charge_Region"   id="123" frameborder = "0" src="f?p=&APP_ID.:14:&SESSION." width="580 px" height="250px" scrolling = "auto"></iframe>

  • Creating a Tabular Form based on Input Parameters passed from another page?

    Hello,
    APEX version 3.2
    DB version 9.2
    Internet Explorer 6
    I created a tabular form, but do not want to return all the records from the table.
    Is it possible to create a parameter page for the user to enter a string of values that will be submitted to create a tabular form, only displaying those records from the table?
    Thanks.

    Why not use an instr with your data in a bind variable in your where clause for the select?? Page 1 sets an item called P2_Parameter with your value string slightly modified ('12345','345632','645534534','3434344')
    Select a,b,c,d,e from some_table where INSTR(TO_CHAR(Lookup_column,'099999999'),:P2_Parameter)
    Maybe that will work? Its off the top of my head, but should get you what you want.. (But to agree with one of the other posters, it is a BAD Design..) I would try like an interactive report to allow them to enter in acct #'s or whatever these are and let them access the rows that way..
    Thank you,
    Tony Miller
    Webster, TX

  • One LIFNR, based on a function can send multiple values to traget.

    Dear SDNers,
    I need your help to solve this problem…
    Let me explain the situation.
    I have a field value “LIFNR”, which is sending a value from the source to target.
    Here by using a User Define Function based on parameters I have to map the exact target.
    The problem is:
    Currently I am having a function which is sending  a value to the target based on parameters and some times the target values are more that a single value. At that situation the function returns a random value to the target value.
    In the below Old Function there is a method used to execute only one value, if more than one values are there then it will select a random value from them and send that value to the destination.
    IFIdentifier src = XIVMFactory.newIdentifier(strContext, senderAgency, senderScheme);
    IFIdentifier dst = XIVMFactory.newIdentifier(strContext, receiverAgency , receiverScheme);
    String strResult = XIVMService.executeMapping(src, dst, a);
    Solution as in New Function,
    I have created a array to that particular destination variable and stored all value in array and passed to that target value. I have bold that letters.
    //here I run a loop to store multiple destination value
    if(receiverService.length>1)
    for(i=0;i<receiverService.length;i++)
    if (receiverService.equals("EM1CLNT003")||receiverService.equals("KM1CLNT003")||receiverService.equals("C11CLNT003")) receiverAgency<i> = "C11CLNT003";
    I am sending both the functions
    My question is is that LIFNR can send the multiple values to the detination for this change ?
    And also I want to know how to execute this program and transport and testing this UDF.
    Please need your inputs.
    Thanks
    Bala Prasad
    4. Old Function
    java.util.regex.Pattern;java.util.Vector;java.util.regex.Matcher;com.sap.aii.mapping.value.api.*;
    public String get_Value_Mapping_Table_V(String a,String scheme,String context,Container container){
    // PART1 : First we need to get the sender - and receiver service from the container object
    GlobalContainer globalContainer;
    String senderService = new String();
    String receiverService = new String();
    java.util.Map map;
    //Fill variables
    globalContainer = container.getGlobalContainer();
    map = globalContainer.getParameters();
    // Get the sender- and receiver service constants
    senderService = (String) map.get(
    StreamTransformationConstants.SENDER_SERVICE);
    receiverService = (String) map.get(
    StreamTransformationConstants.RECEIVER_SERVICE);
    // PART2: Now we need to find the correct value mapping table
    String strContext = context;                                //some context value
    String senderScheme = scheme;                                    //VendorNumber or VendorAccountGroup
    String receiverScheme = scheme;
    String receiverAgency = new String();
    if (receiverService.equals("EL1CLNT100")||receiverService.equals("KL1CLNT100")||receiverService.equals("PL1CLNT100")) receiverAgency = "PL1CLNT100";
    if (receiverService.equals("D01CLNT100")||receiverService.equals("T01CLNT100")||receiverService.equals("P01CLNT100")) receiverAgency = "P01CLNT100";
    if (receiverService.equals("EM1CLNT003")||receiverService.equals("KM1CLNT003")||receiverService.equals("C11CLNT003")) receiverAgency<i> = "C11CLNT003";
    String senderAgency =  "MEPCLNT100";
    IFIdentifier src = XIVMFactory.newIdentifier(strContext, senderAgency, senderScheme);
    IFIdentifier dst = XIVMFactory.newIdentifier(strContext, receiverAgency , receiverScheme);
                try {
                            String strResult = XIVMService.executeMapping(src, dst, a);
                            return strResult;
                } catch (ValueMappingException e) {
                            return a;
    5. New Function
    java.util.regex.Pattern;java.util.Vector;java.util.regex.Matcher;com.sap.aii.mapping.value.api.*;
    public String get_Value_Mapping_Table_N(String a,String scheme,String context,Container container){
    // PART1 : First we need to get the sender - and receiver service from the container object
    GlobalContainer globalContainer;
    String senderService = new String();
    String receiverService = new String();
    java.util.Map map;
    //Fill variables
    globalContainer = container.getGlobalContainer();
    map = globalContainer.getParameters();
    // Get the sender- and receiver service constants
    senderService = (String) map.get(
    StreamTransformationConstants.SENDER_SERVICE);
    receiverService = (String) map.get(
    StreamTransformationConstants.RECEIVER_SERVICE);
    // PART2: Now we need to find the correct value mapping table
    String strContext = context;                                //some context value
    String senderScheme = scheme;                                    //VendorNumber or VendorAccountGroup
    String receiverScheme = scheme;
    String receiverAgency[] = new String(); //here I changed into a array to store multiple value
    if (receiverService.equals("EL1CLNT100")||receiverService.equals("KL1CLNT100")||receiverService.equals("PL1CLNT100")) receiverAgency = "PL1CLNT100";
    if (receiverService.equals("D01CLNT100")||receiverService.equals("T01CLNT100")||receiverService.equals("P01CLNT100")) receiverAgency = "P01CLNT100";
    //here I run a loop to store multiple destination value
    if(receiverService.length>1)
    for(i=0;i<receiverService.length;i++)
    if (receiverService.equals("EM1CLNT003")||receiverService.equals("KM1CLNT003")||receiverService.equals("C11CLNT003")) receiverAgency<i> = "C11CLNT003";
    }String senderAgency =  "MEPCLNT100";
    IFRequest src = XIVMFactory.newIFRequest(strContext,senderAgency,senderScheme);
    IFRequest dst = XIVMFactory.newIFRequest(strContext,receiverAgency,receiverScheme);
                try {
                            String strResult = XIVMService.executeMapping(src, dst, a);
                            return strResult;
                } catch (ValueMappingException e) {
                            return a;

    Janaki,
    "and it did not work."
    That's useless information.
    When asking for help with a technical question here, you need to describe exactly what you did, showing all code, explaining the entire context in which the code is used, and showing all error messages and actual results along with a description of the expected results.
    One thing though, if this example is based on the standard EMP table, why does "depno" have no "t" in it in all your references?
    Scott

  • Tabular Form based on table with lots of columns - how to avoid scrollbar?

    Hi everybody,
    I'm an old Forms and VERY new APEX user. My problem is the following: I have to migrate a form application to APEX.
    The form is based on a table with lots of columns. In Forms you can spread the data over different tab pages.
    How can I realize s.th similar in APEX? I definitely don't want to use a horizontal scroll bar...
    Thanks in advance
    Hilke

    If the primary key is created by the user themselves (which is not recommended, you should have another ID which the user sees which would be the varchar2 and keep the primary key as is, the user really shouldn't ever edit the primary key) then all you need to do is make sure that the table is not populated with a primary key in the wizard and then make sure that you cannot insert a null into your varchar primary key text field.
    IF you're doing it this way I would make a validation on the page which would run off a SQL Exists validation, something along the lines of
    SELECT <primary key column>
    FROM <your table>
    WHERE upper(<primary key column>) = upper(<text field containing user input>);
    and if it already exists, fire the validation claiming that it already exists and to come up with a new primary key.
    Like I said if you really should have a primary key which the database refers to each individual record itself and then have an almost pseudo-primary key that the user can use. For example in the table it would look like this:
    TABLE1
    table_id (this is the primary key which you should NOT change)
    user_table_id (this is the pretend primary key which the user can change)
    other_columns
    etc
    etc
    hope this helps in some way

  • Enable/Disable item Based Value from Select in Tabular Form

    Hi Guys
    I want to Disable text field in Tabular form, Based on the Select List Item Value.
    Let's Say
    I'm having one select lista and text box in each record in tabular form.
    Select List having 2 items ... Add Text(return value 1) and No Text(return value 2)
    if value =1 then i want to enable text box , so user can enter value.
    if value=2 then text box won't allow to add text or will become disalbe.
    Please Help
    Thanks

    Hi,
    You can do this by using a small java script
    <script language="JavaScript" type="text/javascript">
    <!--
    function FldEnableDisable(pThis)
    if (pThis == 50)
      $x('P2_TEXT').disabled=true;}
    else
    { $x('P2_TEXT').disabled=false; }
    //-->
    </script>Here P2_Text is the text box whose value I am enabling or disabling based on the selected value from a List box. On The list box I have onChange="javascript:FldEnableDisable(this.value)" ( You can specify this under HTML Form Element Attributes)
    Thanks,
    Manish Jha

  • Is there a way to enable/disable a tabular form item based on the value of a second item?

    Hi Everyone,
    I have a tabular form based on a collection.   The column c050(maps to f30) will be either Y/N.  If it is Y, then I would like to enable column c024( maps to f24) (which happens to be a radio button based on lov).  If the value of c050 = N, then disable c024.   There are potentially many rows, and the item c024 would only be enable/disabled for the specific row.   So if row 1 has c050=Y and row 2 has C050=N then row 1 c024 is enabled, and row 2 c024 is disabled.  Hope that makes sense.
    I have created a dynamic action called enable/disable HMS fields.
    event=CHANGE
    selection type = jquery selector
    jquery selector = input[name='f30']
    condition EQUAL TO
    value Y
    true action1 - enable, jquery selector, input[name='f24']
    true action 2 - alert, You have added an HMS Species.   There may be additional data to enter.  thanks
    false action1 - disable jquery selector, input[name='f24']
    false action2 - alert, no hms worries.
    The alerts in both cases show properly...but nothing seems to happen to f24.....what am I doing wrong?
    thanks

    Agh! This is the first time you mention this is a radio button!  That changes things a lot! As you can see, the format is different (f24_0001_0001) than what we have discussed (f24_0001).
    Radio buttons have their own quirks.  My bad, I should have asked what you had.  But since you said your original selectors on input were working I just thought these were text fields or something like that.
    How about you change it to a drop down list just so that you can see all work?  And fully understand it.
    Then you can work out the radio button option.
    If that doesn't get you there... I'm going to ask you setup an example in apex.oracle.com and give me credentials to log in and take a look.
    I could re-try the js on my side with a radio but it will take some time.
    So just to be clear... f30 is a drop down and f24 is a radio?
    See, this line:
    $x_disableItem("f24_" + row, true);
    Is NEVER going to find the radio buttons because it's missing the 3rd 0001 and 0002 (how many options do you have?)
    So perhaps you try it like this:
    $x_disableItem("f24_" + row + '_0001', true);
    $x_disableItem("f24_" + row + '_0002', true);
    ... keep going for the options...
    Do the same for the false of course.
    But I think this needs a better approach if you'll have radio buttons.  I just need to work it out.
    Ok, go try things...
    Thanks
    -Jorge

  • 2 manually created tabular form on the same page based on 2 different table

    Hi, I followed the how to document on manually creating tabular form, including one extra row.
    The first form I created works fine, but when I attempt to create the second tabular form based on a different table on the same page, I get the following error message when I try to create the query:
    ORA-04045: errors during recompilation/revalidation of PUBLIC.X ORA-00980: synonym translation is no longer valid
    The logic behind both tabular forms I am using is the same, except that for the second query, I use 100 instead of 1, 300 instead of 3, etc:
    select htmldb_item.hidden(1,empno) empno,
    ename,
    htmldb_item.select_list_from_query(3,job,'select distinct job, job from emp') job,
    htmldb_item.popupkey_from_query(4,mgr,'select ename, empno from emp',10) mgr,
    wwv_flow_item.date_popup(6,null,hiredate) hiredate,
    htmldb_item.text(7,sal,10) sal,
    htmldb_item.text(8,comm,10) comm,
    htmldb_item.select_list_from_query(9,deptno,'select dname, deptno from dept') deptno
    from emp
    Can anybody help?
    Thanks a lot

    Hi,
    If by "100 instead of 1" you mean the column numbers, then this won't work as you can only have a maximum of 50.
    Andy

  • Populate tabular form items based on LOV in header

    Hi,
    I have an LOV (Select List with submit) defined as the item in the same region as a tabular form. I'm using the first row in the LOV as the default value.
    Following is the query for the LOV:
    SELECT team_code ||' - '|| description as d, team_id as r FROM cp_teams ORDER BY team_id
    If the user selects a value in the LOV it would then automatically refresh the tabular form based on LOV's return value. But initially I want the tabular form to be populated using the LOV's default value.
    Problem 1) When I log in for the first time and navigate to the page, the LOV displays correctly but it shows an error below it:
    report error:
    ORA-01722: invalid number
    Surprisingly, after I have submitted the list more than once, I never see this error again until I exit.
    Question 1) Does this mean that for the first time, the LOV is not being "submitted" and thus tabular form underneath it has nothing to show?
    How do I automatically submit the lov as soon as I navigate to the page?
    Problem 2) I have a field (item) TEAM_ID in the tabular form's query which should take the TEAM_ID passed from the LOV for every new record that is created.
    Question 2) How do I initialize this field for a new record from the "header" LOV? The ultimate objective is to have the TEAM_ID populated for all the records created in the tabular form.
    As you can see I'm a newbie to APEX so I'd appreciate any help.
    Thanks,
    Sunil

    Sunil,
    1. what is the null value for your header LOV. I usually use 0 or some other numerical values. You will need a computation for that LOV with a condition ITEM VALUE IS NULL in
    order to run it only once per session.
    2. In the properties of your column - Tabular Form Element - you can set the default value
    to an item value (application or page item name).
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/apex/f?p=107:7
    http://htmldb.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

Maybe you are looking for