Auto-Attaching from one table to another

My brother does our Service Connects, but is out of the office today.  I’m sure he would be willing to share.  I’ll have him send you a note off-line.

 

Brenda

 

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Thursday, November 05, 2015 11:19 AM
To: vantage
Subject: Re: [Vantage] Auto-Attaching from one table to another

 

 

Brenda, I was trying to attach to the same reference # instead of creating a new one, maybe this is the issue as I'm trying to attach a Part record to the Quote folder.  The XFileRef will point to Part and I was hoping to keep it there instead of making copies of files every time.

 

Would you be willing to share your service connect workflow?  Maybe that's the way I should approach it instead?


Ken Williams
Vice President, Administrative Services
Intermountain Electronics - Power, Automation, and Process Systems
Office: 435-613-4817 |  Mobile: 801-918-7318
kwilliams@...www.ie-corp.com

 

On Thu, Nov 5, 2015 at 9:06 AM, brenda mohr brenda@... [vantage] <vantage@yahoogroups.com> wrote:

 

Have you also made a copy of the actual file in the new folder?

 

We do most of our attaching via Service Connect, but I do have to make a copy of the file in the correct directory first.  IE Server\Epicor\10\InvcHead\*.pdf

 

Below is a BPM I used in E9  to make sure there is an attachment before I allow an invoice to be approved.  Hopefully it can give you some insight.

 

v  Directive Name:  (30) A2I_wSEC

 

Ø  Conditions: 

 

the ttInvcHead.CheckBox01 field has been changed from false to true

And            number of rows in the 'FindAttach' query is less than 1

‘FindAttach’:  FOR EACH ttInvcHead no-lock  ,  each XFileAttch no-lock  where (ttInvcHead.ShortChar04 = XFileAttch.Key1 ) and  XFileAttch.RelatedToFile = 'InvcHead'  ,  each XFileRef no-lock  where (XFileAttch.Company = XFileRef.Company and XFileAttch.XFileRefNum = XFileRef.XFileRefNum ) and  XFileRef.DocTypeID = 'SIGNPACK' .

 

Ø  Actions:  Raise Exception: “Invoices may NOT be approved without a signed Packing Slip. 

Please attach the signed Packing Slip to this Invoice (<InvcHeadNum/>) before approving. 

 

Brenda

 

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Thursday, November 05, 2015 10:17 AM
To: vantage
Subject: [Vantage] Auto-Attaching from one table to another

 

 

We'd like to be able to auto-pull through attachments from one table to another.

 

For example, if we have an attachment in Part Entry, we'd like to pull that attachment through to QuoteMtl or JobMtl when added.  We have a few other examples, but you get the idea.

 

Looking at the reference tables, this should be relatively simple.  The XFileRef stores the file location, while the XFileAttch stores the record the attachment is attached to.  In the Part to QuoteMtl example I should be able to do this from a BPM:

·  Find XFileAttch record for the Part where RelatedToFile = Part and Key1 = PartNum, note the XFileRefNum (this is the cross for the XFileRef table)

·  Create a new XFileAttch record for the QuoteMtl where RelatedToFile = QuoteMtl, Key1 = QuoteNum, Key2=QuoteLine, Key3=AssemblySeq, Key4=MtlSeq

Unfortunately, when I try to create the new XFileAttch record, I get 4GL errors.  I get these regardless of how "simple" I try to make it - here's forced code with no lookups that fails:

 

for each ttQuoteMtl.

 

{lib/PublishInfoMsg.i &InfoMsg = "ttQuoteMtl.QuoteNum" }

 

create XFileAttch.

 

assign XFileAttch.Company = 'iei'.

assign XFileAttch.RelatedToFile = 'QuoteMtl'.

assign XFileAttch.Key1 = '110080'.

assign XFileAttch.Key2 = '1'.

assign XFileAttch.Key3 = '0'.

assign XFileAttch.Key4 = '40'.

