Deleting ttTable in BPM Epicor 10

Hello

I have a senario where I need to delete the ttTable record coming.
Eg - In Job Entry, when Part is load and save in Update Post Processing, I need to delete all JobHead attachment which is showing in trace file.
Is there any way we can delete the ttTable record

Thanks

try to set RowMod=‘D’

@Ajay Are these related to JobHead or JobMtl? I have not seen auto population of JobHead attachments, but I have seen auto copy of JobMtl attachments. Anyway I am not aware of a way to stop the attachment mid save without possibly causing other issues, I have a routine that clears bad attachments in Eng WB, so I tweaked that to clear all JobHead on Update, but I can’t test since we don’t do attachments to M Parts. This could also be in a DD post processing on XFileAttch.

/* REMOVE unwanted XfileAttch */

Ice.Diagnostics.Log.WriteEntry("IN Clear Job attachments");

var job = ds.JobHead[0].JobNum;

using (var txScope = IceContext.CreateDefaultTransactionScope())
{  
      
    Ice.Diagnostics.Log.WriteEntry($"In remove attachments {job}");
    foreach (var xaRow in Db.XFileAttch.Where(xa => xa.Company==Session.CompanyID && xa.RelatedToFile=="JobHead" &&
                       xa.RelatedToSchemaName=="Erp" &&  xa.Key1==job))
    {
      
        Ice.Diagnostics.Log.WriteEntry($"clearing  {job}  k1 {xaRow.Key1} k2 {xaRow.Key2} k5 {xaRow.Key5}");
        Db.XFileAttch.Delete(xaRow);
      
    }
txScope.Complete();
}    


Hi Olga,

I am not getting how to get RowMod = D , will it be deleted.
in BPM there is just foreach loop of ttJobHeadAttch n this attchment i need to delete in Post Proceesing from ttJJobHeadAttch

Hi Grey,

I need to delete from tttable and not from Db.XFileRef actually :frowning:

Start over, please state the full problem and the why.

We’ll get you fixed up.

1 Like

If you are in post it is already done, so you have to remove the attachment link as my code does.

Hello

Can we delete rows from EpiDataView records. I have attchment in EpiDataView . I need to delete that so that fresh job attachment i will add it through Store procedure from Part level.

So i am not getting how to delete rows from EpiDataView…is there any way to delete it…

I think you need to go back to the beginning and map this out completely for us.

What exactly are you trying to do, and why?
What is the state of the data when you want to do this, etc.

Hi,

Actually I will try to explain.
For Part Entry every midnight, we run the process which will attach the latest documents. So part will always have latest documents. (we have some internal rule and its fix. nothing will be change in this)

When new job JOB1 is created and part XXX is saved, it will by default bring all attachment from part which we seems its latest.
But may be after some days, that job’s part XXX new attachment is added but in job JOB1 it wont reflect as attachment is loading from part once only in Job Entry when job is create.

So now whenever job is load , i wanted to delete the job default documents (xfileattch) and want to insert latest document as per parts xfileRefNum.

This is what my requirement.
I hope you got it.

Thanks.

The way I see it working would be when loading the job, you catch it in pre-processing.
Delete the attachments for the job, and run the process that attaches files from the part.
Then you let the base take over and everything should flow through.

1 Like