Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Object not found Calling another form

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

  • Object not found Calling another form

    This problem has been driving us crazy for the last few days. If we are in one form, then either click on a button or click on a toolbar choice to open another form based on the information in the current form, we are getting a message stating "Field not found", then the error message appears as attached.

    Code to call the form is below

    Code:
    DIM MEDNO AS C
    DIM SSN AS C
    MEDNO=MEDICAID->MEDICAIDNO
    SSN=MEDICAID->SSN
    
    debug(1)
    
    DIM clcs AS C
    DIM choose AS C
    clcs = TABLE.external_record_content_get("ABDELIG","dtoc(Edate)+' '+MEDNO","","MEDNO="+QUOTE(MEDNO))
    cnt = line_count(clcs)
    delete a_clcs
    dim a_clcs[cnt] as C
    
    DIM SHARED choose as C
    DIM SHARED varC_result as C
    a_clcs.initialize(clcs)
    ok_button_label = "&OK"
    cancel_button_label = "&Cancel"
    varC_result = ui_dlg_box("Choose Calculation to Print",<<%dlg%
    {region}
    [.40,5choose^#a_clcs];
    {endregion};
    {line=1,0};
    {region}
    <*15=ok_button_label!OK> <15=cancel_button_label!CANCEL>
    {endregion};
    %dlg%)
    
    'choose = ui_get_list("Choose Calculation to Print",word(clcs,1,","),clcs)
    
    dim global tdyclc as c
    tdyclc=REMSPECIAL(word(choose,1)+SSN+MEDNO)
    TRACELN("TDYCLC = "+TDYCLC)
    
    'DIM Shared varP_THIS_ELIGIBILITY_SCREEN as P
    'DIM layout_name as c 
    'layout_name = "THIS ELIGIBILITY SCREEN"
    
    [COLOR="Red"]Form.view("THIS ELIGIBILITY SCREEN")[/COLOR]
    
    debug(0)

    The error message appears on the "Form.view".

    This is a problem that showed up in a version 6 discussion, but we can't seem to find any other instance of the form. We thought it was the toolbar, but even after removing it, the error still occurs.

    Any ideas???

    Tom
    Last edited by Tom Henkel; 04-08-2009, 12:00 PM. Reason: can't type

  • #2
    Re: Object not found Calling another form

    Edit: Ignore - bad idea
    Tim Kiebert
    Eagle Creek Citrus
    A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

    Comment


    • #3
      Re: Object not found Calling another form

      Tom:
      This script is not the whole script.
      There is something obviously wrong with this script but before even getting into that, can you post either the entire script or better a sample of the db.

      Not sure what do you mean by:
      This is a problem that showed up in a version 6 discussion
      ?

      Comment


      • #4
        Re: Object not found Calling another form

        Actually, this is the whole script. We set a few variables, and in the on_init of the next form, we use the variables to filter or view.

        here is the link to the ver6 issue.

        http://msgboard.alphasoftware.com/al...ad.php?t=55878

        Tom

        Comment


        • #5
          Re: Object not found Calling another form

          OK Tom.. you wouldn't get an argument from me but the error refers to line 101. Your script does not have this many lines that's unless the original script has a lot of blank lines.

          Assuming it does not have any more blank lines than the one you posted and your are getting an error referring to line 101 then the logical explanation is that your form is corrupted.

          Well, is this the same exact scrip, bullets and blanks?

          Comment


          • #6
            Re: Object not found Calling another form

            Any recent changes to the OnInit script in the called form? I'm wondering if possibly the error is being thrown there, but reported for the calling form since the called form never opens?

            Comment


            • #7
              Re: Object not found Calling another form

              OK, you got me. The error message is from when we use the toolbar code to call the form, so that is why we get line 101. The error occurs on the form.view in either script. The included script is code we put under a button on the form for easier access when trying to edit the code.

              here is the code for the line 101 error:

              Code:
              'Date Created: 17-Nov-2003 11:55:30 AM
              'Last Updated: 16-Dec-2005 08:27:36 AM
              'Created By  :
              'Updated By  : 
              DIM SHARED MEDNO AS C
              DIM SHARED SSN AS C
              dim shared A_DB_CURRENT_PATH as c
              dim _DB_NAME as c
              dim shared access as N
              DIM SHARED tdyclc AS C
              dim shared clcs[200] as c
              dim shared i as n
              for i = 1 to 200
              	clcs[i] = ""
              next i
              MEDNO=MEDICAID->MEDICAIDNO
              SSN=MEDICAID->SSN
              'card_resynch()
              'Refresh data in Form 'ELIGMAIN' at parent level.
              DIM object_name as C
              object_name = ":"+"ELIGMAIN"
              DIM varP_Object as p
              'Get a pointer to the specified object
              varP_Object = obj(object_name)
              'Check if the specified object exists
              if .not. is_object(varP_Object) then 
              	ui_msg_box("Error","The object '"+object_name+"' does not exist.",ui_stop_symbol)
              else
              	'Can only resynch data in View mode, so save record first to be sure that layout is in View mode.
              	varP_Object.Commit()
              	varP_Object.Resynch()
              	varP_Object.Refresh_Layout()
              end if
              
              debug(0)
              clc=TABLE.OPEN("ABDELIG.dbf")
              CLC.index_primary_put("MEDNO")
              found=CLC.fetch_find(MEDNO)
              	if found>0
              				i=1
              	else 
              		ui_msg_box("NO INCOME CALCULATION FOUND FOR THIS CLIENT","ENDED BY SYSTEM")
              			GOTO THEEND
              	end if
              		while .not. CLC.fetch_eof()
              				if MEDNO  = ABDELIG->MEDNO
              					traceln(str(i,2,0)+" MEDNO = "+MEDNO)
              							clcs[i] = dtoc(ABDELIG->Edate)+" "+MEDNO
              							'sys_send_keys("{F9}",3000)
              				end if
              				nxt:
              				CLC.fetch_next()
              				i=i+1
              		end while
              					CLCS.SORT("D","SUBSTR(VALUE,7,4)+SUBSTR(VALUE,1,2)+SUBSTR(VALUE,4,2)")
              					choose = ui_get_list_array("Choose Calculation to Print",1,"clcs")
              															
              								if alltrim(remspecial(choose))="" then
              									'cancelled
              									ui_msg_box("PROGRAM WILL STOP","NO CALCS OR USER CANCELLED!")
              										CLC.close()
              											end
              								else
              									'VIEWIT
              								end if
              VIEWIT:
              CLC.index_primary_put("ENTODAY")
              tdyclc=REMSPECIAL(word(choose,1)+SSN+MEDNO)
              TRACELN("TDYCLC = "+TDYCLC)
              		'
              		query.filter = "tdyclc=ALLTRIM(REMSPECIAL(DTOC(ABDELIG->EDATE)))+REMSPECIAL(ABDELIG->SSN)+REMSPECIAL(ABDELIG->MEDNO)"
              		query.order = "recno()"
              		
              		
              		'Open the layout_type showing just the records that satisfy the filter
              		DIM Shared varP_THIS_ELIGIBILITY_SCREEN as P
              		DIM layout_name as c 
              		layout_name = "THIS ELIGIBILITY SCREEN"
              		
              		
              		dim tempP as p
              		'Get pointer to existing window. In case layout_name is qualified with a dictionary name, extract up to first @. In case formname has spaces, normalize it
              		tempP=obj(":"+object_name_normalize(word(layout_name,1,"@")))
              		'Test if pointer is valid
              		if is_object(tempP) then 
              			'Test if pointer refers to a form or browse
              			if tempP.class() = "form" .or. tempP.class() = "browse" then 
              				'Apply the query to the form or browse as the Base query. (this means that 
              				'the user cannot turn the query off, only add to the query)
              				tempP.BaseQueryRun(query.filter,query.order)
              				'then activate the already open window
              				tempP.activate()
              			else
              				'Window is not already open, so open it
              				varP_THIS_ELIGIBILITY_SCREEN = :Form.viewqueried(layout_name,query.filter, query.order )
              		
              			end if
              		else 
              			varP_THIS_ELIGIBILITY_SCREEN = :Form.viewqueried(layout_name,query.filter, query.order )
              		
              		end if
              
              THEEND:
              CLC.close()
              end

              ... by the way, this works fine in version 5.
              Tom

              Comment


              • #8
                Re: Object not found Calling another form

                Tom,
                No, we checked and there is no script under the on_init.

                I was wrong, before, the filtering is in the form properties, not in the on_init.

                Tom

                Comment


                • #9
                  Re: Object not found Calling another form

                  Tom, line numbers would help <grin>.

                  Your toolbar script calls the form with filter and order arguments that are omitted from the first script you posted. This now makes me think your query.filter is wrong. Form.view() and Form.viewqueried() are two very different things.

                  Comment


                  • #10
                    Re: Object not found Calling another form

                    You are right, Tom.

                    I am messing up by switching between ver5 and ver 9. the previous script was from ver5. The one included here is the one in ver 9 that is on the toolbar. Sorry

                    Code:
                    'Date Created: 17-Nov-2003 11:55:30 AM
                    'Last Updated: 08-Apr-2009 09:05:43 AM
                    'Created By  :
                    'Updated By  : George Kenny
                    DIM SHARED MEDNO AS C
                    DIM SHARED SSN AS C
                    dim shared A_DB_CURRENT_PATH as c
                    dim _DB_NAME as c
                    dim shared access as N
                    DIM SHARED tdyclc AS C
                    dim shared clcs[200] as c
                    dim shared i as n
                    for i = 1 to 200
                    	clcs[i] = ""
                    next i
                    MEDNO=MEDICAID->MEDICAIDNO
                    SSN=MEDICAID->SSN
                    'card_resynch()
                    'Refresh data in Form 'ELIGMAIN' at parent level.
                    DIM object_name as C
                    object_name = ":"+"ELIGMAIN"
                    DIM varP_Object as p
                    'Get a pointer to the specified object
                    varP_Object = obj(object_name)
                    'Check if the specified object exists
                    if .not. is_object(varP_Object) then 
                    	ui_msg_box("Error","The object '"+object_name+"' does not exist.",ui_stop_symbol)
                    else
                    	'Can only resynch data in View mode, so save record first to be sure that layout is in View mode.
                    	varP_Object.Commit()
                    	varP_Object.Resynch()
                    	varP_Object.Refresh_Layout()
                    end if
                    
                    debug(0)
                    clc=TABLE.OPEN("ABDELIG.dbf")
                    CLC.index_primary_put("MEDNO")
                    found=CLC.fetch_find(MEDNO)
                    	if found>0
                    				i=1
                    	else 
                    		ui_msg_box("NO INCOME CALCULATION FOUND FOR THIS CLIENT","ENDED BY SYSTEM")
                    			GOTO THEEND
                    	end if
                    		while .not. CLC.fetch_eof()
                    				if MEDNO  = ABDELIG->MEDNO
                    					traceln(str(i,2,0)+" MEDNO = "+MEDNO)
                    							clcs[i] = dtoc(ABDELIG->Edate)+" "+MEDNO
                    							'sys_send_keys("{F9}",3000)
                    				else
                    					'get out of loop
                    					goto getout			
                    				end if
                    				nxt:
                    				CLC.fetch_next()
                    				i=i+1
                    		end while
                    		getout:
                    					CLCS.SORT("D","SUBSTR(VALUE,7,4)+SUBSTR(VALUE,1,2)+SUBSTR(VALUE,4,2)")
                    					choose = ui_get_list_array("Choose Calculation to Print",1,"clcs")
                    															
                    								if alltrim(remspecial(choose))="" then
                    									'cancelled
                    									ui_msg_box("PROGRAM WILL STOP","NO CALCS OR USER CANCELLED!")
                    										CLC.close()
                    											end
                    								else
                    									'VIEWIT
                    								end if
                    VIEWIT:
                    dim global tdyclc as c
                    CLC.index_primary_put("ENTODAY")
                    tdyclc=REMSPECIAL(word(choose,1)+SSN+MEDNO)
                    TRACELN("TDYCLC = "+TDYCLC)
                    ''
                    		'
                    		'query.filter = "tdyclc=ALLTRIM(REMSPECIAL(DTOC(ABDELIG->EDATE)))+REMSPECIAL(ABDELIG->SSN)+REMSPECIAL(ABDELIG->MEDNO)"
                    		'query.order = "recno()"
                    		'
                    
                    		'Open the layout_type showing just the records that satisfy the filter
                    		DIM Shared varP_THIS_ELIGIBILITY_SCREEN as P
                    		DIM layout_name as c 
                    		layout_name = "THIS ELIGIBILITY SCREEN"
                    		
                    		
                    		dim tempP as p
                    		'Get pointer to existing window. In case layout_name is qualified with a dictionary name, extract up to first @. In case formname has spaces, normalize it
                    		tempP=obj(":"+object_name_normalize(word(layout_name,1,"@")))
                    		'Test if pointer is valid
                    		if is_object(tempP) then 
                    			'Test if pointer refers to a form or browse
                    			if tempP.class() = "form" .or. tempP.class() = "browse" then 
                    				'Apply the query to the form or browse as the Base query. (this means that 
                    				'the user cannot turn the query off, only add to the query)
                    				tempP.BaseQueryRun(query.filter,query.order)
                    				'then activate the already open window
                    				tempP.activate()
                    			else
                    				'Window is not already open, so open it
                    				varP_THIS_ELIGIBILITY_SCREEN = :Form.view(layout_name)
                    		
                    			end if
                    		else 
                    			varP_THIS_ELIGIBILITY_SCREEN = :Form.view(layout_name)
                    		
                    		end if
                    
                    THEEND:
                    CLC.close()
                    end
                    All we're trying to do is to make sure that things that worked in ver 5 still work in ver 9. We had some problems with the formviewqueried, so on some of the form calls, we set a filter on the form properties, which aleviated the issue. So far, it hasn't been the easiest...

                    Tom

                    Comment


                    • #11
                      Re: Object not found Calling another form

                      Tom H:
                      I am going down your script and here is my first roadblock:
                      dim _DB_NAME as c
                      Not sure how is that supposed to work?
                      A variable name must start with a letter.

                      Comment


                      • #12
                        Re: Object not found Calling another form

                        Here is the second one (not a raodblock though):
                        Code:
                        dim shared clcs[200] as c
                        dim shared i as n
                        for i = 1 to 200
                        	clcs[i] = ""
                        next i
                        OK.. I will be Moe: "What's the big idea?"

                        This "for..next" routine does absolutely nothing.

                        Comment


                        • #13
                          Re: Object not found Calling another form

                          G,

                          that is a carryover from ver5 generated code. I'll bet that we don't even use the variable.

                          Comment


                          • #14
                            Re: Object not found Calling another form

                            G

                            You're responding faster than I can reply.

                            I didn't write that one. It is supposed to make sure the array is clear.

                            It won't hurt anything, just take a fraction of a second longer.

                            Comment


                            • #15
                              Re: Object not found Calling another form

                              Code:
                              MEDNO=MEDICAID->MEDICAIDNO
                              SSN=MEDICAID->SSN
                              If your run the script without the form being open, it will fail.

                              Comment

                              Working...
                              X