assign XFileAttch.XFileRefNum = 368.

 

release XFileAttch.

 

{lib/PublishInfoMsg.i &InfoMsg = "XFileAttch.RelatedToFile" }

 

end.

 

What's interesting, is that this fails with a 4GL error before it even gets to the pop-up message.  If I comment out the creation of the XFileAttch record it doesn't produce a 4GL error.  It seems very specifically to be the create XFileAttch line that causes the 4GL error.

 

I'm hoping I'm doing something stupid here with my create record - even though I've done this in other tables.

 

Anyone more familiar with the XFile records?  Maybe I'm missing another field that needs assignment?  I wouldn't expect a 4GL error though if that were the case?

 


Ken Williams
Vice President, Administrative Services
Intermountain Electronics - Power, Automation, and Process Systems
Office: 435-613-4817 |  Mobile: 801-918-7318
kwilliams@...www.ie-corp.com

 

We'd like to be able to auto-pull through attachments from one table to another.

For example, if we have an attachment in Part Entry, we'd like to pull that attachment through to QuoteMtl or JobMtl when added. We have a few other examples, but you get the idea.

Looking at the reference tables, this should be relatively simple. The XFileRef stores the file location, while the XFileAttch stores the record the attachment is attached to. In the Part to QuoteMtl example I should be able to do this from a BPM:
  • Find XFileAttch record for the Part where RelatedToFile = Part and Key1 = PartNum, note the XFileRefNum (this is the cross for the XFileRef table)
  • Create a new XFileAttch record for the QuoteMtl where RelatedToFile = QuoteMtl, Key1 = QuoteNum, Key2=QuoteLine, Key3=AssemblySeq, Key4=MtlSeq
Unfortunately, when I try to create the new XFileAttch record, I get 4GL errors. I get these regardless of how "simple" I try to make it - here's forced code with no lookups that fails:

for each ttQuoteMtl.

{lib/PublishInfoMsg.i &InfoMsg = "ttQuoteMtl.QuoteNum" }

create XFileAttch.

assign XFileAttch.Company = 'iei'.
assign XFileAttch.RelatedToFile = 'QuoteMtl'.
assign XFileAttch.Key1 = '110080'.
assign XFileAttch.Key2 = '1'.
assign XFileAttch.Key3 = '0'.
assign XFileAttch.Key4 = '40'.
assign XFileAttch.XFileRefNum = 368.

release XFileAttch.

{lib/PublishInfoMsg.i &InfoMsg = "XFileAttch.RelatedToFile" }

end.

What's interesting, is that this fails with a 4GL error before it even gets to the pop-up message. If I comment out the creation of the XFileAttch record it doesn't produce a 4GL error. It seems very specifically to be the create XFileAttch line that causes the 4GL error.

I'm hoping I'm doing something stupid here with my create record - even though I've done this in other tables.

Anyone more familiar with the XFile records? Maybe I'm missing another field that needs assignment? I wouldn't expect a 4GL error though if that were the case?


Ken Williams
Vice President, Administrative Services
Intermountain Electronics - Power, Automation, and Process Systems
Office:Â 435-613-4817Â |Â Â Mobile:Â 801-918-7318
kwilliams@...www.ie-corp.com

Have you also made a copy of the actual file in the new folder?

 

We do most of our attaching via Service Connect, but I do have to make a copy of the file in the correct directory first.  IE Server\Epicor\10\InvcHead\*.pdf

 

Below is a BPM I used in E9  to make sure there is an attachment before I allow an invoice to be approved.  Hopefully it can give you some insight.

 

v  Directive Name:  (30) A2I_wSEC

 

Ø  Conditions: 

 

the ttInvcHead.CheckBox01 field has been changed from false to true

And            number of rows in the 'FindAttach' query is less than 1

