ShadowFiend - 2009-04-01

There're two types of the problems:

1. Some columns doesn't exist in a specific table.

Sync: AD_PrintFormatItem
Unable to get target result set: SELECT AD_BView_Field_ID,AD_Client_ID,AD_Column_ID,AD_FieldGroup_ID,AD_Org_ID,AD_PrintColor_ID,AD_PrintFont_ID,AD_PrintFormatChild_ID,AD_PrintFormatItem_ID,AD_PrintFormat_ID,AD_PrintGraph_ID,ArcDiameter,BarcodeType,BelowColumn,Created,CreatedBy,FieldAlignmentType,ImageIsAttached,ImageURL,IsActive,IsAscending,IsAveraged,IsCentrallyMaintained,IsCounted,IsDeviationCalc,IsFilledRectangle,IsFixedWidth,IsGroupBy,IsHeightOneLine,IsImageField,IsMaxCalc,IsMinCalc,IsNextLine,IsNextPage,IsOrderBy,IsPageBreak,IsPrinted,IsRelativePosition,IsRunningTotal,IsSetNLPosition,IsSummarized,IsSuppressNull,IsVarianceCalc,LineAlignmentType,LineWidth,MaxHeight,MaxWidth,Name,PrintAreaType,PrintFormatType,PrintName,PrintNameSuffix,RunningTotalLines,SeqNo,ShapeType,SortNo,Updated,UpdatedBy,XPosition,XSpace,YPosition,YSpace FROM AD_PrintFormatItem WHERE AD_PrintFormat_ID = 156 AND Name = 'Tenant' AND AD_Client_ID=0 - java.sql.SQLException: ERROR: function ad_fieldgroup_id() does not exist

2. Cannot delete a record due to the table dependence.

Sync: AD_Workflow
Deleting: AD_Workflow_ID=109(Replication Setup) {AD_Workflow_ID=109}
Deleting: AD_Workflow_ID=125(Process_Allocation) {AD_Workflow_ID=125}
dataRecordDelete SELECT AD_Client_ID,AD_Org_ID,AD_Table_ID,AD_WF_Node_ID,AD_WF_Responsible_ID,AD_WorkflowProcessor_ID,AD_Workflow_ID,AccessLevel,Author,Cost,Created,CreatedBy,Description,DocValueLogic,Duration,DurationLimit,DurationUnit,EntityType,Help,IsActive,IsDefault,IsValid,Name,Priority,PublishStatus,Updated,UpdatedBy,ValidFrom,ValidTo,ValidateWorkflow,Value,Version,WaitingTime,WorkflowType,WorkingTime FROM AD_Workflow WHERE AD_Workflow_ID=125 - java.sql.SQLException: ERROR: update or delete on table "ad_workflow" violates foreign key constraint "fk644_11543" on table "ad_wf_activity"
  Detail: Key (ad_workflow_id)=(125) is still referenced from table "ad_wf_activity".

How do we deal with these two kinds of problems? Thanks