Oh No! I've Created an Infinite Loop!

You were doing this in a testing environment yeah?

Nate when you have a transaction scope when something happens it reverts all the changes back

Remove the scope and run it again

1 Like

Yes, I am working in Pilot. Unfortunately I canā€™t make any changes to the BPM or the BAQ. (EDIT: Canā€™t save or edit any BAQs!)
I guess I have to get them to reimage live to keep working on this.

What do you mean by remove the scope? Like remove the using statement, and the txScope.Complete?
Thanks!

You can also try doing batches, like use a new scope every X amount of records.
Trying to delete this many with EF and a regular loop could take a while.

Also the delete trigger for XFileAttch already deletes the existing XFileRef, so you could also save some time there.

3 Likes

Correct remove those two things and see if that makes a difference.

2 Likes

If you have the DMT license - you should be able to delete the Records.
You could also use DMT to add the records
It is a three step process.

  1. Add records definining the file links XFileRef - have a key value in one of the fields
  2. Create BAQ to join the Key field to the records you want to link the attachments to and the fileID
  3. Run DMT to load the XFileAttch
1 Like

DMT strikes again! Unfortunately we donā€™t have DMT here. Hence my coding approach!

Dang Nate- DMT is nice. I am not sure how long you have spent coding this action or troubleshootign it, but it could be a good reason to buy DMT.

hourly pay * hours spent coding and troubleshooting V.S. Price of DMT license.

This BAQ Seems to be the one! This BAQ inserts records into the XFileRef and XFileAttch tables. It links them to the part lot table. Only lots with some on hand quantity are used. You must setup the document type ā€œcertā€ first. You must also load at least one cert attachment manually in Lot Entry like you normally would. The code uses this first entry to help populate the fields for the rest.

Once those bits are in place, this code loops through all the rows in the BAQ, then it uses that data to create a file link. It assumes your files are named the same as you lot number, and has a .pdf extension. It also assumes that your lot numbers begin with ā€˜VAā€™. You can set this inside the BAQ.

At the end, I automatically created about 2000 attachment links in just a few seconds. It even creates links for files that donā€™t exist. For example, on lot VA12345, we have data in Epicor, but VA12345.pdf doesnā€™t exist. Either we never scanned it, or it was named incorrectly. When you try to open the link in Epicor, you get a file not found error. This tells the end user that the cert isnā€™t available. They could look it up and fix it here if they are able.

Thank you all for your help getting this sorted out. And thanks to Epicor Support staff for cleaning up my messes!

You should still be careful running this code on your end. The widgets for a stepwise update are still in the BPM. So switch over the order of the widgets so it doesnā€™t run wide open the first time. Also, use the condition blocks to set reasonable breakpoints. I set it to stop after creating 5000 records, which was well over my needed amount.

We may end up running this on a process schedule so that new links are added as they become available. I appreciate any further feedback.
ImportCerts.baq (101.2 KB)

Thanks!!
Nate

FYI - Epicor Support says that this approach is ā€œunsupported and may/will violate oneā€™s maintenance agreement with Epicorā€.

1 Like

Said what approach? Your BPM?

Yep. It was in response to asking them to give me any kind of information on the server error. They gave no information, and basically shut down any attempt to automate data entry without going through them. I am ready to give up on Epicorā€¦

Well, no. They are not open to this particular method of solving the problem, and quite frankly, I see their point.

Letā€™s step back a minute and ask,

ā€œWhat business problem are you trying to solve?ā€

From the outside, it seems like getting certs attached to lots is an issue. The UBAQ is a batch solution that creates links whether or not the document exists. Doesnā€™t solve the problem of missing certs though. :thinking:

Letā€™s say the company institutes a policy that says, ā€œAll material certs must be scanned and attached within 48 hours of receipt.ā€

Thereā€™s your business problem. The first concern might be, ā€œHow many bins donā€™t have certs? And of those, how many are more than 48 hours old?ā€ This could be a BAQ which could be displayed on the Home page of a user to get the problem in their face. And it stays there until resolved - unlike email for example.

The next concern might be, ā€œHow can I efficiently maintain the links to scanned certs?ā€ There are two places to attack this: at the time of scanning and at some point afterwards. Iā€™m not sure where your repository of scans is located, but maybe thereā€™s any opportunity at upload to call Epicor to link it. Afterwards, one might create a BAQ to download the current links. Use this file to check that the link is still valid as they can be broken overtime and also look for missing links and add those when needed.

And there are other thoughts like having a web app that aids in scanning and uploading certs as well as other attachments that could work. These are less risky than the UBAQ approach and wouldnā€™t require this notice:

Having said thatā€¦

ā€¦this is still a big gap for SaaS. Monitoring and observability is one of the pillars of DevOps and is sorely missing for Epicor SaaS. (I put all my DevOps thoughts, including monitoring, into one Epicor Idea to save your votes! :wink: )

2 Likes

It sounds like the biggest headache here is the lack of control over your environment. If you plan to tweaking your environment in more advanced ways, you may wish to be the host. This was always a first question we asked when customers expressed interest in Epicorā€™s cloud when working in consulting.

Epicor will never support custom code and for decent enough reasons. So, being under their control isnā€™t a benefit when wanting to customize extensively.

2 Likes

Based on the topic title, I thought the biggest headache here was lack of control of an updatable BAQ. :thinking:

Now this is getting a bit off topic, and this is just me, but I think the over-tweaking and advanced customizations can lead to the creation of pets, snowflakes, or otherwise difficult to maintain systems. There are A LOT of companies looking at Kinetic, then looking back at their customizations, then back at Kinetic, and wonder how in the world are they going to get there? The constraints on the SaaS users has reduced this burden of moving forward - other than the instability of a new UI of course. For those who can show restraint in their solutions will also reap the rewards of treating their ERP system as cattle instead of creating pets that need a lot of love and care. Those who have read The Unicorn Project (or The Phoenix Project) understand the importance of being able to bring rapid flexibility to systems in a company and the path is to reduce the number of Pets in your shop as much as possible. Hereā€™s a good article that explores the balance:

Pets vs Cattle 2.0: An Analogy and Approach for Modern Infrastructures ā€“ ERP Today

4 Likes

Yes, of course the base issue is the UBAQ, but it really seems that their inability to recycle the server or view logs without a ticket makes this a high friction process.

Absolutely the answer shouldnā€™t always be custom development, but Epicor also doesnā€™t check every box, and as a product, Epicor understands this and provides tooling to remedy. SaaS is a perfect solution for many companies, it just does not appear to be here, where advanced tooling is being developed with little server insight.

Sorry if this is off topic, I perhaps think this conversation is still on it though. Markā€™s points should be very well considered, as they are absolutely correct when considering new projects. Just seems that sometimes business requirements get in the way of reducing complexity, especially when a project could stand to save hundreds or thousands of man-hours. Itā€™s certainly a balancing act.

2 Likes

Absolutely!

1 Like