display edit link based on a condition problem

Hello

Someone can such me how I can display the link change in every line of my report based on a condition... is the query on which my report is formed, as shown below

SELECT COMPUTER_ID,
COMPUTERNAME, BATCH, DESCRIPTION, OPERATING_SYS.
PRIMADMIN_PHONE, PRIM_ADMIN, PRIMADMIN_CNID,
SECONDADMIN_PHONE, SECONDARY_ADMIN, SECADMIN_CNID,
RACK_NUM, MAINTENANCE_WINDOW from cts_masterserverview where ACTIVE_STATE = 'Active'.


All these data are from several fields. If city and Andy see, probably they will remember... They helped me to change this option much... my problem is now
I did the columns computer_id, which is the key in all other tables as a button change. And when the user clicks this edit button, data row respective are filled in the form, where the data can be changed...

My requirement is now, at each change of line button should appear only if the user logged on as long as the PrimAdmin of this line... I am recovery PrimAdmin_CNID so that it can be compared against: APP_USER. All others should be able to view the data, but not modify... I am not able to figure out how I can conditionally display as I do for the other buttons.

Can someone give an idea on how to do...


Thank you
Yvette

Published by: user0012 on May 1st, 2009 13:25

Hi David,

Use the following query to conditional change the link,.

SELECT
           CASE WHEN PRIMADMIN_CNID = :APP_USER THEN
              ''
            ELSE
                     ' '
            END Edit
           ,COMPUTER_ID
           ,COMPUTER_NAME
           ,STATUS_ID
           ,DESCRIPTION
           ,OPERATING_SYS
           ,PRIMADMIN_PHONE
           , PRIM_ADMIN
           ,PRIMADMIN_CNID
           ,SECONDADMIN_PHONE
           ,SECONDARY_ADMIN
           ,SECADMIN_CNID
           ,RACK_NUM
           ,MAINTENANCE_WINDOW
           from cts_masterserverview
where ACTIVE_STATE = 'Active'

Add onclick= before "javascript above and Change the number 7 in the javascript to the page where you have edit form.

Thank you
Manish

Tags: Database

