Add values to collection through a function

Discussion in 'Free Source Codes' started by Lynch, Dec 2, 2018.

    
  1. Lynch

    Lynch Member


    I've tried to add values to collection through a function... But its not getting added....

    My code snippet looks like
    [Report:myreport]
    Object: Company
    ......
    Repeat:line1:aggrrcoll
    .......
    [System:udf]
    aggrrcoll:aggregate:1002
    ...............
    [Collection:mycoll]
    Type:aggrrcoll:company
    Child of: ##svcurrentcompany
    .............
    (Other udfs used in the repeated lines are "name, mobileno"

    Now in another form
    2 individual field accepts the user input for name and mob number....

    I want this form values to be updated to the collection.....

    I used the following function

    [Function:updatecolls]
    Parameters: v1 and v2 are strings7

    01:Insert collection object:aggrrcoll
    02:set target:aggrrcoll
    03:set value:name:##v1
    04:set value:mobileno:##v2
    05: set target : . .

    This function either not at all evaluating or evaluating but not udating the collection...

    Please somebody enlight me
     


  2. Lynch

    Lynch Member


    This Query was self resolved by changes in the function as to set the target with the collection name, like the following
    [Function:updatecolls]
    Parameters: v1 and v2 are strings7

    01:Insert collection object:aggrrcoll
    02:set target:mycoll
     

    Attached Files:




  3. Good concept sir Thanks for tdl for new knowledge
     



  4. Dear Lynch on your development, data is not fetch instantly,after posting new existing will show on list
     


  5. Jenny

    Jenny Active Member


    Yes santosh ji...is that any idea to data fetch instantly?
     




  6. Devendra_Rawat

    Devendra_Rawat Well-Known Member


    Thanks.. new finding.. I was assuming that aggregate udfs collection can't be updated through Function..
    It will help me a lot..

    Do anyone know how to update existing xml with TDL function ??
     


Share This Page