‘FindAttach’:  FOR EACH ttInvcHead no-lock  ,  each XFileAttch no-lock  where (ttInvcHead.ShortChar04 = XFileAttch.Key1 ) and  XFileAttch.RelatedToFile = 'InvcHead'  ,  each XFileRef no-lock  where (XFileAttch.Company = XFileRef.Company and XFileAttch.XFileRefNum = XFileRef.XFileRefNum ) and  XFileRef.DocTypeID = 'SIGNPACK' .

 

Ø  Actions:  Raise Exception: “Invoices may NOT be approved without a signed Packing Slip. 

Please attach the signed Packing Slip to this Invoice (<InvcHeadNum/>) before approving. 

 

Brenda

 

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Thursday, November 05, 2015 10:17 AM
To: vantage
Subject: [Vantage] Auto-Attaching from one table to another

 

 

We'd like to be able to auto-pull through attachments from one table to another.

 

For example, if we have an attachment in Part Entry, we'd like to pull that attachment through to QuoteMtl or JobMtl when added.  We have a few other examples, but you get the idea.

 

Looking at the reference tables, this should be relatively simple.  The XFileRef stores the file location, while the XFileAttch stores the record the attachment is attached to.  In the Part to QuoteMtl example I should be able to do this from a BPM:

·  Find XFileAttch record for the Part where RelatedToFile = Part and Key1 = PartNum, note the XFileRefNum (this is the cross for the XFileRef table)

·  Create a new XFileAttch record for the QuoteMtl where RelatedToFile = QuoteMtl, Key1 = QuoteNum, Key2=QuoteLine, Key3=AssemblySeq, Key4=MtlSeq

Unfortunately, when I try to create the new XFileAttch record, I get 4GL errors.  I get these regardless of how "simple" I try to make it - here's forced code with no lookups that fails:

 

for each ttQuoteMtl.

 

{lib/PublishInfoMsg.i &InfoMsg = "ttQuoteMtl.QuoteNum" }

 

create XFileAttch.

 

assign XFileAttch.Company = 'iei'.

assign XFileAttch.RelatedToFile = 'QuoteMtl'.

assign XFileAttch.Key1 = '110080'.

assign XFileAttch.Key2 = '1'.

assign XFileAttch.Key3 = '0'.

assign XFileAttch.Key4 = '40'.

assign XFileAttch.XFileRefNum = 368.

 

release XFileAttch.

 

{lib/PublishInfoMsg.i &InfoMsg = "XFileAttch.RelatedToFile" }

 

end.

 

What's interesting, is that this fails with a 4GL error before it even gets to the pop-up message.  If I comment out the creation of the XFileAttch record it doesn't produce a 4GL error.  It seems very specifically to be the create XFileAttch line that causes the 4GL error.

 

I'm hoping I'm doing something stupid here with my create record - even though I've done this in other tables.

 

Anyone more familiar with the XFile records?  Maybe I'm missing another field that needs assignment?  I wouldn't expect a 4GL error though if that were the case?

 


Ken Williams
Vice President, Administrative Services
Intermountain Electronics - Power, Automation, and Process Systems
Office: 435-613-4817 |  Mobile: 801-918-7318
kwilliams@...www.ie-corp.com

It might also be helpful to know that I set the InvcHead.ShortChar04 field of the changed row to the string(ttInvcHead.InvoiceNum)

 

Brenda

 

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Thursday, November 05, 2015 11:07 AM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] Auto-Attaching from one table to another

 

 

Have you also made a copy of the actual file in the new folder?

 

We do most of our attaching via Service Connect, but I do have to make a copy of the file in the correct directory first.  IE Server\Epicor\10\InvcHead\*.pdf

 

Below is a BPM I used in E9  to make sure there is an attachment before I allow an invoice to be approved.  Hopefully it can give you some insight.

 

v  Directive Name:  (30) A2I_wSEC

 

Ø  Conditions: 

 

the ttInvcHead.CheckBox01 field has been changed from false to true

And            number of rows in the 'FindAttach' query is less than 1