Similar Questions

  • How to enable or disable a paragraph based on a condition in the BIPS

    Hello reading,
    <? country? >
    How to display a line based on a condition in the DARK...
    I have a tag as a country that has the value zero or in India, I shouldn't show paragraph
    para should be included
    and also, I don't want the line below to access his location

    How can I do this...
    pls help

    I sent you the code to achieve this. Take a peek inside.

    Thank you
    BIPuser

  • 2 conditional display for link column

    Hello

    I use Oracle Apex 5.0.2 and I have a report that contains a link to the column. The report contains various user_ids and shows some qualities of these users. I want to make the link in the column of conditional display based on two conditions.

    1. If the user who is viewing the page is an administrator

    2. If the user who visits the page is not an administrator, but sees its own information in this report.

    The 1st condition, I know how to implement it using PL/SQL expression. I stored the role: APP_USER in a P1_USER_ROLE and check if P1_USER_ROLE = "administrator."

    For condition 2, I know how to implement it using the "value of the element / the expression 1 column = Expression 2.» And I put just expression 1 #USER_ID # and expression 2 P1_USER ID (an element which stores: APP_USER).

    I was wondering if there is a way to simultaneously implement these two conditions together. Thank you!

    kevinsun91 wrote:

    I use Oracle Apex 5.0.2 and I have a report that contains a link to the column. The report contains various user_ids and shows some qualities of these users. I want to make the link in the column of conditional display based on two conditions.

    A "report"? Always tell exactly what you mean by this term: standard report, interactive, component report shared report query or some sort of tabular form?

    1. If the user who is viewing the page is an administrator

    2. If the user who visits the page is not an administrator, but sees its own information in this report.

    The 1st condition, I know how to implement it using PL/SQL expression. I stored the role: APP_USER in a P1_USER_ROLE and check if P1_USER_ROLE = "administrator."

    For condition 2, I know how to implement it using the "value of the element / the expression 1 column = Expression 2.» And I put just expression 1 #USER_ID # and expression 2 P1_USER ID (an element which stores: APP_USER).

    Here are the two different requirements. The first is a restriction on the level of columns that can be implemented with the help of a condition on a column in report or a link. The second is a restriction on the level of the lines who cannot. It is not possible to report using #COL_ALIAS # overrides row values in the State of the reference column. It would be unwise to do so: how APEX can determine if the column should be included or not until all rows are retrieved?

    The conditions of type 'values in the column"referred to value of element / column expression... are those generated by the tabular form wizard, which can be referenced in these expressions for run level row and process validation conditionally based on the submitted values. An example might be triggering a validation not Null in COMMISSION when JOB = 'SELLER '.

    Conditional display of level line in the reports always is possible by including the necessary logic to the report using CASE or other expressions query.

    I was wondering if there is a way to simultaneously implement these two conditions together.

    It is not possible to do in a State of the column. It must be made in the report query using a CASE expression:

    ...
    case
      when    :p1_user_role = 'Administrator'
           or user_id = :p1_user_id
      then
        ... --- Construct link URL
    else
      null
    end col_link
    ...
    

    In other circumstances where it is possible to combine several conditions, use a PL/SQL Expression condition with several predicates and required Boolean.

  • Merge the queries based on the conditional

    Apex 4.2

    I have a pretty complex question. I have a page that will have a selection list on the data entry form. The selection list contains a list of both 1) Active only or 2) active and inactive areas. We show the active areas when we create a new record (P101_ID IS NULL), we appear active and inactive sectors when you edit a record (P101_ID IS NOT NULL). I have therefore two separate queries to account for each case. Simple so far.

    Problem I am seeing that create two lists of selection on the page and put a separate condition on each one (hiding one of selection lists depending on the case the ID IS NULL or the ID IS NOT NULL) does not work. So I was wondering if there was a way to combine queries for that to work based on a conditional statement. I did experiment with the instructions box and unions, etc., but my questions are a bit complicated. They are as follows:

    LIST OF ASSETS SECTORS (P101_ID is NULL)

    Select unique
    ISEC.inspection_sector_name,
    ISEC.inspection_sector_id
    From
    INSPECTION_SECTORS ISEC
    left join HWE_INSPECTION_SCHEDULING SCH on ISEC.inspection_sector_id = SCH.inspection_sector_id
    Where (ISEC.hurricane_protection_flag = :P157_IS_HURR and ISEC.river_protection_flag = :P157_IS_RIV) AND
    ISEC.superseded_date is null AND
    ISEC.commenced_date is not null AND
    ISEC.inspection_sector_id not in (
    Select ISEC.inspection_sectors_id
    From INSPECTION_SECTORS ISEC
    left join HWE_INSPECTION_SCHEDULING SCH on ISEC.inspection_sector_id = SCH.inspection_sector_id
    Where SCH.high_water_event_id = :P157_high_water_event_id AND
    SCH.inspection_date = :P157_inspection_date)
    OR ISEC.inspection_sector_id = :P157_inspection_sector_id AND
    ISEC.superseded_date is null
    Order by inspection_sector_name
    

    LIST ACTIVE AND INACTIVE SECTORS (P101_IS is NOT NULL)

    Select inspection_sector_name, inspection_sector_id From (
    Select ISEC.inspection_sector_name, ISEC.inspection_sector_id, '0' as this
    From dual, INSPECTION_SECTORS ISEC
    left join HWE_INSPECTION_SCHEDULING SCH on ISEC.inspection_sector_id = SCH.inspection_sector_id
    Where (ISEC.hurricane_protection_flag = :p157_IS_HURR and ISEC.river_protection_flag = :P157_IS_RIV) AND
    ISEC.superseded_date is null AND
    ISEC.commenced_date is not null AND
    ISEC.inspection_sector_id not in (
    Select ISEC.inspection_sector_id
    From inspection_sectors ISEC
    left join HWE_INSPECTION_SCHEDULING SCH on ISEC.inspection_sector_id = SCH.inspection_sector_id
    Where SCH.high_water_event_id = :P157_high_water_event_id AND
    SCH.inspection_date = :P157_inspection_date)
    OR ISEC.inspection_sector_id = :P157_inspection_sector_id AND ISEC.superseded_date is null
    UNION
    Select unique
    ISEC.inspection_sector_name|| ' [CLOSED]', ISEC.inspection_sector_id, '1' as this
    From dual, INSPECTION_SECTORS ISEC
    left join HWE_INSPECTION_SCHEDULING SCH on ISEC.inspection_sector_id = SCH.inspection_sector_id
    Where ISEC.superseded_date is not null and ISEC.commenced_date is not null AND
    ISEC.river_protection_flag =:P157_IS_RIV and ISEC.hurricane_protection_flag = :P157_IS_HURR AND
    ISEC.inspection_sector_id not in (
    Select ISEC.inspection_sector_id
    From INSPECTION SECTORS ISEC
    left join HWE_INSPECTION_SCHEDULING SCH on ISEC.inspection_sector_id = SCH.inspection_sector_id
    Where SCH.high_water_event_id = :P157_high_water_event_id AND
    SCH.inspection_date = :P157_inspection_date)
    OR ISEC.inspection_sector_id = :P157_inspection_sector_id NAD ISEC.superseded_date is not null
    Order by this, inspection_sector_name asc
    

    If the requests are quite complex. I tested the times and they work in APex, separately from the course. Forgive me if I have mispeled anything. But any help on this would be greatly appreciated. Thanks in advance.

    Thank you for taking to your friend Frank. You are a bird-guy (my attempt at sarcasm). Nobody has questioned whether its knowledge base; more so in the way he responded to my original post did not «do» Like the people who come on this forum looking for help to those who have greater knowledge, it would be nice to be greeted a little more friendly, lol. Just my thoughts. But, feel free to correct my spelling test, grammar and syntax in my sentences so (the effort once again to emphasize that I misspelled 'AND', and that the request would not be performed--> of course... smh... you are funny)

    Apparently I failed to explain the issue in its entirety. I should start by saying... "I have two separate petitions that I tested and already working and am looking to put on a list of selection (at the top) with a conditional execution statement one or the other, through the conditional statement, but again, I was looking for more so for syntax and structure." I'm sorry, I forgot to mention that.

    Anyway, enough of this. I found a solution to my problem:

    Within the Apex 4.2, you can have a list of selection as a page element. I want to display different results depending on whether Yes or no P101_ID is set to Null or NOT NULL

    P101_ID is a primary key for a table.

    P101_ID is not the exact name I use in my application / request however.

    In addition, you don't need to include double; It's not make or break the query. Something that I forgot to omit them.

    In addition, something along the lines of

    Select inspection_sector_name, inspection_sector_id From (
    .....all the stuff in query 1.......)
    Where P101_ID is null
    UNION
    Select inspection_sector_name, inspection_sector_id From (
    ....all the stuff in query 2.....)
    Where P101_ID is not null
    

    will work on a selection list in the APex. So problem solved. Thank you for all your wonderful insight, of words and thoughts. Thank you.

  • Syntax of the apex to create edit link

    Apex 4.2

    I have a report that I'm working on that uses a custom edit link embedded in the query. The query along the lines of:

    SELECT
    first_name as FIRST,
    last_name as LAST,
    '<a href="f?p=&APP_ID.:67:APP_SESSION.::::P67_PERSON_ID:#PERSON_ID#"><img src = "/i/edit.gif" alt=""></a>' as LINK_COLUMN
    FROM PERSONS
    

    I want to report link to the information page (Page 67; report is on page 66). However, there is a problem with the syntax. On the report, I can click on the link for each line. It'll take me to the next page, but his has not managed the information on the next page, based on the past PERSON_ID.

    I think another way would also use javascript.apex: submit {} but I'm not as familiar with this syntax as well. I did some searching on google but I encounter difficulties still generate this link.

    Any help on this would be greatly appreciated. Thanks in advance.

    You mix the Apex syntax (like token #PERSON # and & substitution variables) with SQL syntax - and expect that everything works like magic.

    The syntax of the token # is applicable only in the column properties (for example, the definition of HTML column or column URL/link definition) in a report of the Apex. It has no meaning in SQL.

    If you want to generate the URL under the projection of the SQL then use:

    select
      first_name as FIRST,
      last_name as LAST,
      '' as URL
    from persons
    

    And as Frank commented - please use the correct forum area in the future when ask what apex questions.

  • Custom color in display Gantt chart based on the State - Apex 4.2

    Hello

    I need to specify the custom color display Gantt chart based on the State.

    Say: Open - Red

    Progress-yellow

    Cancelled - blue

    Closed - Green

    given that the status column is not part of Gantt chart question, how?

    Option color in table attributes is not helping this requirement.

    Kind regards

    Sanjaya

    Hello

    Finally, the problem is resolved with the help of Hilary Farrell-Oraclefantastic example and help anychart pages. This is useful for this URL.

    https://Apex.Oracle.com/pls/Apex/f?p=36648:30:102588100613368:

    http://6.anychart.com/products/anygantt/docs/users-guide/index.HTML?project-Gantt-chart.html

    http://6.anychart.com/products/anygantt/docs/users-guide/index.html?defaults.html

    -Sanjaya

  • Disable a button based on a condition

    Hello

    I want to disable a button based on some condition.
    Suppose I want to disable a particular button, if the value of ACTIVE_FLAG in a table "Y".

    I put disabled = true in the attributes of the button, but I don't know where to put the condition.

    Thank you
    Deepak

    Deepak,

    Put this in the footer text.

    
    

    Make sure you have set the source of the item as "always replace.." for P1_ACTIVE_FLAG point and get the value from database.

    See this link for the Javascript API of APEX

    See you soon,.
    Hari

    Published by: Hari_639 on October 30, 2009 12:45

  • Display the role-based templates

    Hello

    I have a requirement in which I need to display different model based on user roles (for example: Manager, clerk...). Is it posible?

    Thank you

    Hello

    You may want to use a layout unique-rtf and conditional regions allows you to choose the layout you want when running. If you have different available - on, I would say it depends on the calling application and how you call BI Publisher.

    Concerning
    Rainer

  • Hide an entire column based on a condition

    Hello

    I'm trying to completely hide a column in a table based on a condition, if the column was not present. I wrote two conditional regions for the header and data, but it is still showing up. Any help would be appreciated. The XML model RTF, the PDF generated and the output I'm looking is attached. Thank you.

    Please check your email that I have forwarded to update the model.

    I counted occurrences of January in your xml and formed the condition based on the fi

    MONTH

  • Do I need permission to display the link to download the adobe acrobat reader software?

    I would like to display the link to download adobe acrobat reader on my web site for my client to download the player. Do I get adobe approval before displaying the hyperlink?

    Thank you.

    Florence Lee

    Hi Florence.

    I believe that you can share the link to download Adobe official Web site without needing any permission from anyone.

    Kind regards
    Rahul

  • When I edit a photo in "develop" and then click back to the library to export the only changes to the photo that carry over is the cropping. I can't export my edited photo. Anyone have this problem? I have the creative cloud package

    When I edit a photo in "develop" and then click back to the library to export the only changes to the photo that carry over is the cropping. I can't export my edited photo. Anyone have this problem? I have the creative cloud package

    Hi stever25146025,

    According to the request, I understand that when you export images from Lightroom it shows only the crops, is not editing.

    It is specific to a single image or all images in the catalog?

    Could you please let me know what file format you choose to export the images and also what version of Lightroom are you using?

    Kind regards

    Tanuj

  • Insert data into the same table based on certain conditions

    Hello. I'm new to this forum.
    I have to write a stored procedure to insert data in a table MYTABLE say, having a structure like:

    Col1 Col2 Col3... TotalInstallments CurrentInstallment PaidAmount MonthYear
    I have to insert all the data that it is in the same table (MYTABLE) except change some fields based on certain conditions:

    1. if PaidAmount > 0 & & CurrentInstallment < TotalInstallment then

    CurrentInstallment = CurrentInstallment + 1

    2. in the field MonthYear I have data ex. 01/2012, 11/2012 formate(month/year)...

    So, I have to insert data by incrementing the month and year. for example:

    If currentdata is 11/2012 next data will be 12/2012

    But following will be 01, 2013
    I have to select all records that belongs to the previous month (across the field MonthYear) and put the audit on each record selected and insert data and then turns them into table (MYTABLE) even.

    How to achieve that?

    Thank you.

    978184 wrote:
    Hello. I'm new to this forum.
    I have to write a stored procedure to insert data in a table MYTABLE say, having a structure like:

    Col1 Col2 Col3... TotalInstallments CurrentInstallment PaidAmount MonthYear
    I have to insert all the data that it is in the same table (MYTABLE) except change some fields based on certain conditions:

    1. if PaidAmount > 0 & CurrentInstallment

    CurrentInstallment = CurrentInstallment + 1

    2. in the field MonthYear I have data ex. 01/2012, 11/2012 formate(month/year)...

    So, I have to insert data by incrementing the month and year. for example:

    If currentdata is 11/2012 next data will be 12/2012

    But following will be 01, 2013
    I have to select all records that belongs to the previous month (across the field MonthYear) and put the audit & on each of the selected data record and insert then turns them into table (MYTABLE).

    You can do this way:

    This is not tested, but if you can provide the example of table structure and data (IN create table and insert scripts), it can be put to the test.

    insert into your_table
    (col1, col2, col3...current_installment, month_field)
    select col1, col2, col3..,
           current_installment +
           case when paidamount > 0 and current_installment < total_installment then
            row_number() over (
                                partition by column1, column2,.. columnn      -->You may choose partition if you want the
                                                                              --Increment of Current_installment to reset after particular combination ends
                                order by primary_key        -->Order the Increment, you may choose to add more columns to order by
                              )
          else
            0                                               --> if condition is not met, then Add 0
          end curr_installment,
          add_months(to_date(month_field, 'MM/YYYY'), 1) nxt_month
      from your_table;
    
  • Generate reports based on two conditions

    Dear all,
    I generate reports based on satisfactory conditions in two columns in a table.

    For example.
    I have a table test1 with columns A, B, C, D, E
    Now, I want to create reports based on the research of two columns A and b. What is the preferred method to do?

    Thanks in advance.

    What is the preferred method to do?

    Write the appropriate query:

    select a,b,c,d,e
    from test1
    where a = 
    and b = 
    

    In reports, the State may be a user input parameter:

    select a,b,c,d,e
    from test1
    where a = :parameter1
    and b = :parameter2
    
  • Remove duplicates based on a condition

    Hi all

    I need help on a query to remove the duplicates based on a condition.

    For example, my table is

    FE CC DATE FLAG
    ----------------------------------------
    FE1 CC1 10/10 FB
    FE1 CC1 FB 9/10
    FE1 CC1 11/10 AB
    FE1 CC2 9/10 AB
    FE1 CC2 10/10 FB
    FE1 CC2 11/10 AB

    I want to delete all duplicate rows FE and CC, based on the sub condition:
    DATE < MAX (DATE) WHERE FLAG = "FB".

    This means I want to remove the FB 9/10 FE1 CC1 line
    but not lines
    FE1 CC1 10/10 FB
    and
    FE1 CC1 11/10 AB
    as only the FE1 CC1 line 9/10 FB has date < MAX (DATE) WHERE FLAG = "FB".
    Similarly, I want to keep
    FE1 CC2 10/10 FB
    FE1 CC2 11/10 AB
    but not
    FE1 CC2 9/10 AB

    Thank you very much.

    Can be like that...

    delete from  t
    where dt < ( select max(dt) from  where fe=t.fe and cc=t.cc and flag='FB' )
    
  • Link between PC and Mac problem

    Hello.  We have 3 Mac running OSX 10.5.x and Adobe Std CS5 and they share their creations of Illustrator, images, etc., on a NAS file server.  Recently, I downloaded the CS5.5. trial version for a PC running under Windows XP Pro and on the same network with the same file access and security.  All machines use CIFS to access files.

    PC user will create an Illustrator file in one of these shared folders on the NAS and the link in images of an another shared folder on the NAS and save.  When a Mac user opens the Illustrator file, however, none of the links are valid for the user Mac is to add a link to these images and re - save the file.  Should what changes I do on the PC side to stop this problem?  Must the PC be on CS5, too?

    Open the file on the mac, in the links palette choose an image missing, and in the links flyout choose infomration link to show you where AI is looking for the file.

    Always happens to each link
    Could be a problem of config on the server with the way directories are perceived by the side mac. The simplest solution is to save the images next to the illustrator file.

    It happens to some links.
    Might be a problem file naming using characters that are not allowed as :/ %-in the name of the file or and linking folder_name.

Maybe you are looking for