No announcement yet.

Read the content of a Grid in a php button

  • Filter
  • Time
  • Show
Clear All
new posts

  • Read the content of a Grid in a php button

    I would like to read all the lines of a Grid in a php code (button).

    Is there a global var available ? an array ? in order to do an foreach loop on all the lines ?

    I use to play with the run button, but now I need to call my code for all the lines (More than 100 000 lines).

    Please help me if you know, or give me a piece of code.

    Thank you in advance.


  • #2
    You can work on your grid with the Run button. The Run button has 2 events: OnRecord: Executed on each selected record.
    Image2: PHP Code Interface. OnFinish: Executed after process all selected records.

    Image3:PHP Code Interface

    You can get more information in the Web Help that Scriptcase has and also there is a sample with tutorial in the scriptcase website.

    Hope this helps.


    • #3
      Thank you, but as i said before, i can't use the OnRecord, because OnRecord only works with checked line on a single screen.

      As i have lots off lines, i need to use the OnFinish but i don't know if there is a global $var like an array I could use the parse.

      I saw the tutorial but it's not usable in my case (i need to parse all line of the grid filtered with numbers affinity parameters).

      Have you any other ideas ?


      • #4
        If you need the lines of the current grid then the only way (afaik) is to use onrecord and store the record in a (global) array.
        Albert Drent
        aducom software netherlands
        scriptcase partner, reseller, support and (turn-key) development /


        • #5
          I do not know exactly what you are trying to accomplish but if I would need to work on on all the lines of a grid. like a batch update of a field, I have used stored procedures. I add a PHP button and I call the stored procedures from inside that button.


          • #6
            PHP Code:

            $grid_qry 'SELECT

            if ($sc_where_current) {
            $grid_qry .= ' ' $sc_where_current;

            if (isset(
            $arrmygridcontent[0][0])) {
            // iterate over your grid content.


            Professional Scriptcase Services
            Some Customers opinions