Howto use an existing record as template in a create new record form

hi all,
I have a table with configuration lines, Currently accessible via a report/form combination. This works fine to create, view & edit data.
However users often need to create a new record which is 90% like an existing record.
So what they want is to go to an existing record and use it as template for creating a new record (by clicking a button "create copy from"
My solution attempt
-when the button is pressed send users to the normal create form, and prefill some of the items with data from the "template record", after which everything is the same as creating a record from scratch
What did I try
- as above redirect user to the "create page" and sent the desired items values via URL Syntax. Failed since I have about 20 items and the button settings won't allow me to add more then 10 (besides it not a pretty sight)
- Instead of sending via URL I've tried only sending the record id for the template and have a "before header process" load the item values in session state. Failed since the page items are all (load form source each time) since they are database columns
Constraints for the solution
- No, I can't go first inserting a copy of the record and then display it in edit mode since the remaining 10% of the record can not to be copied because of table constraints. They have serious constraints, which needs user input.
- (and no I can't first insert dummy data, that's a poor man's solution)
- I'd like to reuse the current create/edit form since it contains quite some business rules and constraints. So dubbing the page will put me up with a double load of maintenance in case of future changes in business rules
I'd appreciate any good clues in solving this requirement
best regards,
Geert

Hi Shunt,
Not entirely what I wanted accomplished but it held the key.
Removing the PK wouldn't trigger the DML to respond differently on it's own, since the DML decides the database action based on the request.
I have the create/edit page working on with a "COPY" request
This way I can call the page both from the report as the form page.
When called with COPY request the page is loaded as normal edit except
- I hide the delete and apply changes button
- I show the create button
When the create button is pressed a computation removes the PK
Since the create button is pressed instead of apply_changes it will indeed perform an insert
Thanx again for the hint
Sometimes you need an new perspective
Geert

Similar Messages

  • Creating new records while querying existing record

    Hi,
    I have one master - detail form.
    First i created 1 record. Request ID is the primary key. Now request id generated. For ex.: 10
    Request Id, date, requestor , location, status fields are in header block.
    In lines block, i hv some other fields.. and one field called 'Activity'.
    While creating first record, the activity will be 'New'.
    Then i'll query the record '10'.
    when i'm changing the activity 'New' into 'Upgrade', it should create new record with new request ID.
    How to do this?
    I hv written procedure that, i'm taking field values to local variables. Then assigning the local variable values to field values.
    It is not creating as new record. It overwriting the existing record with new values. Existing record is missing.
    Pl. give steps.
    Thanks
    Kavi

    Hi,
    Okk, you will have to do two things. Create two trigger on block level on which you want to do your changes.
    1. First trigger. (PRE-UPDATE)
    In pre-update trigger u will have to write the complete insert statement into the same table with new req id. like
    DECLARE
    vReqNo DATA_TYPE;
    BEGIN
    SELECT MAX(REQ_ID)
    INTO vReqNo
    FROM your_table;
    INSERT INTO your_table
    (req_no, fields....)
    VALUES
    (vReqNo, :forms_values);
    END;
    2. Create 2nd trigger on block level (ON-UPDATE)
    write in this trigger
    NULL;
    for viewing the inserted record. What u have to do is in ON-UPDATE after null; create one timer NO_REAPEAT.
    and in timer u will have to set the block property to req_id = generated_req_id_from_pre_update_trigger and
    execute_query;
    hope it will work...
    -Ammad

  • Should I use an existing usb driver or should I create my own?

    We are developing a custom piece of hardware that uses a TI6250 chip to provide an USB communication channel. I read through the web reference http://zone.ni.com/devzone/conceptd.nsf/webmain/67​92BAB18242082786256DD7006B6416?opendocument that seems to imply that I don't want to use any existing drivers but I need to create my own using the wizard.
    I'm new to USB so I'm trying to get started off right so any advice for a novice would be appreciated.
    Thanks,
    Brad

    What the wizard creates is a .inf file that contains manufacturer id, model number, etc. that defines the USB device that you want to talk to. On your custom board, you have to implement these settings in eeprom/flash. The TI chip driver tells your board pnly how to manage USB communication. You would also need to implement a means to interpret commands received into the hardware functions that are on your board. For example, if the text "RST" is received, intrepret that as a reset and set board level registers to do that. The LabVIEW driver would include a Reset VI. This VI would do a VISA Write with the text "RST". So what we're talking about is actually several different levels of drivers and code - VISA, the .inf file, the embedded code on your custom board, and LabVIEW VIs.

  • I have a new iPad and tried to set up as new, then realized i needed to sign in as an existing itunes user.  I reset my new ipad as new, but now when I sign in using my existing ipad it backs up to the new one I just set up.  I need my itunes on new iTune

    I have a new iPad and tried to set up as new, then realized i needed to sign in as an existing itunes user.  I reset my new ipad as new, but now when I sign in using my existing ipad it backs up to the new one I just set up.  I need my itunes account on my new ipad.  help

    You want to restore from the backup. Do not set up as new. You can read the article that Tom posted above, but it really is pretty simple.
    Transfer any purchases from the old iPad into iTunes, backup the old iPad in iTunes and them sync one more time.
    Connect the new iPad and when prompted during activation, restore from the backup that you just created and then sync with iTunes.
    The new iPad should be identical to the old iPad, but you will have to enter some passwords again on the new device.
    Transfer purchases.
    http://support.apple.com/kb/HT1848
    How to backup and restore from a backup
    http://support.apple.com/kb/HT1766

  • RH_INSERT_INFTY not creating new records

    Hi All,
    I am using the FM RH_INSERT_INFTY to insert new records in HRP1000.
    See the below FM call :
    CALL FUNCTION 'RH_INSERT_INFTY'
         EXPORTING
             fcode               = 'INSE'
             vtask               = 'D'
              order_flg           = 'X'
              commit_flg          = 'X'
              authy               = 'X'
              PPPAR_IMP           =
              OLD_TABNR           = ' '
              REPID               = ' '
              FORM                = ' '
                keep_lupd           = keep_lupd
         TABLES
              innnn               = it_i1000
         EXCEPTIONS
              no_authorization    = 1
              error_during_insert = 2
              repid_form_initial  = 3
              corr_exit           = 4
              begda_greater_endda = 5
              OTHERS              = 6.
    But instead of creating new records it is changing the existing record in HRP1000.
    Actually I want to create new records with different long text and short text in different languages so in case object id and object type even the dates can be same but the language would be different.
    So I need to create a new records with a different language key and different short text. But this function module is changing the existing object short text,long text and language.
    Could you please reply at the earliest.
    Thanks & Regards,
    Poonam

    Hi,
    you're right, this function didn't create new record when i want to create a record with same object but have different language.
    you can use  this function for your problem :  RH_INSERT_INFTY_DIRECT
    i tried and it works.
    CALL FUNCTION 'RH_INSERT_INFTY_DIRECT'
      EXPORTING
        vtask                     = 'V'
      KEEP_LUPD                 =
      tables
        innnn                     = p1000
    EXCEPTIONS
       NO_AUTHORIZATION          = 1
       ERROR_DURING_INSERT       = 2
       REPID_FORM_INITIAL        = 3
       CORR_EXIT                 = 4
       BEGDA_GREATER_ENDDA       = 5
       OTHERS                    = 6
    Regards,

  • Imported Form and sub-form from another database. Sub-form not creating new records tied to parent form's data.

    I have imported all objects from an old access db (.adp file) into a new db (.accdb).  All of my data lives in sql server so I have added all the tables and views to the .accdb as linked tables.  My forms all connect to data, but I am having issues
    with a sub form.  The sub form does not allow for creation of children records tied to the parent record the way the old db did/does.
    Correct - old format .adp file (notice the empty second record in sub-form with the defaulted date of today's date):
    Incorrect - new .accdb file (notice the lack of empty second record in sub-form like above):
    If I click the create new record icon in the bottom of the subform, it creates a completely blank record not tied to the parent record (fields blacked out in screen shots above).  When using this button all parent record fields are blank.  
    I have also verified the child table used in the sub-form has a valid Fky relationship to parent table used in the parent form.
     

    Have you checked each forms 'Filter' property (in Design view) to make sure they are blank and that each forms 'Filter On Load' property to make sure it is set to 'No'? Also, you might try inserting the following commands in each forms On
    Open event:
    DoCmd.RunCommand acCmdRemoveAllFilters
    DoCmd.ShowAllRecords
    If you can open each forms Record Source and they are showing that new records are able to be entered (the new record * is showing at the bottom of the recordset), then check each forms On Load and On Open events to make sure there is no filtering.
    In addition, check any macro or VBA commands behind the button that opens the main form to make sure there is no SQL filtering in the DoCmd.OpenForm command.
    If one of the forms Record Source does NOT allow new records, then you will need to change that Record Source so the new record * indicator shows.
    Out of ideas at this point.

  • While Creating New Insert Form Existing Data Display from the Table

    Hi
    I am New To Sun Java Studio Creator and New to Java Also While Creating New Insert Form Existing Data Display from the Table while i am Run the Form. Can any one help me to Solve this one

    Dear Giri,
    As per your Advise, Literally I have Search the Properties for the Components to set value Null, but I am Unable to find the Value in Properties palate. I have tried in various options like
    In the Properties Palate
    TextField1_onselect use Value null
    TextField1_text I have selected use Value option and I have manually Keyed-in null;
    In the JSP Page, I have manually keyed in the null value below said
    <ui:textField binding="#{BI.textField2}" id="textField2" style="position: absolute; left: 240px; top: 96px" text="#{BI.bDataProvider.value['ISSUENO'] = null}"/>
    <ui:textField binding="#{BI.textField2.Value = null }" id="textField2" style="position: absolute; left: 240px; top: 96px" text="#{BI.bDataProvider.value['ISSUENO'] = null}"/>
    At last I am Failure. I am ignorant of it. Can you please help me on this where I have to set null value for the components? I will be very kind of you

  • In oracle forms how to restrict creating new record

    I have a multi record block, I dont want to create new record. If I use the down key after the last record control is moving to next record. I dont want this to happen. I want to scroll between first and last record.
    Can anyone tell me ?

    Look up the Forms Help for 'system.last_record'.
    I'd code the KEY-DOWN trigger on the block as...
    IF :System.Last_Record = 'TRUE' THEN
    Bell;
    Message('You are on the last row');
    ELSE
    down;
    END IF;
    This avoids any processing or validation work being done on leaving the current record or creating the new record.

  • How can I make the popup with empty fileds and create new record?

    I would like to use a popup to create new record.
    I created a af:popup by drag and drop a VO from data control to jsff. then, I created a button and place a af:showPopupBehavior. I was able to popup window by click the button.
    however, the window filled with the information from the 1st record. and when I select a record in table and click popup, the popup is filled with that record.
    How can I make the popup with empty fileds and create new record by saving the popup?
    Thanks

    You can have edit and new buttons, in the PopupFetchEvent identify button source (using popupFetchEvent.getLaunchSourceClientId()) if new button clicked clear the binding using below code.
    If you want to see empty fields, in the popup PopupFetchEvent clear the input component bindings.
    resetBindingValue("#{bindings.<componentid>.inputValue}", null);
        public static void resetBindingValue(String expression, Object newValue) {
            FacesContext ctx = FacesContext.getCurrentInstance();
            Application app = ctx.getApplication();
            ExpressionFactory elFactory = app.getExpressionFactory();
            ELContext elContext = ctx.getELContext();
            ValueExpression valueExp = elFactory.createValueExpression(elContext,expression,Object.class);
            Class bindClass = valueExp.getType(elContext);
            valueExp.setValue(elContext,newValue);
        }

  • How to clear the previous  filter text when creating new record??

    Dear All,
    my question is i i created table having filter and sorting.
    when i m searching data through filter text data is coming but i want to clear that text(filter text) when i am creating new record.
    for my case when i am creating new record all blank field is coming but in that filter text box previous data is coming which one i was searching.
    but i need when i will create a new record tat filter text should be clear.
    Thanks
    Damby

    Damby, please tell us your jdev version.
    Check my blog http://tompeez.wordpress.com/2011/10/29/jdev-how-to-reset-a-filter-on-an-aftable/ you can add this to the button you use to create the new record.
    Timo

  • How to create new record with old values

    Dear all
    i have creation page with 45 fields are there
    user will enter all the fields and save it will call to non editable mode
    if user will click on change button it will call to editable mode
    in that my requirement is user wont change among those ites(45 items)clcik on save again it will call to view mode
    in that user will change any one of the value among 45 items and click on save button i need to create one more record in database
    if user wont edit any one of the field out of 45 items i dont want to create new record in database
    how can we achieve thsi functionality
    Regards
    Sreekanth

    Hi Srikant,
    When user may edit the record, the same row may get updated in vo. Thus over writing existing row instead of creating new row.
    Approach1..
    On the page where user may edit records, instead of presenting records of existing row, present copy of existing row. So
    In AM... (Later on you can put vo logic to its proper place, i.e. vo java file)
    public void viewPageCallSetup()
    Row originalRow=vo.createRow();
    Row dummyRowForEdit=vo.createRow();
    //COPY THE ORIGINAL ROW TO DUMMY ROW. IF THERE IS DIRECT METHOD TO CREATE COPY OF EXISTING ROW, THAT MAY BE MUCH BETTER.
    for(int i=0;i<vo.getAttributeCount()-1; i++)
    dummyRowForEdit.setAttribute(i, originalRow.getAttribute(i));
    vo.insertRow(dummyRowForEdit);
    vo.setNewRowState(Row.STATUS_INITIALIZED);
    vo.setCurrentRow(dummyRowForEdit);
    call this method in contoller's processRequest..
    string oid=pagecontext.getparameter("oid");
    if(pageContext.getparameter("Purpose").equals("Edit")) //Means user clickED the edit button so we need to replicate the row
    am. viewPageCallSetup(oid); //calling this method in am
    else
    In PFR...
    if(pageContext.getparameter("Purpose").equals("Edit"))
    am.xxcostedit(oid); //calling this method in am
    in case user selects "Cancel" on edit form,we need to remove the duplicate row. So in AM write a method to remove the duplicate rowd on click of "Cancel" button on edit form.
    Rest of the logic is same for "Save" button. Just say commit.
    Abdul Wahid

  • When creating new records in any entity getiing error in mscrm 2011

    Dear all;
    when i try to create new record in any entity for example opportunity i am getting this error 
    Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Server was unable to process request.Detail:
    <OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
      <ErrorCode>-2147023878</ErrorCode>
      <ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic"
    />
      <Message>Server was unable to process request.</Message>
      <Timestamp>2013-09-04T12:10:21.3522306Z</Timestamp>
      <InnerFault i:nil="true" />
      <TraceText i:nil="true" />
    </OrganizationServiceFault>
    please help

    Hi Anwar,
    As suggested above enable the trace, This would help you get the exact and detailed error.
    Steps:-
    1. Start the trace
    2. Reproduce the Error
    3. Stop the trace.
    4. Look in the log file and search for error.
    Thanks,
    Prasad
    Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.

  • Dynamic Action-Delimiting a record and creating new record

    Hi ,
    My requirement is in dynamic Action I need to delimit all records in a Subtype of an Infotype and create New record for these records with BEGDA as ENDDA + 1 of the delimited records.
    Iam able to delimit all records in the Subtype but , Iam not able to create new records.
    My code for delimiting is as given below, in T588Z,
    9901     2          06     801     P     P9901-SUBTY='2'
    9901     2          06     802     P     PSYST-IOPER='MOD'
    9901     2          06     803     P     P9901-STATS='X'
    9901     2          06     804     P     P9901-PREAS='91'
    9901     2          06     805     F     DELIMIT_DTE(ZHSRAS_T588Z_9901)
    9901     2          06     806     W     P9901-ENDDA=RP50D-ZZDATE3
    9901     2          06     807     I     MOD,9901,3
    9901     3          06     808     P     SY-UCOMM='UPD'
    9901     3          06     809     F     DELIMIT_DTE(ZHSRAS_T588Z_9901)
    9901     3          06     810     W     P9901-ENDDA=RP50D-ZZDATE3
    The above code is working fine.
    My code for creating new record is as given below, even though the control is oing to the subroutine, INS statement is not working, and hence new record is not getting created.
    9901     3          06     811     P     SY-UCOMM='UPD'
    9901     3          06     812     P     PSAVE-ENDDA<>P9901-ENDDA
    9901     3          06     813     P     P9901-STATS<>'X'
    9901     3          06     814     I     INS,9901,3
    9901     3          06     815     F     BEGIN_DATE(ZHSRAS_T588Z_9901)
    9901     3          06     816     W     P9901-BEGDA=RP50D-ZZDATE3
    9901     3          06     817     W     P9901-ENDDA='99991231'
    Kindly help me on this.

    Hi shahana,
    1. I have not worked on this dynamic action.
    2. But instead of doing in 2 steps,
       it is usually done in 1 step only, manually.
    3. If we CREATE record from some date,
       then the OLD will AUTOMATICALLY get Delimited.
    (We don't have to do anything specially for delimiting
      the old record)
    regards,
    amit m.

  • Creating new record instead of update existing one in Bank application

    HI Mate
    Here is my issue and I want from ur help
    Bank information iview---when i am doing "EDIT" option in that it will edit the bank details,But when i check the records in SAP HR system.it is creating extra record instead of replace that record with payroll date.
    Could anyone please help me to fine the solution ASAP.as it is very import for me
    Thanks
    Keshari

    Note 965324
    Check your time contraints
    As per the timeconstraint validation if you edit the record it is
    changing this validity for the future and the gap is included. That is
    the system standard behavior as per the configuration. To achieve the
    desired behavior you need to create a new record or change
    timeconstraint to 1 (but in this case only one record may exist at a
    given period).
    I kindly ask you to refer to note 818957 which explains the Use Cases x
    Timeconstraint configuration.
    ie
    to achieve the functionality you have to create new future record.
    Reason is you are using TC:3, in which gaps are allowed, but you dont
    want gap in between.
    When an employee wanted to change his/her bank details
    via portal effective future date, system is
    giving error as "Change in the payroll past not possible".  This error
    appears for the scenario as mention below :
    1.  Payroll is processed and Exited for the period 16th Dec 2010 to
    31st Dec 2010   on  28th Dec 2010  (3 days in advance).
    2.  Employee wanted to change bank details on 29th Dec 2010 effective
    1st Jan 2011 via ESS portal.
    3.  An error Change in the payroll past not possible" is shown while
    saving the data.
    In your case either you have to use TC:1, since you don't want gap in
    between, or you have use new button to create future record.

  • Restricting User from creating new records using when-validate-record

    Hi,
    I have a requirement for which I have to restrict he user from creating a record in the Supplier Master form if the suppliier type is 'Affiliate Supplier'.
    I have done the following setups
    Seq 10
    Description Restricting user from creating Affiliate records
    Level Function
    Enabled Yes
    Condition:
    Trigger Event WHEN-VALIDATE-RECORD
    Trigger object VNDR
    Condition "${item.VNDR.VENDOR_TYPE_DISP_MIR.value} is NOT NULL
    and
    ${item.VNDR.VENDOR_TYPE_DISP_MIR.value} LIKE 'Affiliate%'
    Processing Mode BOTH
    Context
    Level User
    Value User Name
    Action Sequence 1
    Type Message
    Action Description Saving Affiliate record
    Language ALL
    Message Type Show
    Message Text You Cannot Create Affiliate records Here
    Action Sequence 2
    Type Builtin
    Action Description Stop Proceesing
    Language ALL
    Action Enabled Yes
    Builtin Type RAISE FORM_TRIGGER_FAILURE;
    This is working good on one instance but when I moved it to another instance
    when I query the form and try to navigate to the bank accounts tab of the form which is based on a differnt block i.e VNDR_USES block, the when-validate-record trigger fires there also and stops the processing.
    Any suggestions on this would be higly appriciated.
    Thanks in Advance.

    Hi Srini,
    Yes, it does work...but in a Form Session if i Create more then one Item, in some cases it fires for the first records and not sleeps for the second.
    Sometimes it doesn't give any response.
    Appreciated if you divert to the link to check the Pacthes for 11.5.10 on Form Personalization.
    Please share any ideas/example if yiou have to achieve the below requirement.
    Requirement:
    Once New record is created , a Custom Procedure should be invoked.
    with out closing Form i am able to create n number of Items, so for every Item it should invoke Custom PLSQL Code on Save.
    Let me know if i can achieve the same in Custom.pll .....as i can use either of Options.(Form Personalization/Custom.pll)
    Thanks & regards,
    Edited by: user632004 on Mar 16, 2010 7:50 PM
    Edited by: user632004 on Mar 16, 2010 8:09 PM

Maybe you are looking for

  • Error when deploying ejb 3 in weblogic10

    Hi, I'm using the EJB3.0 in weblogic10, just as the following: remote interface: com.test.intf public interface Test{ public void test(); and the impl: com.test.impl @stateless @Remote(Test.class) public class TestBean implements Test{ public void te

  • IPhoto Quits will not show photo library

    This will be quite a long post but I want to make it as clear as possible and may-be even assist by being a summary of some of the other posts in the forum. 48 hours ago I "upgraded" to iLife '09 on my "old" Power-PC Dual 1.8 G5. On first-run it advi

  • Fastest Way to Upload a 10 Minute Video For a Vlog?

    Hi all. I have a 10 minute video (484 MB) that I've compressed as a .MOV file. I'm trying to upload it to my website or to Internet Archives and it's taking FOREVER. Am I better off compressing it as an mpeg-4 or for ipod? Is it normal for 10 minutes

  • [Solved] Hybrid graphics. Can't use the dedicated card

    Hey. I've just installed Arch on a laptop that's got 2 AMD cards. 6520G and 7xxx. I'm trying to disable the dedicated one, but I don't really know how. Running xrandr --listproviders only shows one of the cards: Providers: number : 1 Provider 0: id:

  • Elements 7 on imac

    I purchased a Dell laptop for my wife awhile ago and I purchased the Photoshop/Premiere Elements 7 with it. She has never used it and I was wondering if I can use the same disc to install the program on a recently purchased iMac? Thanks for the help