Populate list Item with a recordgroup?

Hi Friend
I want to populate a list Item with a "Recordgroup". Does it possible without using the add_eliment function?
I did it through the Loop to read the item from record group. If the database changes the record does not change in my list item. because the list containing the added items which was delivered in the load time. But like Pressing F9, we can easily see the last changed data of the database.
If possible please send me the detail code to me. Here I delivered the detail procedure which i did for that purpose.
Farhad
==========================================================
PROCEDURE Populate_Item_In_List (     List_name VARCHAR2,
                                                                                     QUERY_Text VARCHAR2,
                                                                                     rg_Level_Col_name VARCHAR2,
                                                                                     rg_Value_Col_name VARCHAR2) IS
     HERE THE PROCEDURE POPULATE THE LIST WITH THE REQUIRED DATA UNDER A CORRCET SQL (SELECT) COMMAND
     List_name                     THE LIST ITEM WHICH HAS TO BE LOADED BY THIS PROCEDURE
     QUERY_Text                     THIS CONTAINS THE QUERY TEXT BY WHICH THE LIST ITEM WILL LOAD
     rg_Level_Col_name THIS IS THE LEVEL OF THE REQUIRED ITEM THAT OBVIUSLY A CHAR DATA TO BE RETRIVE
     rg_Value_Col_name THIS IS THE VALUE OF THE REQUIRED ITEM THAT OBVIUSLY A NUMBER DATA TO BE RETRIVE
               R_Group          RecordGroup;
               Rowcount      NUMBER;
               rg_name      VARCHAR2(40) := 'DefaultRG';
               rg_id      RecordGroup;
               errcode      NUMBER;
               Lid                    Item;
BEGIN
     --+++++++++++++++++++++THIS IS USED TO POPULATE THE RECORD GROUP+++++++++++++++++++++++++++++++++
               rg_id := Find_Group(rg_name);                                             Find the record group                                                   +
                                                  --+
               IF Id_Null(rg_id) THEN                                                                                                                                                                          --+
                         rg_id := Create_Group_From_Query(rg_name,Query_Text);                                                                                     --+
                         errcode := Populate_Group(rg_id);                                                                                                                                       --+
               else                                                                                                                                                                                                                       --+
                         errcode := Populate_Group_With_Query(rg_id,Query_Text);                                                                            --+
               END IF;                                                                                                                                                                                                                  --+
     --+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     
          If errcode = 1403 then
               Message('There is no data to be retrive......');
          else
     --+++++++++++++++++++++THIS IS USED FOR LOADING DATA TO THE LIST ITEM++++++++++++++++++++++++++++
               Rowcount      :=      Get_Group_Row_Count(rg_id);                              Counting the total rows in RGroup          +
               Lid                    :=     Find_Item(List_name);                                                                                                                                            --+
               Clear_list(Lid);                                                                                          Clear the list which is loaded now     +
               FOR J IN 1..Rowcount LOOP                                                                                                                                                                     --+
     Add_List_Element(List_name,                                                            the name of the list item                              +
                                                  J,                                                                                index of the list                                                  +
                                                  Get_Group_Char_Cell('DefaultRG.'||rg_Level_Col_name,j),     Level of item+
                                                  Get_Group_Number_Cell('DefaultRG.'||rg_Value_Col_name,j) value of item+
                                                  );                                                                                                                                                                               --+
               END LOOP;                                                                                                                                                                                                             --+
     --+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
          end if;
END;
===============================================================

Hi Farhad,
You can make use of Populate_List built-in.
Populate_List(list_id, 'RECGRP');
You can find more information in online documentation of forms.
Cheers
Zakiy

