[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 556
  • Last Modified:

application error R0002

The following is my powerscript code for a window that generates a report and a graph. I am getting an application error "Null object reference line 11 of w_downtime_reason R0002.



integer      row_count, li_downtime
date            ldt_begin_date, ldt_end_date, temp_date
string      machine_num, setting
st_date_machine      st_date_machine
open( w_calendar_range_response_mach )
st_date_machine = message.powerobjectparm
      tab_1.tabpage_1.dw_1.settransobject( sqlca )
      tab_1.tabpage_1.dw_1.retrieve( ldt_begin_date, ldt_end_date, machine_num, row_count )
      tab_1.tabpage_2.dw_2.settransobject( sqlca )
      tab_1.tabpage_2.dw_2.retrieve( ldt_begin_date, ldt_end_date, machine_num )
ldt_begin_date = st_date_machine.st_begin_date
ldt_end_date = st_date_machine.st_end_date
machine_num = st_date_machine.st_machine_id
if machine_num <> '-1' then
      if ldt_begin_date > 1949-01-01 and ldt_end_date > 1949-01-01 then
      temp_date = ldt_begin_date
      do while temp_date <= ldt_end_date
      select sum(downtime_minutes)  
    into :li_downtime  
    from machine_downtime  
   where ( machine_id = :machine_num ) and  
         ( capture_date = :temp_date );
                  
                  if li_downtime > 10 then
                        row_count++
                  end if

            temp_date =relativedate(temp_date,1)      
      loop      
      
      if ldt_begin_date = ldt_end_date then
            tab_1.tabpage_2.dw_2.object.gr_1.title = machine_num + 'Downtime Category Report between' + string( ldt_begin_date, 'mm-dd-yyyy')
      else
            tab_1.tabpage_2.dw_2.object.gr_1.title = machine_num + 'Downtime Category Report ' + string( ldt_begin_date, 'mm-dd-yyyy') + ' and ' + string( ldt_end_date, 'mm-dd-yyyy')
      end if
      
else
      
end if


            
            
end if

I am unable to figure out what the error is

Thanks
Sushma
0
sushmasriram
Asked:
sushmasriram
  • 4
  • 2
1 Solution
 
tr1l0b1tCommented:
Hi,

Change the name of the variable "st_date_machine" (it has the same name that its classname)
and check if the returned value from popup window is valid :

[...]
st_date_machine    lst_date_machine
open( w_calendar_range_response_mach )
open( w_calendar_range_response_mach )
If IsValid(Message.PowerObjectParm) and Not IsNull(Message.PowerObjectParm) Then
      If ClassName(Message.PowerObjectParm) = 'st_date_machine' Then
            lst_date_machine = message.powerobjectparm
      Else
            MessageBox("Error","Returned object is not valid")
            Return -1
      End If
Else
      MessageBox("Error","Nothing Returned")
      Return -1
End If

// Then, assign values ...
ldt_begin_date = lst_date_machine.st_begin_date
ldt_end_date = lst_date_machine.st_end_date

Hope it helps
Regards
0
 
tr1l0b1tCommented:
Sorry, just one "open( w_calendar_range_response_mach )" is needed !! o:)
0
 
sushmasriramAuthor Commented:
It helped thank you
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
diasroshanCommented:
Hi,

sushma, u have lotsa questions open and i guess u need to close the ones where uve got ur answer...

atleast here im sure uve got what ur lookin for...

so please award tr1l0b1t the deserving points for his efforts...

Cheers,
Rosh
0
 
tr1l0b1tCommented:
thanks :?
0
 
diasroshanCommented:
Hi,

sushma, looks like u did a big goof up here... the points were most deservingly for tr1l0b1t ...

he needs to be awarded the points... im sure its an error here...

sushma can u request the Page Editor to transfer the points to tr1l0b1t ...

Also,
tr1l0b1t  u have any suggestion how this can b brought about... these points are absolutely not mine... i cant have it... please find a solution and post here...

Cheers,
Rosh
0
 
tr1l0b1tCommented:
I guess that sushma (if agree) might post the request, not me.
Anyway, thanks for your comments rosh !
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now