Field Indicating the Existence of an Attachment

Here is the Query Phrase for a BAQ

 

for each OrderHed no-lock  where  OrderHed.OpenOrder = true  ,  each OrderRel no-lock  where (OrderHed.Company = OrderRel.Company and OrderHed.OrderNum = OrderRel.OrderNum ) and  OrderRel.Plant = 'DEM' And OrderRel.OpenRelease = True  ,  each XFileAttch no-lock  outer-join where (OrderRel.Company = XFileAttch.Company and OrderRel.PartNum = XFileAttch.Key1 and OrderRel.RevisionNum = XFileAttch.Key2 ) and  XFileAttch.RelatedToFile = 'PartRev' And XFileAttch.Key3 = ''  ,  each XFileRef no-lock  outer-join where (XFileAttch.Company = XFileRef.Company and XFileAttch.XFileRefNum = XFileRef.XFileRefNum ) ,  each Part no-lock  where  Part.ClassID <> 'ABC'  where (OrderRel.Company = Part.Company and OrderRel.PartNum = Part.PartNum ).

 

You can connect Part Rev with XfileAttach

 

Key 1: PartNumber

Key 2: Rev

 

Then connect XfileAttach to XfileREf (Criteria = RelatedToFile = PartRev

 

 

Miguel A. Santillan

Compass Manufacturing Systems

 

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Monday, February 29, 2016 8:11 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Field Indicating the Existence of an Attachment

 

 

We have engineering drawing PDFs attached to our parts via the part revision.  Is it possible to use the PartRev table in a BAQ to identify any parts that currently have no drawing attached to them?  It seems like there should be a field (maybe a checkbox or something) that would indicate whether or not a part revision had an attachment or not.  Or maybe it is possible to pull out the file path of the attachment?  I haven't looked into this a whole lot, but I thought maybe someone out there would know off the top of their head and save me some time.  Otherwise, I will let you'll know what I discover  

Thanks!



Disclaimer

The information contained in this communication from the sender is confidential. It is intended solely for use by the recipient and others authorized to receive it. If you are not the recipient, you are hereby notified that any disclosure, copying, distribution or taking action in relation of the contents of this information is strictly prohibited and may be unlawful.

We have engineering drawing PDFs attached to our parts via the part revision.  Is it possible to use the PartRev table in a BAQ to identify any parts that currently have no drawing attached to them?  It seems like there should be a field (maybe a checkbox or something) that would indicate whether or not a part revision had an attachment or not.  Or maybe it is possible to pull out the file path of the attachment?  I haven't looked into this a whole lot, but I thought maybe someone out there would know off the top of their head and save me some time.  Otherwise, I will let you'll know what I discover  

Thanks!

Here is some code I use in a BPM to verify there is an attached packslip on our invoices before I allow them to approve it.  It should give you an idea of the fields and filters you will need for your BAQ.  BTW  this is an E10 example, but same concept.

 

foreach (var ttInvcHead_Recs in(from ttInvcHead_Row in ttInvcHead

select ttInvcHead_Row))

{

   var ttInvcHeadRow = ttInvcHead_Recs;

 

   foreach (var XFileAttch_Recs in (from XFileAttch_Row in Db.XFileAttch

        where XFileAttch_Row.Key1 == SqlFunctions.StringConvert((double)ttInvcHeadRow.InvoiceNum).Trim()

        && (string.Compare(XFileAttch_Row.RelatedToFile,"InvcHead",true)==0)

        select XFileAttch_Row))

   {

      XFileAttch = XFileAttch_Recs;

      if (XFileAttch != null)

      {

         var XFileRef_Recs = (from XFileRef_Row in Db.XFileRef

                             where XFileRef_Row.Company == Session.CompanyID

                             && XFileRef_Row.XFileRefNum == XFileAttch.XFileRefNum

                             && (string.Compare(XFileRef_Row.DocTypeID,"SIGNPACK",true)==0)

                             select XFileRef_Row).FirstOrDefault();

         {

            XFileRef = XFileRef_Recs;

            if (XFileRef != null)

            {

               callContextBpmData.Checkbox01 = true;

            }

         }

      }

   }

}

 

 

Brenda

 

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Monday, February 29, 2016 11:11 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Field Indicating the Existence of an Attachment

 

 

We have engineering drawing PDFs attached to our parts via the part revision.  Is it possible to use the PartRev table in a BAQ to identify any parts that currently have no drawing attached to them?  It seems like there should be a field (maybe a checkbox or something) that would indicate whether or not a part revision had an attachment or not.  Or maybe it is possible to pull out the file path of the attachment?  I haven't looked into this a whole lot, but I thought maybe someone out there would know off the top of their head and save me some time.  Otherwise, I will let you'll know what I discover  

Thanks!