Hi All, I am moving a set of data from a staging table to a temporary table and I want the prompt validations to happen on the data before entering the temp table.I am using app engine for the copying purpose. Is there a way to find out the rows that doesnt compy with the validations and print them? I tried %ExecuteEdits in the SQL but it just skips the rows. Regards, Richard
Force the return code to True to prevent skipping records. See example
Function EditRecord(&REC As Record) Returns boolean;
Local integer &E;
Local date &datefield;
Local Record &ERR_REC;
Local SQL &ERRSQL;
&ERR_REC = CreateRecord(Record.VI_ACH_BNK_ERR);
&datefield = &REC.GetField(Field.EFFDT).Value;
If None(&datefield) Then
&REC.GetField(Field.EFFDT).Value = %Date;
End-If;
&REC.GetField(Field.PROCESS_INSTANCE).Value =
VI_ACH_BNK_AET.PROCESS_INSTANCE;
&REC.GetField(Field.COUNTRY).Value = VI_ACH_BNK_AET.COUNTRY;
&REC.ExecuteEdits(%Edit_Required + %Edit_DateRange + %Edit_YesNo +
%Edit_PromptTable + %Edit_TranslateTable);
If &REC.IsEditError Then
&REC.CopyFieldsTo(&ERR_REC);
&ERR_REC.DATETIME_STAMP.Value = %Datetime;
&ERR_REC.ERROR_FLAG.Value = “Y”;
For &E = 1 To &REC.FieldCount
&MYFIELD = &REC.GetField(&E);
If &MYFIELD.EditError Then
&MSGNUM = &MYFIELD.MessageNumber;
&MSGSET = &MYFIELD.MessageSetNumber;
&ERR_REC.GetField(Field.ERROR_MESSAGE).Value = &MSGNUM |
&MSGSET | &REC.Name | “, Field:” | &MYFIELD.Name;
VI_ACH_BNK_AET.SEQNUM = VI_ACH_BNK_AET.SEQNUM + 1;
&ERR_REC.GetField(Field.SEQNUM).Value =
VI_ACH_BNK_AET.SEQNUM;
&ERR_SQL = CreateSQL(“%Insert(:1)”);
&ERR_SQL.Execute(&ERR_REC);
End-If;
End-For;
/* Return False;
/
Return True; /
Force return to True to prevent skipping records
Return True;
End-If;
End-Function;
Carl J Barbata
Technical Analyst, ERP Systems
Volt Information Sciences
2411 N Glassell St. Orange, CA 92865
t :(714)921-5830
c:(626)826-5409
email:
[email protected]
Change the Return code from %ExecuteEdits from False to True to keep
from skipping the rows. Then u can access all the rows in your temp
table.
Carl J Barbata
Technical Analyst, ERP Systems
Volt Information Sciences
2411 N Glassell St. Orange, CA 92865
t :(714)921-5830
c:(626)826-5409
email:
[email protected]
if u create a file layout and generate an app engine import code from THE FILE LAYOU …THE PROGRAM GENERATED PERFORMS THE ALL THE EDITS …
U CAN MODIFIY IT TO PERFORM UR OWN SET OF VALIDATIONS