• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

Chrome Developer Tools Showing extraParams but vvin_json not seeing them

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Chrome Developer Tools Showing extraParams but vvin_json not seeing them

    So I have the following set of extraParams being sent from the front-end (copied from Chrome Developer Tools network tab):

    Code:
    pgm:NPMPROCESS
    action:getViewData
    inView:NPM-UPC-GTIN
    filterFields:[{"field":"NPCOMPY"},{"field":"NPPOOL"}]
    filterNPCOMPY:1
    filterNPPOOL:555
    I have the following code in my backend program (NPMPROCESS) to determine which filter fields were specified (these are grid filters):

    Code:
    // prepare vvIn to read json input                      
    clear fieldNames;                                       
    vvIn.variableName = 'filterFields';                     
    vvIn.fieldName = 'field';                               
    vvIn.totalSize = %size(fieldNames:*all);                
    vvIn.elementSize = %size(fieldNames);                   
                                                            
    // get json input and store into array called fieldNames
    numElements = vvIn_JSON(vvIn:%addr(fieldNames));        
                                                            
    // initalize pre-loop values                            
    reset dsINMNPM;                                         
    x = 0;                                                  
    
    // loop through the number of filters supplied by front end
    for x = 1 to numElements;                                  
    
     // code that never executes
    
    endfor;
    For some reason, the code inside the for loop will not execute, and it doesn't always happen but I can get it to repeat executing a series of ajax calls. Is it possible that Chrome Developer Tools is lying? If so, how can you tell? As a side note, I've run this through Test RPG call several times, and I cannot get it to repeat the problem. It always returns a "filtered" data set.

  • #2
    I guess I'd like to see the D specs for that RPG block of code you have there, just to make sure those definitions are correct. Also, have you tried debugging the RPG code? I would be curious to see what all your vvIn values are and the numElements value. I'm assuming you get the problem when numElements is zero, so you could add some code to have an else section that would execute when numElements is zero, then set your debug breakpoint there. Then the program with go to debug only when the problem occurs. From there you can back track to see what values were sent in error, or whatever the problem is.

    Comment

    Working...
    X