‘FindAttach’:  FOR EACH ttInvcHead no-lock  ,  each XFileAttch no-lock  where (ttInvcHead.ShortChar04 = XFileAttch.Key1 ) and  XFileAttch.RelatedToFile = 'InvcHead'  ,  each XFileRef no-lock  where (XFileAttch.Company = XFileRef.Company and XFileAttch.XFileRefNum = XFileRef.XFileRefNum ) and  XFileRef.DocTypeID = 'SIGNPACK' .

 

Ø  Actions:  Raise Exception: “Invoices may NOT be approved without a signed Packing Slip. 

Please attach the signed Packing Slip to this Invoice (<InvcHeadNum/>) before approving. 

 

Brenda

 

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Thursday, November 05, 2015 10:17 AM
To: vantage
Subject: [Vantage] Auto-Attaching from one table to another

 

 

We'd like to be able to auto-pull through attachments from one table to another.

 

For example, if we have an attachment in Part Entry, we'd like to pull that attachment through to QuoteMtl or JobMtl when added.  We have a few other examples, but you get the idea.

 

Looking at the reference tables, this should be relatively simple.  The XFileRef stores the file location, while the XFileAttch stores the record the attachment is attached to.  In the Part to QuoteMtl example I should be able to do this from a BPM:

·  Find XFileAttch record for the Part where RelatedToFile = Part and Key1 = PartNum, note the XFileRefNum (this is the cross for the XFileRef table)

·  Create a new XFileAttch record for the QuoteMtl where RelatedToFile = QuoteMtl, Key1 = QuoteNum, Key2=QuoteLine, Key3=AssemblySeq, Key4=MtlSeq

Unfortunately, when I try to create the new XFileAttch record, I get 4GL errors.  I get these regardless of how "simple" I try to make it - here's forced code with no lookups that fails:

 

for each ttQuoteMtl.

 

{lib/PublishInfoMsg.i &InfoMsg = "ttQuoteMtl.QuoteNum" }

 

create XFileAttch.

 

assign XFileAttch.Company = 'iei'.

assign XFileAttch.RelatedToFile = 'QuoteMtl'.

assign XFileAttch.Key1 = '110080'.

assign XFileAttch.Key2 = '1'.

assign XFileAttch.Key3 = '0'.

assign XFileAttch.Key4 = '40'.

assign XFileAttch.XFileRefNum = 368.

 

release XFileAttch.

 

{lib/PublishInfoMsg.i &InfoMsg = "XFileAttch.RelatedToFile" }

 

end.

 

What's interesting, is that this fails with a 4GL error before it even gets to the pop-up message.  If I comment out the creation of the XFileAttch record it doesn't produce a 4GL error.  It seems very specifically to be the create XFileAttch line that causes the 4GL error.

 

I'm hoping I'm doing something stupid here with my create record - even though I've done this in other tables.

 

Anyone more familiar with the XFile records?  Maybe I'm missing another field that needs assignment?  I wouldn't expect a 4GL error though if that were the case?

 


Ken Williams
Vice President, Administrative Services
Intermountain Electronics - Power, Automation, and Process Systems
Office: 435-613-4817 |  Mobile: 801-918-7318
kwilliams@...www.ie-corp.com

Brenda, I was trying to attach to the same reference # instead of creating a new one, maybe this is the issue as I'm trying to attach a Part record to the Quote folder. The XFileRef will point to Part and I was hoping to keep it there instead of making copies of files every time.

Would you be willing to share your service connect workflow? Maybe that's the way I should approach it instead?

Ken Williams
Vice President, Administrative Services
Intermountain Electronics - Power, Automation, and Process Systems
Office:Â 435-613-4817Â |Â Â Mobile:Â 801-918-7318
kwilliams@...www.ie-corp.com

On Thu, Nov 5, 2015 at 9:06 AM, brenda mohr brenda@... [vantage] <vantage@yahoogroups.com> wrote:

