Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Accpac 56 recordgenerate error

Status
Not open for further replies.

Bluejay07

Programmer
Mar 9, 2007
780
CA
Hello,

I haven't had this issue before, however, I am now.
I am receiving an unspecified error when .recordgenerate false is being executed. I read in another post that I should use recordcreate(0) but that didn't work either.

Code:
'OLD COMPOSITIONS
' Compose the views.
'ARBTA.Compose Array(ARTCR)
'ARTCR.Compose Array(ARBTA, ARTCN, ARTCP, ARTCRO, ARTCC)
'ARTCP.Compose Array(ARTCR, ARTCU, ARPOOP)
'ARTCU.Compose Array(ARTCP)
'ARTCN.Compose Array(ARTCR)
'ARPOOP.Compose Array(ARBTA, ARTCR, ARTCN, ARTCP, ARTCU)
'ARTCRO.Compose Array(ARTCR)
'ARTCC.Compose Array(ARTCR)

' Shortened compositions.            
ARBTA.Compose Array(ARTCR)
ARTCR.Compose Array(ARBTA, ARTCN, ARTCP)
ARTCP.Compose Array(ARTCR, ARTCU, ARPOOP)
ARTCU.Compose Array(ARTCP)
ARTCN.Compose Array(ARTCR)
ARPOOP.Compose Array(ARBTA, ARTCR, ARTCN, ARTCP, ARTCU)
            
'Create a batch.
Create_ARBatch
            
' Header.
With ARTCR
   .RecordClear
   .RecordGenerate False

The batch is created without any issues (although it uses .init).
Any suggestions?

If at first you don't succeed, then sky diving wasn't meant for you!
 
Your code pasting is incomplete, and Create_ARBatch is your own function. Did you set the CODEPYMTYP before .RecordGenerate?

Better yet, have you simply tried recording a macro and copying that?
 
It might also be because you changed your compositions from the original set which is correct. Your second set of composition doesn't look right.
 
Thank you for your responses.
@tuba, I am aware that my pasting is incomplete as I only posted the relevant code. I did try to set CODEPYMTYP before .RecordGenerate. It didn't seem to make a difference.
I also did record a macro which didn't use .recordclear and .recordgenerate until the details. I've tried to duplicate it and now I receive the same error on the .insert.

@DjangMan, I have changed the compositions back.

I still haven't made any progress.

If at first you don't succeed, then sky diving wasn't meant for you!
 
Here is my code as is stands based off of the macro and the error messages received. Once again, some part of the code, such as loops and udt information, has been omitted and I have pasted the relevant code.

Perhaps someone might see something that I am overlooking.
Code:
ARBTA.Compose Array(ARTCR)
ARTCR.Compose Array(ARBTA, ARTCN, ARTCP, ARTCRO, ARTCC)
ARTCP.Compose Array(ARTCR, ARTCU, ARPOOP)
ARTCU.Compose Array(ARTCP)
ARTCN.Compose Array(ARTCR)
ARPOOP.Compose Array(ARBTA, ARTCR, ARTCN, ARTCP, ARTCU)
ARTCRO.Compose Array(ARTCR)
ARTCC.Compose Array(ARTCR)

With ARTCR
   .Fields("TEXTRMIT").value = Trim$(m_udtCISHeader(i).EntryDesc)      ' Entry Description
   .Fields("RMITTYPE").value = "5"                         ' Receipt Trans. Type

   ARTCN.Cancel
   .Fields("CODEPYMTYP").PutWithoutVerification ("CA")     ' Batch Type
   .Fields("PROCESSCMD").PutWithoutVerification ("0")      ' Process Command Code
   .Process

   .Fields("IDINVCMTCH").value = Trim$(m_udtCISHeader(i).EntryDesc)     ' Matching Document Number
   .Fields("AMTRMIT").value = m_udtCISHeader(i).TotalAmount             ' Bank Receipt Amount      
   .Fields("CNTBTCH").value = m_lngBatch                                ' Batch number.
End With
               
'Detail.                  
With ARTCN
   .RecordClear
   '.RecordGenerate False
   .RecordCreate 0
                              
  .Fields("CODEPAYM").PutWithoutVerification ("CA")    ' Batch Type
  .Fields("CNTBTCH").value = m_lngBatch
  .Fields("IDACCT").value = m_udtCISDetail(j).GLAccount     ' Account Number.
  .Fields("AMTDISTTC").value = m_udtCISDetail(j).Amount     ' Distribution Amount.
                              
  ARTCR.Fields("TXTRMITREF").value = Trim$(m_udtCISDetail(j).Reference)   ' Entry Reference.
  ARTCR.Fields("IDRMIT").value = Trim$(m_udtCISDetail(j).CheckReceiptNo)  ' Receipt Number.
                              
   .Insert
   .Fields("CNTLINE").PutWithoutVerification ("-1")
End With
            
ARTCN.Read
ARTCR.Insert

If at first you don't succeed, then sky diving wasn't meant for you!
 
Problem Resolved!

Apparently the client sent the wrong specifications. The data was to be entered in GL not AR Misc. Receipts. I believe part of my issues were because I was trying to sent over a $0 amount in AMTRMIT.

If at first you don't succeed, then sky diving wasn't meant for you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top