IT Process Automation

 View Only
  • 1.  Setting table values on an IRF

    Posted Nov 15, 2012 04:41 PM
    Hey all,

    I'm having a little trouble trying to initialize values on an IRF from the process, hoping somebody can give me some tips.

    On my IRF I have a table named 'errors' with three text fields (a,b, and c for simplicity sake). There are no rows added to the table by default.

    From my process I want to add x number of rows and populate each column for each row. I've tried alot of things so far and can't get it working. The only thing I've been able to do so far is set the correct number of rows by setting the length of Form.errors. so basically:

    Form.errors = [];
    Form.errors.push( 1,2,3 );
    Form.errors.push({
    a: 1,
    b: 2,
    c: 3
    });

    var t = newValueMap();
    t.a = 1;
    t.b = 2;
    t.c = 3;
    Form.errors.push(t );

    Will give me three rows but I can't figure out what to push (if anything) onto the array to actually set values. Tried js objects, value maps, strings, numbers, etc, nothing will show up.

    I also thought about using the ca_pam_setTableData function but I think that takes a DTO object as the 'results' param and I'm not sure how i can pass one to the form. Any advice?


  • 2.  RE: Setting table values on an IRF

    Posted Nov 15, 2012 08:57 PM
    Hi,

    You need to pass it an array of valuemaps...

    var arr = [];

    for ( var i = 0; i < 10; i++) {
    var vm = newValueMap();

    vm.a = "test" + i;
    vm.b = "test" + i;
    vm.c = "test" + i;

    arr.push(vm);
    }

    Form.errors = arr;


    TIP: When unsure how to pass values to IRF forms, try the reverse. That is, create an SRF form with a similar field and see the structure of how the field is passed to a process.

    Regards,

    James


  • 3.  RE: Setting table values on an IRF

    Posted Nov 16, 2012 08:58 AM
    Tht worked perfectly. Thanks for the help and the tip.