Â
<div>
  
  
  <p>

Have you also made a copy of the actual file in the new folder?

Â

We do most of our attaching via Service Connect, but I do have to make a copy of the file in the correct directory first. IE Server\Epicor\10\InvcHead\*.pdf

Â

Below is a BPM I used in E9  to make sure there is an attachment before I allow an invoice to be approved. Hopefully it can give you some insight.

Â

v Directive Name: (30) A2I_wSEC

Â

Ø Conditions:Â

Â

the ttInvcHead.CheckBox01 field has been changed from false to true

And           number of rows in the 'FindAttach' query is less than 1

‘FindAttach’: FOR EACH ttInvcHead no-lock , each XFileAttch no-lock where (ttInvcHead.ShortChar04 = XFileAttch.Key1 ) and XFileAttch.RelatedToFile = 'InvcHead' , each XFileRef no-lock where (XFileAttch.Company = XFileRef.Company and XFileAttch.XFileRefNum = XFileRef.XFileRefNum ) and XFileRef.DocTypeID = 'SIGNPACK' .

Â

Ø Actions: Raise Exception: “Invoices may NOT be approved without a signed Packing Slip.Â

Please attach the signed Packing Slip to this Invoice (<InvcHeadNum/>) before approving.Â

Â

Brenda

Â

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Thursday, November 05, 2015 10:17 AM
To: vantage
Subject: [Vantage] Auto-Attaching from one table to another

Â

Â

We'd like to be able to auto-pull through attachments from one table to another.

Â

For example, if we have an attachment in Part Entry, we'd like to pull that attachment through to QuoteMtl or JobMtl when added. We have a few other examples, but you get the idea.

Â

Looking at the reference tables, this should be relatively simple. The XFileRef stores the file location, while the XFileAttch stores the record the attachment is attached to. In the Part to QuoteMtl example I should be able to do this from a BPM:

· Find XFileAttch record for the Part where RelatedToFile = Part and Key1 = PartNum, note the XFileRefNum (this is the cross for the XFileRef table)

· Create a new XFileAttch record for the QuoteMtl where RelatedToFile = QuoteMtl, Key1 = QuoteNum, Key2=QuoteLine, Key3=AssemblySeq, Key4=MtlSeq

Unfortunately, when I try to create the new XFileAttch record, I get 4GL errors. I get these regardless of how "simple" I try to make it - here's forced code with no lookups that fails:

Â

for each ttQuoteMtl.

Â

{lib/PublishInfoMsg.i &InfoMsg = "ttQuoteMtl.QuoteNum" }

Â

create XFileAttch.

Â

assign XFileAttch.Company = 'iei'.

assign XFileAttch.RelatedToFile = 'QuoteMtl'.

assign XFileAttch.Key1 = '110080'.

assign XFileAttch.Key2 = '1'.

assign XFileAttch.Key3 = '0'.

assign XFileAttch.Key4 = '40'.

assign XFileAttch.XFileRefNum = 368.

Â

release XFileAttch.

Â

{lib/PublishInfoMsg.i &InfoMsg = "XFileAttch.RelatedToFile" }

Â

end.

Â

What's interesting, is that this fails with a 4GL error before it even gets to the pop-up message. If I comment out the creation of the XFileAttch record it doesn't produce a 4GL error. It seems very specifically to be the create XFileAttch line that causes the 4GL error.

Â

I'm hoping I'm doing something stupid here with my create record - even though I've done this in other tables.

Â

Anyone more familiar with the XFile records? Maybe I'm missing another field that needs assignment? I wouldn't expect a 4GL error though if that were the case?

Â


Ken Williams
Vice President, Administrative Services
Intermountain Electronics - Power, Automation, and Process Systems
Office:Â 435-613-4817Â |Â Â Mobile:Â 801-918-7318
kwilliams@...www.ie-corp.com

</div>
 


<div style="color:#fff;min-height:0;"></div>