AnsweredAssumed Answered

Container Fields Cannot Be Exported - Again

Question asked by RGoyette on Mar 8, 2011
Latest reply on Mar 8, 2011 by philmodjunk

Title

Container Fields Cannot Be Exported - Again

Post

This one keeps coming up.

I have a script to step through a list of records, grab a pdf from an oracle database, place it in a container file, and export the container contents to disk.  So...thirty-one records should produce thirty-one pdf files.  The script:


Set Error Capture [ On ]
Go to Record/Request/Page[ First ]
Loop
     Set Variable [ $prpsl_id; Value:Events::PRPSL_ID ]
     Set Variable [ $bl; Value:"SELECT prpsl_id||'.pdf', STMT_OF_RESCH FROM PRPSL.PROPOSAL where PRPSL_ID =      '"&$prpsl_id&"'" ]
     Import Records [ ODBC Data Source: IPTS; Calculated SQL Text: $bl; Target: “Events”; Method: Update existing;
     Set Field [ Events::gErrorCaptureField; Get ( LastODBCError ) ]
     If [ Events::gErrorCaptureField <> "" ]
          Show Custom Dialog [ Title: "Error Importing Data"; Message: "An error was encountered while attempting to        import the statement of research."&Events::gErrorCaptureField&¶&" Terminating..."; Buttons: “OK” ]
          Halt Script
     End If
     Set Variable [ $fn; Value:"file:SOR"&$prpsl_id&".pdf" ]
     Show Custom Dialog [ Title: $fn; Buttons: “OK” ]
     Export Field Contents [ Events::STMT_OF_RESCH; “$fn” ]
     Pause/Resume Script [ Indefinitely ]
     Commit Records/Requests[ No dialog ]
     Go to Record/Request/Page[ Next; Exit after last ]
End Loop

Note that I have a custom dialog printing out the file name prior to the export, and a pause as well.  What this shows me:

The first two records export without incident.

The third and forth records give me the error (Container fields cannot be exported)

The forth record exports without incident

etc.

Can anyone give me an idea what is going on?

FMPro V 11 for windows.

Outcomes