Alpha Video Training
Results 1 to 5 of 5

Thread: Script Error: 'GRID1_GridObj' is undefined

  1. #1
    Member RaEd.'s Avatar
    Real Name
    Paul Atherton
    Join Date
    May 2011
    Location
    St.Helens, England
    Posts
    176

    Default Script Error: 'GRID1_GridObj' is undefined

    I'm trying to put together an action button which sets some field values on my Grid, but it seems like any reference to the Grid component using a placeholder results in this object undefined error, which seems to be suggesting that the Grid doesn't exist

    When I switch to Preview mode I get the following errors -
    error1.jpg
    error2.jpg

    I'm working off've an updatable Grid component with the Form layout which is used exclusively for submitting new records.

    The in-line Javascript on my ActionButton looks like this -
    Code:
    rowNum = {Grid.RowNumber};
    
    {Grid.object}.setValue('G','TARGET',rowNum,'0');
    {Grid.object}.setValue('G','PROSPECTS_NEWAPS',rowNum,'0');
    {Grid.object}.setValue('G','CALLBACKS_NEWAPS',rowNum,'0');
    {Grid.object}.setValue('G','REFERRALS_NEWAPS',rowNum,'0');
    {Grid.object}.setValue('G','APS_THISWEEK',rowNum,'0');
    {Grid.object}.setValue('G','APS_NEXTWEEK',rowNum,'0');
    {Grid.object}.setValue('G','TOTAL_APS_SEEN',rowNum,'0');
    {Grid.object}.setValue('G','TOTAL_APS_SEEN_LEADS',rowNum,'0');
    {Grid.object}.setValue('G','TOTAL_BSNS_SIGNED',rowNum,'0');
    {Grid.object}.setValue('G','BUSINESS_NAME1',rowNum,'');
    {Grid.object}.setValue('G','NO_OF_OUTLETS1',rowNum,'0');
    {Grid.object}.setValue('G','COMMISSION1',rowNum,'0');
    {Grid.object}.setValue('G','BUSINESS_NAME2',rowNum,'');
    {Grid.object}.setValue('G','NO_OF_OUTLETS2',rowNum,'0');
    {Grid.object}.setValue('G','COMMISSION2',rowNum,'0');
    {Grid.object}.setValue('G','BUSINESS_NAME3',rowNum,'');
    {Grid.object}.setValue('G','NO_OF_OUTLETS3',rowNum,'0');
    {Grid.object}.setValue('G','COMMISSION3',rowNum,'0');
    
    {Grid.ComponentName}.setValue('G','SICKNESS',{Grid.RowNumber},true);
    The same error will display even if I just use the first line "rowNum = {Grid.RowNumber};"

    Am I missing something, perhaps specific to this type of Grid? I have other grids that use different layouts which have absolutely no problem referencing the Grid component.

  2. #2
    "Certified" Alphaholic
    Real Name
    Govindan Gandhi
    Join Date
    Aug 2008
    Location
    New York, NY
    Posts
    4,294

    Default Re: Script Error: 'GRID1_GridObj' is undefined

    instead of
    rowNum = {Grid.RowNumber};
    would you try
    var rowNum = (Grid.object}._selectedRow;
    Last edited by GGandhi; 03-10-2014 at 09:47 AM.
    thanks for reading

    gandhi

    version 11 3381 - 4096
    mysql backend
    http://www.alphawebprogramming.blogspot.com
    ggandhi344@gmail.com
    Skype:ggandhi344@gmail.com
    1 914 924 5171

  3. #3
    Member RaEd.'s Avatar
    Real Name
    Paul Atherton
    Join Date
    May 2011
    Location
    St.Helens, England
    Posts
    176

    Default Re: Script Error: 'GRID1_GridObj' is undefined

    Using ._selectedRow to grab the row number seems to be working fine. Weird that {Grid.RowNumber} didn't do the trick.

    Some of the setValue() calls are still producing the error but that'll be down to my bad implementation :P I'll start working on those now.

    Thanks for the quick fix!

  4. #4
    "Certified" Alphaholic Clipper87's Avatar
    Real Name
    Frank
    Join Date
    Dec 2008
    Location
    Antwerp, Belgium
    Posts
    1,891

    Default Re: Script Error: 'GRID1_GridObj' is undefined

    {Grid.RowNumber} cannot be used in a global js function or client side event. The help text clearly indicates this. I'd be curious to see if the errors also produce in Live Preview ?
    Frank

    Tell me and I'll forget; show me and I may remember; involve me and I'll understand

  5. #5
    Moderator Steve Wood's Avatar
    Real Name
    Steve Wood
    Join Date
    Nov 2003
    Location
    Bay Area, California
    Posts
    8,827

    Default Re: Script Error: 'GRID1_GridObj' is undefined

    You rarely see "help text" and "clearly" in the same sentence; but it is there in the event help.

    Confusing because {Grid.RowNumber} is good for anything associated directly with the row (e.g., a button or other controls) but not for the client-side events.
    Steve Wood
    Join the ALPHA DEVELOPERS NETWORK
    There is no Cloud. It's just someone else's computer.
    Web - Mobile - Hosting - Products - Frameworks - Developer Resources
    AlphaToGo | IADN (100% Alpha Anywhere Websites)

Similar Threads

  1. Replies: 1
    Last Post: 11-28-2013, 09:27 PM
  2. Error: Expected ';' and Error: 'GRID1_gridObj' is undefined
    By tomcat in forum Application Server Version 11 - Web/Browser Applications
    Replies: 2
    Last Post: 01-29-2013, 09:28 PM
  3. Error: Line: 907 Error: 'NEWHELP_GridObj' is undefined
    By Atta in forum Application Server Version 11 - Web/Browser Applications
    Replies: 6
    Last Post: 09-11-2012, 01:33 PM
  4. GRID1_GridObj.getValue('D','VALUE'); Not returning Value
    By markmoss in forum Application Server Version 10 - Web/Browser Applications
    Replies: 1
    Last Post: 08-26-2011, 10:27 AM
  5. Error: "Traclist2_GridObj" is undefined
    By twwtc in forum Application Server Version 10 - Web/Browser Applications
    Replies: 2
    Last Post: 10-18-2010, 10:25 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •