Conditionally set page item based on value of another item

Hello,
I have a form that is used to create/apply changes to records. There is an application item (APP_ITEM_PROFILE)
that is set on login which contains a value for the user's Profile ID. This Profile ID is used through out the
application for authorizations (conditionally present tabs, etc).
I've set a page item on the form equal to APP_ITEM_PROFILE so that the record is stamped
with that user's profile ID when they create a record. Users with different Profile IDs may later make changes to
the record but I want to keep the original Profile_ID on the record.
I am trying to populate the Profile ID conditionally in the form based on the existence of a
record ID. If there is no ID (a new record is being entered), then I want the
Profile ID to be that of the current user (APP_ITEM_PROFILE). If there is an ID (modification is
being made to an existing record), then I want the keep the Profile ID that was originally saved
with the record in MyTable.
I have this as the source for :P11_PROFILE_ID. The type is PL/SQL Expression or Function, Always, replacing... but it
is not working (page not found when page is run):
begin
if :P11_ID is not null
then
select PROFILE_ID
into :P11_PROFILE_ID
from MyTable
where ID = :P11_ID;
elsif :P11_ID is null
then select nv(':APP_ITEM_PROFILE') into :P11_PROFILE_ID from dual;
end if;
end;
Item Descriptions:
ID is the record ID.
:P11_ID is the page item of the record ID (Display as Text, saves state).
PROFILE_ID is the user's Profile ID.
:P11_PROFILE_ID     is the page item of the user's Profile ID.
:APP_ITEM_PROFILE is the user's Profile ID that is set on login.
Any help is greatly appreciated.
Thanks,
Matt
Update:
I found one of Scott's answers:
Using IF Else to determine the value of a Item
and modified the above code to:
declare l_ret number;
begin
if :P11_ID is not null
then
select PROFILE_ID
into l_ret
from MyTable
where ID = :P11_ID;
else select :APP_ITEM_PROFILE' into l_ret from dual;
end if;
return l_ret;
end;
It seems to be setting the Profile ID correctly when the ID is not null, but not when a new record is being created. In the latter case, there is no value.
Edited by: mterlesky on May 11, 2009 11:02 PM
Edited by: mterlesky on May 11, 2009 11:52 PM
Edited by: mterlesky on May 11, 2009 11:53 PM

