Welcome to Clarion Community Sign in | Join | Faq

Clarion Language and Runtime Library

Started by GMAN at 09-23-2008 6:17 AM. Topic has 4 replies.

Print Search
Sort Posts:    
   09-23-2008, 6:17 AM
GMAN is not online. Last active: 10/24/2008 1:10:56 AM GMAN

Top 10 Posts
Joined on 05-02-2007
Posts 53
Calling Update Form without a browse
Reply Quote
I am trying to open a form in edit mode without a browse being open and the procedure GPFs when the form is called. Any ideas on why this code doesn't work?

IS1:Issue1Number = Par:RECORD_IDENTIFIER
!IS1:Issue1Number = 24
!MESSAGE('IS1:Issue1Number = ' & IS1:Issue1Number & '|' & 'Par:RECORD_IDENTIFIER = ' & Par:RECORD_IDENTIFIER)
SET(IS1:Issue1Link,IS1:Issue1Link)
NEXT(Issues1)
GlobalRequest = ChangeRecord
UpdateIssues1


The MESSAGE statement (when uncommented) shows the correct values for the variables.
   Report 
   09-23-2008, 6:35 AM
Tony Tetley is not online. Last active: 11/20/2008 1:04:35 PM Tony Tetley



Top 10 Posts
Joined on 10-25-2005
Missouri, USA
Posts 80
Re: Calling Update Form without a browse
Reply Quote
add an IF ERRORCODE() after the NEXT() to see you you are actually getting a record.

HTH,

Tony

   Report 
   09-23-2008, 6:55 AM
GMAN is not online. Last active: 10/24/2008 1:10:56 AM GMAN

Top 10 Posts
Joined on 05-02-2007
Posts 53
Re: Calling Update Form without a browse
Reply Quote
well, duuhhh. Thanks Tony. It's not looking for the correct record. Shoulda thought of this myself. :)

OK, now it's finding the correct record (no ERRORCODE()), but I am still getting a GPF.

The Issue1Link key is an ascending key only containing the field Issue1Number.
   Report 
   09-23-2008, 12:13 PM
johannesb is not online. Last active: 10/19/2008 10:18:42 PM johannesb

Top 50 Posts
Joined on 02-07-2006
Posts 12
Re: Calling Update Form without a browse
Reply Quote
Here is how I did this (ABC)..

Call the form:
UpdateIssues1( Par:RECORD_IDENTIFIER )

In the form UpdateIssues1:
Prototype the Par:RECORD_IDENTIFIER as eg. ( LONG PR:RI )

Local variable: LOC:Open   Byte

Local object - Window Manager - Init - 1800
  IF Access:Issues1.Open() <> Level:Benign
    Return Level:Notify
  END
  LOC:Open = 1
  Access:Issues1.UseFile()
    GlobalRequest = ChangeRecord
    IS1:Issue1Number = PR:RI            
    Set(IS1:Issue1Link,IS1:Issue1Link)
    Access:Issues1.Next()
  END

Local object - Window Manager - Kill - 7501
IF LOC:Open
  Access:Issues1.Close()
END



   Report 
   09-24-2008, 5:56 AM
Tony Tetley is not online. Last active: 11/20/2008 1:04:35 PM Tony Tetley



Top 10 Posts
Joined on 10-25-2005
Missouri, USA
Posts 80
Re: Calling Update Form without a browse
Reply Quote
If this is a standard ABC wizard generated form, I would put my record access in the calling procedure:
...snip
Access:Issues1.Next()
...snip
GlobalRequest = ChangeRecord
UpdateIssues1()   

No embed code needed in the form procedure.  The form assumes the record is already in the buffer.  I have done this without any problems.

HTH,

Tony

   Report 
Clarion Communi... » Clarion » Clarion Languag... » Re: Calling Update Form without a browse

Powered by Community Server, by Telligent Systems