Similar Messages

  • Unable to populate list items with criteria

    Hi
    I want to populate some values based on condition in a text field.
    I tried the code wihtout condition in new form instance and its working fine but when i tried with an condition on when mouse click on list item and its working for first action.If list having more than 1 values in list its became blank and not working
    DECLARE
    group_name varchar2(40) :='LSTCUR';
    group_id RecordGroup;
    list_id item := Find_item('TB.LSTCUR');
    status NUMBER;
    begin
    IF Id_null(group_id) THEN
    group_id := Create_Group_From_Query('LSTCUR','select distinct curr,curr from REC_CURR_V where br =:TB.PSRCH');
    END IF;
    Clear_list(list_id);
    status := Populate_Group('LSTCUR');
    Populate_list(list_id,group_id);
    end;
    rgds
    soumya

    soumya,
    Try this code.
    DECLARE
         RG_Group_ID RECORDGROUP;
         Num_Status NUMBER;
    BEGIN
         RG_Group_ID := FIND_GROUP('LSTCUR');
      IF NOT Id_Null(RG_Group_ID) THEN
              DELETE_GROUP(RG_Group_ID);
      END IF;
         RG_Group_ID := CREATE_GROUP_FROM_QUERY('LSTCUR', 'SELECT DISTINCT CURR, CURR FROM REC_CURR_V WHERE BR = ''' || :TB.PSRCH || '''');
         CLEAR_LIST('TB.LSTCUR');
         Num_Status := POPULATE_GROUP('LSTCUR');
         POPULATE_LIST('TB.LSTCUR', RG_Group_ID);
    END;Regards,
    Manu.
    If my response or the response of another was helpful, please mark it accordingly

  • How to Populate a List item with LOV'S

    How to Populate a list of items with Lov's
    and then how to dynamically change the Values of one LIST Item
    Based on the Value of anothe List item

    976798 wrote:
    --Hello..I want to ask that How to bind a list item with  table values? this below code does not populate items from database to list item.Pls any body give me solution.
    declare
         group_id RecordGroup;
         list_id Item:=Find_Item('LST_CLASS');
         status number;
    begin
         group_id:=Create_Group_From_Query('Answer_List','select CLASS_ID,CLASS_NM from CLASS_MSTR');
         status:=Populate_Group('Answer_List');
         message(to_char(status));
         Populate_List(list_id,group_id);
         end;Welcome to the Oracle Forums. Please take a few minutes to review the following:
    <ul>
    <li>Oracle Forums FAQ
    <li>Before posting on this forum please read
    <li>10 Commandments for the OTN Forums Member
    <li>How to ask questions the smart way
    </ul>
    Following these simple guidelines will ensure you have a positive experience in any forum; not just this one!
    Check this link: How to Dynamically Populate a Pop List ?
    Hope this helps
    Hamid
    If someone's response is helpful or correct, please mark it accordingly.

  • Populate HTML LIST ITEM with a query

    Hello,
    I've a problem,
    I'm building a portlet based on an html form.
    In this forms there are several list items,
    How can I populate an html list item with a dynamic query based on a db table?

    I hope you are looking for something like this
    declare
    v_ret_string varchar2(32767);
    begin
    v_ret_string := ' <TABLE BORDER="1" bordercolor="#0000FF" bgcolor="#FFFFF0">
                   <TR><TD><TABLE BORDER="0" CELLSPACING="3" CELLPADDING="0">
                   <BR>
                        <TR><TD ALIGN=middle><SELECT SIZE="1" NAME="emp_list">
                             <OPTION VALUE="">';
    For get_emp_list In (Select ENAME,EMPNO
    From SCOTT.EMP
              Order by ENAME) Loop
    v_ret_string := v_ret_string || '<OPTION VALUE="'||get_emp_list.EMPNO||'">'||get_emp_list.ENAME;
    End Loop;
    v_ret_string := '</SELECT></TD></TR><TABLE></TABLE>';
    End;
    which uses PL/SQL code to generate the html page.
    Thanks
    -Krishnamurthy

  • How to populate List Item from the table in a form builder

    I want to know how to populate the List Item (pop up menu and combo box) from a table.
    Supposing I have a table Customer(cust_id,cust_name)
    and now I want to populate it in such a manner that I can update the data back to the database and also access the list on the form.

    This is the method i am using to populate a list.
    1- First of all you need to create a non-database list item for customer_name.
    2-create this procedure
    PROCEDURE populate_list_with_query
    --Populates the given list item with the specified query.
    (p_list_item in VARCHAR2
    ,p_query in VARCHAR2)
    IS
    /* Name the record group after the list item (no
    block prefix). */
    cst_rg_name constant VARCHAR2(30) :=
    GET_ITEM_PROPERTY(p_list_item,item_name);
    v_rg_id RECORDGROUP;
    BEGIN
    v_rg_id := FIND_GROUP(cst_rg_name);
    IF ID_NULL(v_rg_id) THEN
    v_rg_id := CREATE_GROUP_FROM_QUERY(cst_rg_name,p_query);
    END IF;
    IF POPULATE_GROUP(v_rg_id) = 0 THEN
    POPULATE_LIST(p_list_item,v_rg_id);
    /* Force display of first list element label
    in the list item. */
    COPY(GET_LIST_ELEMENT_VALUE(p_list_item,1),p_list_item);
    END IF;
    END populate_list_with_query;
    3- Create When-Create-Record on the block level and write this code
    BEGIN
    POPULATE_LIST_WITH_QUERY('bk1.customer_name',
    'SELECT customer_name, to_char(customer_id) FROM customer');
    END;
    In this example, the customer name is the (visible) list label and the customer ID is the (actual) list value
    i hope this will solve your problem ...

  • Populate list item dynamically

    Hi all.
    I have a problem. I must populate a list item with a select, using the add_list_element statement inside a loop, using a cursor. My problem is that I must parametrize the select of the cursor: I pass a parameter in the procedure which is a field of the select of the cursor, but I have no result. The statement is the follow
    cursor c1 is
    select distinct("name of the parameter")
    from table
    order by 1;
    When I execute this statement I have no result. Is there anyone to help me???
    Thank you all for your collaboration.

    Hi dear,
    as for as i understood your problem, you want to populate the element list with a select query and your are using cursor and add_elements for this purpose which is complex and lenghtly,
    why dont you use populate_group and populate_group_with_query built-ins instead of add_elements built in, by above mentioned two builts ins, you can populate the element list with a query and even you can refresh your element list at any time during runtime by populate_group_by_query. here is an example, you can also take benefit from forms builder help;
    in new_form_instance trigger write following code to populate a list with select query;
    DECLARE
    rg_id RecordGroup;
    errcode NUMBER;
    BEGIN
    rg_id := Create_Group_From_Query( 'LIST1_GRP','select code_name, code_no from any_table where code_name = ''0107''',FORM_SCOPE,200);
    errcode := Populate_Group( rg_id );
    Clear_List('CNOTE_TYPE');
    Populate_List('CNOTE_TYPE','ACCNO_GRP');
    end;
    user populat_group_by_query to refresh list elements after the forms is already load and elements list is already populated.
    any further question, feel free.

  • How to create list items with multiple attachment files using rest api javascript

    In one of user form I am using javascript rest api to create a list item with multiple attachment files. So far I am able to create list item and once created uploading an attachment file. But this is two step process first create an item and then upload
    a file.
    It create an additional version of the item which is not desired. Also I am not able find a way to attach multiple files in a go. Following is the code I am using.
    createitem.executeAsync({
                    url: "/_api/web/lists/GetByTitle('UserForm')/items(1)/AttachmentFiles/add(FileName='" + aFile.name + "')",
                    method: "POST",
                    contentType: "application/json;odata=verbose",
                    headers: {
                        "Accept": "application/json;odata=verbose",
                        "X-RequestDigest": $("#__REQUESTDIGEST").val()
                    binaryStringRequestBody: true,
                    body: fileContent,
                    success: fnsuccess,
                    error: fnerror
    So somehow I need to combine item attributes along with attachment files in body: param. I visited https://msdn.microsoft.com/en-us/library/office/dn531433.aspx#bk_ListItem but no success.
    Appreciate any help.

    Thanks Mahesh for the reply and post you share it was useful.
    But this does not solve the core of the issue. You are uploading attachments after creation of item and multiple files are being attached in loop. This is kind of iterative update to an existing item with attachments. This will end up creating multiple versions. 
    What I am trying to achieve is to create an item along with multiple attachments in a go. No item updates further to attach a file.
    Please suggest how this can be done in one go. SharePoint does it when one creates an item with multiple attachment.
    Thanks for your reply.

  • SharePoint Designer 2013 (2010 Platform Workflow) - How can I create a new list item with a SPECIFIC content type?

    In SharePoint 2010 I created workflows that used the 'Create list Item' Action, which then set the Content Type ID (so I could create documents of various types in a document library). 
    We just switched to the SharePoint 2013 platform, and now the drop down for Content Type ID is blank in all of the workflows that are still using the SharePoint 2010 platform.  Is there any way to create a list item with specific content
    type?  Even if I could just input a string into that field instead of using this blank drop-down.  Please help! 

    Hi Sarah,
    According to your description, my understanding is that you cannot create a new list item with a specific content type using SharePoint 2010 Platform Workflow.
    I tested the same scenario in my environment, and the Create List Item worked fine with the specific content type.
    How did you create the content type?
    Please check if the content type is added to the list/library the workflow associated with.
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • Customising a SharePoint list content type form - "Manage multiple list items with this form"

    I have designed a form for a content type on an existing SharePoint list.  When I ran the initial wizard, I selected
    Manage multiple list items with this form which is great, exactly what I want.
    But, there are some columns in this content type that I do not want repeating and have them moved them outside of the Repeating Section but I am getting the below error.  I can't seem to find a way to create a new non-repeating group though.  Any
    advice on how to do this?

    *Bump*

  • Pre populate an item with source type="Database Column"

    Hello gurus,
    How can I pre populate an item with source used "Always, replacing any..." and source type="Database Column"?
    I have a form that creates/updates rows in a table and when creating a new row I want to populate some of the fields based on some parameters from the previous page. How can I achieve this?
    I tried adding a conditional process when PK is null and populate the expected fields, but in the browser they are not shown with those values, even if I look into the session I can see that they have the values assigned in the process ?!?!?!
    Thanks in advance,
    Florin

    Florin,
    Use the Default Value item attribute. In you case, set the Default Value Type to Static Text with Session State Substitutions and enter your item using the &P1_ITEM_NAME. syntax in the Default value text box.
    Thanks,
    - Scott -

  • How populate itemrenderer items with data.

    How populate itemrenderer items with data. Ie after my app starts I generate an array collection that I want to assign as the data provider to each combobox in my item renderer, which im using in a datagrid.

    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:mx="library://ns.adobe.com/flex/mx"
                   minWidth="955"
                   minHeight="600">
        <fx:Declarations>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
            <s:ArrayCollection id="booksWithStores">
                <fx:Object name="book1" stores="{new ArrayCollection(['store1','store2'])}"/>
                <fx:Object name="book2" stores="{new ArrayCollection(['store1','store3'])}"/>
                <fx:Object name="book3" stores="{new ArrayCollection(['store2','store3', 'store4'])}"/>
                <fx:Object name="book4" stores="{new ArrayCollection(['store1','store4'])}"/>
            </s:ArrayCollection>
            <s:ArrayCollection id="booksWithoutStores">
                <fx:Object name="bookA"/>
                <fx:Object name="bookB"/>
                <fx:Object name="bookC"/>
                <fx:Object name="bookD"/>
            </s:ArrayCollection>
            <s:ArrayCollection id="allStores">
                <fx:String>store1B</fx:String>
                <fx:String>store2B</fx:String>
                <fx:String>store3B</fx:String>
                <fx:String>store4B</fx:String>
            </s:ArrayCollection>
            <fx:Component id="renderer1" className="Renderer1">
                <s:MXDataGridItemRenderer>
                    <s:DropDownList dataProvider="{data.stores}" />   
                </s:MXDataGridItemRenderer>
            </fx:Component>
            <fx:Component id="renderer2" className="Renderer2">
                <s:MXDataGridItemRenderer>
                    <s:DropDownList dataProvider="{storesList}" />
                    <fx:Script>
                        <![CDATA[
                            import mx.collections.ArrayCollection;
                            [Bindable]
                            public var storesList:ArrayCollection;
                        ]]>
                    </fx:Script>
                </s:MXDataGridItemRenderer>
            </fx:Component>
        </fx:Declarations>
        <mx:Form>
            <mx:FormItem label="Dynamic Stores">
                <mx:DataGrid dataProvider="{booksWithStores}" width="354">
                    <mx:columns>
                        <mx:DataGridColumn dataField="name"/>
                        <mx:DataGridColumn dataField="stores" itemRenderer="{renderer1}"/>
                    </mx:columns>
                </mx:DataGrid>
            </mx:FormItem>
            <mx:FormItem label="Static Stores">
                <mx:DataGrid dataProvider="{booksWithoutStores}" width="354">
                    <mx:columns>
                        <mx:DataGridColumn dataField="name"/>
                        <mx:DataGridColumn dataField="stores" itemRenderer="{createRendererWithProperties(Renderer2, {storesList:allStores})}"/>
                    </mx:columns>
                </mx:DataGrid>
            </mx:FormItem>
        </mx:Form>
        <fx:Script>
            <![CDATA[
                import mx.collections.ArrayCollection;
                public static function createRendererWithProperties(renderer:Class, properties:Object):IFactory
                    var factory:ClassFactory=new ClassFactory(renderer);
                    factory.properties=properties;
                    return factory;
            ]]>
        </fx:Script>
    </s:Application>

  • Deleting a List Item with Very Huge Amount of Versions

    A faulty workflow flooded list items with 50K+ versions on SharePoint List. Attempts to open the list item/delete/edit via SharePoint UI/PowerShell failed! Programmatic iterations to delete versions/items trys to consume complete server memory and
    fails.
    Deleting the complete list is successful, but that results in SharePoint timer jobs fail and places Lots of Block in the database, which stops SharePoint sites from loading.
    Any help please?

    SP 2010 and 2013 support a max of 50,000 versions. Accessing more than 5000 items at a time causes SQL Server to escalate from row locks to table locks, which will generally bring SharePoint to a stop. You will need to write code that can bring back subsets
    of the data, and the only approach I can think of is a CAML query. But, I can't find any examples of working with versions using CAML.
    You could just change the Throttling settings in Central Admin from the default of 5000 to 50000 and then run your code during off hours.
    Mike Smith TechTrainingNotes.blogspot.com
    Books:
    SharePoint 2007 2010 Customization for the Site Owner,
    SharePoint 2010 Security for the Site Owner

  • Populating list item with a record group

    I'm trying to populate a list item (TList) with a Record group with a simple query: SELECT FRM_NAME FROM FORM
    In the forms WHEN_VALIDATE_NEW_FORM trigger, I use POPULATE_LIST('FORM_LIST', 'RG_FORM_LIST');
    Am I missing something? I get the error FRM-41334: Invalid record group for list population.

    thanks, i've tried that, but still nothing. I must be doing something simple, but very wrong. I tried with oracle's default scott/tiger schema, created a simple form with a record group with 2 columns, and populating a manually made poplist (populate_list('LIST4', 'RG1'); Still get errors:
    FRM-30191: No list items defined for required poplist.
    List LIST4
    Item: LIST4
    Block: EMP
    Form: MODULE5
    FRM-30085: Unable to adjust form for output.

  • Is it possible to populate list item in TAB CANVAS

    Hi,
    I have two datablock first is master and second is detail (master detail block) I want to populate second datablock fields on the basis of first data block selection (second block is displayed on Tabuler or Grid like canvas) I made list item type data fields on second or Tabuler canvas(detail block) and want to populate this list at run time on WHEN-NEW-BLOCK-INSTANCE trigger, is it possible, if yes what's wrong I am doing because this list population works fine on master block
    (master block with canvas type of FORM).
    Thanks and Regards.
    Khawar
    Message was edited by:
    skhawar03

    Hi,
    Fifty percent of my problem is solved second canvas list item values now populated successfully, but another problem is that it populates when I click second time on a required button, the button and queried items are in same datablock
    the code behind the WHEN-BUTTON-PRESSED trigger button is:
    declare
         exist_chk number:= 0;
    begin
         select count(*) into exist_chk
         from incident
         where ref_no = :incident.ref_no
         and inc_type_code = :incident.inc_type_code;
         IF exist_chk <> 0
              THEN
    SET_RECORD_PROPERTY(:system.cursor_record,'INCIDENT',status,new_status);
    Set_Block_Property('INTERP_DETAIL', ONETIME_WHERE, ' WHERE ref_no ='||:incident.ref_no||' and inc_type_code='||''''||:incident.inc_type_code||'''');
    execute_query;
    else
    display_message('msgbox_stop','No Master Data','First Enter Master Record ');
         end if;
    end;

  • Uploading multiple documents into sharepoint list item with REST in sharepoint 2013 using content editor web part :

    hi ,
    i am trying to upload multiple document files into sharepoint list item. I followed below link for implementaion.
    http://techfindings-prem.blogspot.in/search/label/jquery.multifilejs
    It was working for sharepoint hosted app.
     This complete code is written within content edito web part.
    It was working when i was in root site collection with below change (hard coded the root level url) in code in "UploadFile" function.
    var scriptbase = "http://servername" + "/_layouts/15/";
                console.log(' File size:' + bytes.length);
                $.getScript(scriptbase + "SP.RequestExecutor.js", function () {
                    var createitem = new SP.RequestExecutor("http://servername");
                    createitem.executeAsync({
                        url: "http://servername/sites/cpg/" + "/_api/web/lists/GetByTitle('SalesRecord')/items(" + attachmentitemid + ")/AttachmentFiles/add(FileName='"
    + fileName + "')",
                        method: "POST",
                        binaryStringRequestBody: true,
                        body: binary,
                        success: fsucc,
                        error: ferr,
                        state: "Update"
                    function fsucc(data) {
                        //alert( data.statusText + "\n\n" + data.responseText);
                        console.log(data + ' uploaded successfully');
                        deferred.resolve(data);
                    function ferr(data) {
                        //alert( data.statusText + "\n\n" + data.responseText);
                        console.log(fileName + "not uploaded error");
                        deferred.reject(data);
    But the issue came in picture when i was working with the other site collection instead of root one. The url was like below.
    "http://servername/sites/cpg/". This time i need to be there within "cpg" site collection. 
    Now if i hard code the url as i did above my code gets break here while come to below line
     $.getScript(scriptbase + "SP.RequestExecutor.js", function () {
    I am getting error when i used below code:
    var scriptbase = "http://servername" + "/_layouts/15/";
     $.getScript(scriptbase + "SP.RequestExecutor.js", function () {
                    var createitem = new SP.RequestExecutor("http://servername");
                    createitem.executeAsync({
                        url: "http://servername/sites/cpg/" + "/_api/web/lists/GetByTitle('SalesRecord')/items(" + attachmentitemid + ")/AttachmentFiles/add(FileName='"
    + fileName + "')",
                        method: "POST",
                        binaryStringRequestBody: true,
                        body: binary,
                        success: fsucc,
                        error: ferr,
                        state: "Update"
                    function fsucc(data) {
                        //alert( data.statusText + "\n\n" + data.responseText);
                        console.log(data + ' uploaded successfully');
                        deferred.resolve(data);
                    function ferr(data) {
                        //alert( data.statusText + "\n\n" + data.responseText);
                        console.log(fileName + "not uploaded error");
                        deferred.reject(data);
    Please hekp in this case. This complete code is written within content edito web part. 
    Regards:
    Sanjay Joshi

    Hi,
    According to your post, my understanding is that you have an issue about upload multiple documents files into library vai REST API.
    As you have said, you have used the hard code url in your code.
    How about use the _spPageContextInfo.webAbsoluteUrl method to get the url?
    I have used this method to get the url, then use the code in the article you have pasted within a content editor web part to upload the files.
    You can replace the hard code url with the _spPageContextInfo.webAbsoluteUrl method, then check whether it works.
    Thanks,
    Jason
    Jason Guo
    TechNet Community Support

Maybe you are looking for