Thanks. That is putting the value into the page item and session state but that value is not being saved when the record is created. I'm not sure why - here is part of the debug (the "Billing" table is the "MyTable" table in the previous posting). Any thoughts?
On form, before submit:
0.06: Saving g_arg_names=P11_PROFILE_ID and g_arg_values=112
0.06: ...Session State: Saved Item "P11_PROFILE_ID" New Value="112"
After Submit
0.06: ...Session State: Save "P11_PROFILE_ID" - saving same value: "112"
(validations not shown)
0.10: Processing point: AFTER_SUBMIT
0.10: ...Process "Get PK": PLSQL (AFTER_SUBMIT) declare function get_pk return varchar2 is begin for c1 in (select BILLING_SEQ.nextval next_val from dual) loop return c1.next_val; end loop; end; begin :P11_ID := get_pk; end;
0.10: ...Session State: Save Item "P11_ID" newValue="452" "escape_on_input="Y"
0.10: ...Do not run process "Get PK for CREATEAGAIN", process point=AFTER_SUBMIT, condition type=, when button pressed=CREATEAGAIN
0.10: ...Process "Process Row of BILLING": DML_PROCESS_ROW (AFTER_SUBMIT) #OWNER#:BILLING:P11_ID:ID|IUD
0.10: ...Process "Update TOTAL_HOURS": PLSQL (AFTER_SUBMIT) begin Update billing set TOTAL_HOURS = ((NVL(CD_90801_UNITS,0)*1.5)+ (NVL(CD_90804_UNITS_B,0)*.5)+ NVL(CD_90806_UNITS,0)+ (NVL(CD_90808_UNITS_B,0)*1.5)+ NVL(CD_90812_UNITS,0)+ (NVL(CD_90814_UNITS_B,0)*1.5)+ NVL(CD_90846_UNITS,0)+ NVL(CD_90847_UNITS,0)+ NV
0.11: ...Process "Update TOTAL_UNITS": PLSQL (AFTER_SUBMIT) begin Update billing set TOTAL_UNITS = (NVL(CD_90801_UNITS,0)+ NVL(CD_90804_UNITS_B,0)+ NVL(CD_90806_UNITS,0)+ NVL(CD_90808_UNITS_B,0)+ NVL(CD_90812_UNITS,0)+ NVL(CD_90814_UNITS_B,0)+ NVL(CD_90846_UNITS,0)+ NVL(CD_90847_UNITS,0)+ NVL(CD_90853_UNITS,0)+ NV
0.11: ...Process "G_TRANS_COUNT_ADD": PLSQL (AFTER_SUBMIT) begin :G_TRANS_COUNT := :G_TRANS_COUNT +1; end;
0.11: ...Session State: Saved Item "G_TRANS_COUNT" New Value="1"
0.11: ...Process "Email_Notification": PLSQL (AFTER_SUBMIT) declare l_body_html varchar2(4000); begin l_body_html := '<p>Billing ID '||:P11_ID||' was entered by '||:P11_PROV_NAME||'.'|| ' More transactions may have been entered by the provider after this one.'||'</p> <p><a
Edited by: mterlesky on May 12, 2009 9:21 AM

Similar Messages

  • How to Visible/Hide an Item based on the value of another Item

    Hi
    I need to visible and hide a textitem based on the value of another item.This form has 3 blocks, and the both item is in the first Master Block.
    My code is:
    if :RECORDTYPE=7 then
         Set_Item_Property('BLOCK.ITEM',VISIBLE,PROPERTY_TRUE);
         Set_Item_Property('BLOCK.ITEM',ENABLED,PROPERTY_TRUE);
    ELSE
         Set_Item_Property('BLOCK.ITEM',VISIBLE,PROPERTY_FALSE);
    Set_Item_Property('BLOCK.ITEM',ENABLED,PROPERTY_FALSE);
    :BLOCK.ITEM:=NULL;
    end if;     
    I wrote the code in the Validate Trigger, but not working when moving Next Record & Previous Record
    Thanks in advance
    Rizly

    Read the 'Propagation of Property Changes' section towards the end of the page for Set_Item_Property in the online help. I'm not sure what you mean by locking automatically but perhaps it's because of this.
    You should also ensure the item you're setting to invisible is not the current item (check :system.cursor_item and go to a different item if necessary).

  • Want 2 populate value in 2nd list item based on value selected in 1st list?

    Want 2 populate value in 2nd list item based on value selected in 1st list?

    Gaurav -
    The 3rd list will not populate because nothing has been selected yet in list 2. The value in list 2 is null, so the loop to populate list (3) has nothing to load. Try the following below. This should seed your 2nd list so the 3rd list will populate.
    You will have to declare first_record boolean and first_value to match DESCC.
    first_record := true; -- NEW *****
    Clear_List('BLOCK2.ITEM2');
    FOR CurRec IN (SELECT UNIQUE DESCC DESCC FROM LUTT where LUTT.IDD = :BLOCK2.ITEM1)
    LOOP
    if first_record = true then -- NEW SECTION *****
    first_value := CurRec.DESCC;
    first_record := false;
    end if;
    Add_List_Element('BLOCK2.ITEM2',1,CurRec.DESCC,CurRec.DESCC);
    END LOOP;
    :block2.item2 := first_value; -- NEW *****
    Clear_List('BLOCK2.ITEM3');
    FOR CurRec2 IN (SELECT UNIQUE DESCC DESCC FROM LUTT where LUTT.DESCC = :BLOCK2.ITEM2)
    LOOP
    Add_List_Element('BLOCK2.ITEM3',2,CurRec2.DESCC,CurRec2.DESCC);
    END LOOP;
    My name is Ken, 1990 is when I started using Oracle Forms 3.0, character based in the Unix environments. And you are very welcome.

  • How to create a new row for a VO based on values from another VO?

    Hi, experts.
    in jdev 11.1.2.3,
    How to create a new row for VO1 based on values from another VO2 in the same page?
    and in my use case it's preferable to do this from the UI rather than from business logic layer(EO).
    Also I have read Frank Nimphius' following blog,but in his example the source VO and the destination VO are the same.
    How-to declaratively create new table rows based on existing row content (20-NOV-2008)
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/13-create-with-params-169140.pdf
    I have tried:
    1.VO1(id,amount,remark1) and VO2(id,amount,remark2) are based on different EO,but render in same page,
    2.Drag and drop a Createwithparams button for VO1(id,amount,remark),
    3.add: Create insertinside Createwithparams->Nameddata(amount),
    4.set NDName:amount, NDValue:#{bindings.VO2.children.Amount}, NDtype:oracle.jbo.domain.Number.
    On running,when press button Createwithparams, cannot create a new row for VO1, and get error msg:
    <Utils> <buildFacesMessage> ADF: Adding the following JSF error message: For input string: "Amount"
    java.lang.NumberFormatException: For input string: "Amount"
         at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
    Can anyone give some suggestions?
    Thanks in advance.
    bao
    Edited by: user6715237 on 2013-4-19 下午9:29

    Hi,CM,
    I'm really very appreciated for your quick reply! You know, today is Saturday, it's not a day for everyone at work.
    My principal requirement is as follows:
    1.select/check some rows from VO2, and for each selection create a new row with some attributes from VO2 as default values for VO1's corresponding attributes, and during this process the user may be cancel/uncheck or redo some of the selections.
    --so it's better to implement it in UI rather than in EO.
    2.it's better to implement this function with declarative way as in Frank Nimphius' blog.
    --little Jave/JS coding, the better. I only have experience in ORACLE FORMS, little experience in JAVA/JS.
    In order to get full information for the requirements of my use case, can take a check at:
    How to set default value for a VO query bind variable in a jspx page?
    (the end half of the thread: I have a more realworld requirement similar to the above requirement is:
    Manage bank transactions for clients. and give invoices to clients according to their transaction records. One invoice can contain one or many transactions records. and one transaction records can be split into many invoices.
    Regards
    bao
    Edited by: user6715237 on 2013-4-19 下午11:18
    JAVE->JAVA

  • Need to change LOV based on values in other Item ....

    Hello All,
    I got a required to show LOV based on some value in other column. Let me explain ... suppose in column A has value is A1 then column B should show A11, A12 , A13 and if Column A has value C then cloumn B should show C11, C12 ... etc. The LOV will be static with some pre defined values. So all the LOVs will be defined in forms. We just need to show based on value in column A .
    Please suggest.
    Thanks.
    Edited by: Amit1cs on Apr 18, 2013 7:40 PM

    Amit1cs wrote:
    Hello All,
    I got a required to show LOV based on some value in other column. Let me explain ... suppose in column A has value is A1 then column B should show A11, A12 , A13 and if Column A has value C then cloumn B should show C11, C12 ... etc. The LOV will be static with some pre defined values. So all the LOVs will be defined in forms. We just need to show based on value in column A .
    Please suggest.Hello Amit,
    So far i understand, you can create multiple record group for a single LOV. before display the lov just change or assign the appropriate record group. You may use pre-text-item trigger at column B and set the record group to your LOV.
    Hope this helps
    Hamid

  • Selecting an LOV item to return values in antother item based on selection

    I am having some difficulty hard coding a page item P3_INVOICE_STATUS value to return/ display values depending on a multiple select list on another item P3_EXCEPTION_REASON'. Example when i select from a drop down list on P3_EXCEPTION_REASON' = is a drop down LOVs, I’d like to select from = YES/ NO/ NA, and would like that to return/ display COMPLETE/ PENDING / REVIEW respectively, depending on what is selected.
    Can anyone please help
    I am still a novist in APEX .

    hi,
    to create application level process:
    1. go to shared component
    2. in logic section there is "application processes", in which you can create process
    3. For item you can click "application item".
    regards,
    Kartik

  • Set lookup value from another item

    Hi!
    I add to my list in SP 2013 new column like type Lookup field and select item from another document library
    and display field select "Title". How i can set this filed value for new item from document library item?

    Hi AllXander,
    From your description, my understanding is that you want to set lookup field value with C# CSOM.
    You could use method "FieldLookupValue()". Please refer to this code below to set lookup field value when add an new item to a list:
    // replace your site URL
    using (ClientContext context = new ClientContext("http://sp/sites/sp2013"))
    // replace your user, password and domain
    context.Credentials = new NetworkCredential("Administrator", "Access1", "contoso");
    // the library that you get value for the lookup field
    List list = context.Web.Lists.GetByTitle("Department");
    context.Load(list);
    context.ExecuteQuery();
    CamlQuery query = new CamlQuery();
    query.ViewXml = "<View/>";
    ListItemCollection allContacts = list.GetItems(query);
    context.Load(allContacts);
    context.ExecuteQuery();
    foreach (ListItem item in allContacts)
    // replace the id that you want to set value to the lookup filed
    if (item.Id == 1)
    // replace the list title with your list that you want to add the item
    List oList = context.Web.Lists.GetByTitle("Employee");
    ListItemCreationInformation itemCreateInfo = new ListItemCreationInformation();
    ListItem oListItem = oList.AddItem(itemCreateInfo);
    oListItem["Title"] = "My New Item!";
    // set the lookup field value
    FieldLookupValue lookup = new FieldLookupValue();
    lookup.LookupId = item.Id;
    oListItem["Department"] = lookup;
    oListItem.Update();
    context.ExecuteQuery();
    You could refer to this article about creating/updating/deleting a new item with C# CSOM:
    http://www.c-sharpcorner.com/UploadFile/sagarp/create-update-delete-a-list-using-client-object-model-cso/
    You could refer to this article about updating multi-value lookup column:
    https://sunbin0704.wordpress.com/2013/10/11/update-multi-value-lookup-column-values-in-sharepoint-2010-using-managed-csom/
    Best Regards,
    Vincent Han
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected].

  • Color a column based on value in another column in tableview

    I am using a tableview iterator to display data in a bsp page. I want to color a cell in particular column (column 4), when a value in another column (column 2) on that same row is greater than 20. I can color the cell in column 2 but am not able to color the cell in column 4. How can I accomplish this?
    This is what I have. Looks like val1 is losing it's value.
    CASE p_column_index.
        WHEN 2.
          ASSIGN p_row_data_ref->* TO <row>.
          ASSIGN COMPONENT 'ZTGT' OF STRUCTURE <row> TO <col>.
          VAL = <col>.
          IF VAL GT '20'.
            val1 = p_row_index.
            p_style = 'celldesign:CRITICALVALUE_DARK'.
          ENDIF.
        WHEN 4.
            if p_row_index = val1.
              p_style = 'celldesign:CRITICALVALUE_DARK'.
            endif.
        WHEN OTHERS.
    do nothing
      ENDCASE.

    The reason val1 is "loosing its' value" is presumably because you have defined it in the method as a local variable. So each time you call the RENDER_CELL_START method it is is newly initialised. So if you make this an instance attribute it will retain its' contents across method calls.
    Cheers
    Graham Robbo

  • Conditional inclusion of column cells based on value in another column?

    I was wondering if something like the following is possible -- I've looked through the forums and Numbers user guide but can't figure it out:
    Suppose I have a column A of sales figures, and columns B and C which basically have different attributes (say, color (yellow or green), size (small or large), and material (cotton or polyester)).
    I want to run basic statistics on various combinations: e.g. all yellow items regardless of size, all green cotton items regardless of size, all large yellow items regardless of material, etc.
    I want to be able to specify something like this:
    'Compute the average of every cell in column A where column B=="green" and column C=="large"'
    Is there a good way to go about doing this? Would I want to attack the problem using categories, sorting, and multiple tables? Or is there a way to conditionally include cell values from a range based on the value of that row's cell in another column?
    Thanks for any help.

    All I can think of to solve the quartile and median functions is to have another table of the same size as your original table that gets populated with just the items that match. Then you can do the quartile and median (and average) on that table. It's a one-at-a-time affair; you can only do one selection of size, color, and/or material at a time but you can get the median, mean, and quartiles of it. Of course, you could have multiple copies of this second table if you want to do more than one comparison at a time.
    In the attached file, unhide the hidden rows in Table 2 to see the formulas that do all the work.
    [files.me.com/pwb3/6hobt0.numbers.zip]
    Message was edited by: Badunit
    Message was edited by: Badunit

  • Controlling Sort based on Value of an Item

    Hi all,
    Here's the scoop - I've got an Apex "report query" that uses an "advanced" RTF layout. I'd like to send a page item, say P1_SORT_BY with a value of "name" or "count", and make the template dynamically render the appropriate "<?sort ...?>" tag based on that value.
    I tried using a "choose" tag to specify the sort order, like this:
    <?for-each:ROW?>
    <?choose:?>
    <?when:P1_SORT_BY='name'?>
    <?sort:NAME;'ascending';data-type='text'?>
    <?end when?>
    <?when:P1_SORT_BY='count'?>
    <?sort:COUNT;'ascending';data-type='number'?>
    <?end when?>
    <?end choose?>
    but I can't seem to get it working. I can see that P1_SORT_BY in the template does receive a value. Has anyone done something similar? Any ideas/suggestions?
    Thanks!

    I guess, this will add some more insight to you.
    http://blogs.oracle.com/xmlpublisher/2006/05/26#a41

  • How to set background color based on values in column grouping

    Hello,
    I have query
    select 1 as CustomerID,'Reality' as Type, 100 as Turnover
    UNION
    select 1 as CustomerID,'Budget' as Type, 120 as Turnover
    UNION
    select 2 as CustomerID,'Reality' as Type, 140 as Turnover
    UNION
    select 2 as CustomerID,'Budget' as Type, 120 as Turnover
    I have matrix, where in rows are customers, there is columngroup based on field Type and in details are summaries of Turnover. I need to change background color of Reality field, when lower than Budget. How can I do that please ?

    Hi volyn,
    After testing the issue in my own environment, we can use custom code to achieve your requirement. For more details, you can refer to the following steps:
    Copy the custom code below and paste it to your report. (Right-click report>Report Properties>Code)
    DIM PreviousValue AS Decimal
    Dim CustomerID AS String = ""
    Public Function  GetPreviousValue(byval Val as Decimal, byval CusID as string)  as Decimal
    DIM Local_PreviousValue AS Decimal
    IF CustomerID <> CusID THEN
    CustomerID  = CusID 
    PreviousValue  = val
    Local_PreviousValue  = 0
    ELSE
    Local_PreviousValue =  val - PreviousValue 
    PreviousValue  = val
    END IF
    return Local_PreviousValue 
    End function
    Click the cell which contains [Sum(Turnover)] value, modify the expression of BackgroundColor property to like this in the Properties Window: 
    =iif(Code.GetPreviousValue(Fields!Turnover.Value,Fields!CustomerID.Value)<0,"Brown","White")
    In this scenario, you can change Brown color to any color you like. The following screenshot is for your reference (I added some data to make it more clearly):
    If you have any other questions, please feel free to ask.
    Thanks, 
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Setting Page Break based on Number of Months in a matrix

    Hi,
    I have a matrix showing data group by month(Column group). I added this matrix inside a list control to have page break for each 12 rows. The report has Begin date and end date. There is a requirement like if the begin date starts with say Apr 2011
    and end date as Aug 2014, then the first row group of list should show data from Apr 2011 to Dec 2011 and next row group should show from Janualry Month. i.e., Jan-12 to Dec-12(Second Row group), Jan13-Dec13), Third Row Group. Then Jan14 to Aug 14.
    if the begin date starts with say Sep 2011 and end date as Aug 2014, then the first row group of list should show data from Sep 2011 to Dec 2011 and next row group should show from Janualry Month. i.e., Jan-12 to Dec-12(Second Row group), Jan13-Dec13),
    Third Row Group. Then Jan14 to Aug 14.
    I tried with below approach to show variable number of rows per page.
    Floor((RowNumber(nothing)+9)/12).
    I need to tweak above expression some how to achive the actual requirement stated above. Can anyone help me to achive this requirement?

    Hi I achived this requirement. Thanks.

  • Refreshing sql report region based on values from another region - 4.0

    Greetings All,
    I have a page with two regions, say region 1 and region 2. I have a before header process that fetches values from db based on criteria entered from another page. Region 2 is a sql report region with bind variables from region 1. When this page is rendered region 1 renders properly however sql report region always returns no records. What am i missing here?
    I would like to have the region 2 render a report based on the values from region 1. Region 2 has a sql query that looks something like
    select
    colum 1,
    column 2,
    column 3
    from table t1
    where t1.c1 = :p10_item1
    and t1.c2 = :p10_item2Using apex 4.0
    thanks
    Seetharaman

    If these items hidden, try making them display only .
    Also what happens when you move the items from region 1 to region 2.
    From my experience items do not have much of a dependency on the region they are attached to other than cases when the region is not rendered(when its condition fails) and then the item values become null(bcoz they themselves are not rendered).

  • PO Form with Terms & Conditions that Change Depending on a Value in Another Field

    Hi - I have read through the relevant topics in this forum and have attempted several of them without luck. I am currently working on a form in which there is an empty JFMain (I do not want to populate fields on this page since I don't want things in this page my "static" header - logos, title, etc. since the Terms and Conditions pages should not show any of this.) On my page 2, I have subforms for all my fields except my Terms and Conditions. (These fields are controlled by a data file.) On my remaining pages I have 3 sets of Terms and Conditions - all about a page long - hard-coded as text and placed in subforms with a dummy field off page to ensure they print. What I want to do is print the subforms from page 2 and then the applicable terms from page 3, 4, or 5 depending on the value in a field located in one of the subforms on page 2. What I currently get is my subforms and then ALL my terms printing. Any thoughts?
    My preamble overrides look like this:
    ^define group:D_HEADER \field$POSITION\reserve".11",in\subformHEADER.
    ^define group:G_HEADER @group:D_HEADER.
    ^define group:dummy!FldNotAvail \groupG_Terms_Private_Commodity
    ^define group:dummy2!FldNotAvail \groupG_Terms_Private_Services
    ^define group:dummy3!FldNotAvail \groupG_Terms_Public
    ^define group:JfEndData!EndData @group:D_end.
    I had to place the JFEndData! statement into the Preamble since the last subform with fields called before the Terms subforms has a global field from another subform above it. For whatever reason, it was duplicating this subform after printing the Terms and Conditions.
    I tried adding a nested if statement into field that will control when I want each subform to print but it was ignored. I also tried hardcoding a group call into the preamble with the logic as well with no results. If someone has example code they can share, this would be great.

    I receive Adobe help forum posts via email and I've been saving a few for the pointers they contain. I have some saved that might help you out a bit...
    A reply to the "Please can some one help me out......." post by Mr BoJangles on 10/29/2007 gives some information about forcing a subfield to be displayed.
    A reply to the "Conditional logic" post by Marco Degl'Innocenti on 8/2/2006 gives information on initiating a subform based on the value of a field in the data stream.
    A reply to the logic post by Marco DeglInnocenti on 2/22/07 also gives information on initiating a subform based on the value of a field.
    I hope these can be of help. If you can't access them on the forum I can repost them.

  • Insert value into a column based on value of another column

    Hi,
    I am trying to insert a value into a record based on a column in
    the record, using a trigger. The complication arises because
    the new value is selected from the same table. For example:
    SELECT COL1, COL2, COL3, COL4 from TABLE1
    I want to set COL2 and COL3 based on the value of COL4. And to
    get the value of COL2 and COL3, I will go back to TABLE1 and set
    the condition to TABLE1.COL1 = :NEW.COL4
    I cannot seem to execute the trigger as I get the message "ORA-
    04091: table SYSTEM.TABLE1 is mutating, trigger/function may not
    see it" everytime.
    Is this the correct way to achieve what I wanted? Or is there
    another way?
    Appreciate your feedback. Thank you in advance.

    Hi,
    I am trying to insert a value into a record based on a column in
    the record, using a trigger. The complication arises because
    the new value is selected from the same table. For example:
    SELECT COL1, COL2, COL3, COL4 from TABLE1
    I want to set COL2 and COL3 based on the value of COL4. And to
    get the value of COL2 and COL3, I will go back to TABLE1 and set
    the condition to TABLE1.COL1 = :NEW.COL4
    I cannot seem to execute the trigger as I get the message "ORA-
    04091: table SYSTEM.TABLE1 is mutating, trigger/function may not
    see it" everytime.
    Is this the correct way to achieve what I wanted? Or is there
    another way?
    Appreciate your feedback. Thank you in advance. I'm not sure what you mean when you insert a value into a
    record, but if you are setting a value in a column of the same
    record using a trigger, then it's easy.
    :new.COL2 := ....:new.COL4...
    :new.COL3 := ....:new.COL4...
    The trigger must be 'INSERT or UPDATE' and 'FOR EACH RECORD'.
    If you are setting a different record in the same table, the
    solution is much more difficult.

Maybe you are looking for