How To: Kinetic - Upload a Client File, Parse, and Display in a Grid

image

@hmwillett I will guess i select Company and then i run tracing to see what is the path generated?

You can also look at what @Epic_Santiago suggested to future-proof your cloud development by using the new file system sandbox commands.

1 Like

@hmwillett
If I’m uploading this csv to the kinetic screen ,can I use those rows to be added to something like quote lines? Like inserting the quote lines froma csv file , and if yes, how can I do that

This is a great tutorial—thanks for putting it together, @hmwillett!

Has anyone else experienced intermittent issues with the file-transfer widget? I’ve built (and rebuilt) a couple of layers on Order Entry due to a recurring bug. The goal is to upload a CSV using the file picker and then use the file to compare open orders against third-party customer order data using a BAQ and functions, returning the results to custom data views. The concept works well overall.

The issue I’m seeing is that the “File Picker Client” widget will randomly stop calling the FileTransferSvc/UploadFile method from my event. I noticed this because changes made to the CSV file prior to upload sometimes aren’t reflected—the function just uses the previously uploaded file.

When that happens, I can see the event is firing (confirmed via console), but the network trace shows no FileTransferSvc/UploadFile method call. I have a working layer, but ran into a separate issue, so I rebuilt it differently—solving one problem, but introducing another. Classic it seems for app studio.

I’ve tried deleting and re-adding the file picker and the related event, but the issue persists. It feels like the layer gets corrupted somehow, and the only reliable fix so far has been to start from scratch. Then it works… until it doesn’t.

Working network trace:
image

Not working trace:
image

Event configuration for both layers (identical):

What’s in your condition? What does the network trace show when you click that button and it doesn’t work?

Sorry, mean to include the console trace as well. The condition is simply making sure the filename uploaded to the picker matches what we expect it to be.

The bottom of that screenshot looks like it is calling the function after the condition evaluates to true? What does the network trace show?

Yes, the sequence in the event is to evaluate file name, if file name is correct, proceed with file upload, then call function which uses server file to complete comparison. The network trace is in my original post, the difference being that the working layer calls the “FileTransferSvc/UploadFile” method, then the function. The non-working layer just immediately calls the function without executing the upload method.

Yeah I don’t know, something isn’t adding up. Either there is a difference in the layer, or that condition is being evaluated differently or something. I have seen a lot of times where my events do get corrupted/randomly disappear. Sometimes closing and reopening the event it looks totally different and what I saw on the screen wasn’t actually what was executing at all.

This is good but when I try to use it in my situation I get this. Feature ‘using declarations’ not available in C# 7.2. Do I need to do something in order to use StreamReader and such?

Have you read the info on the sandbox method?
image

usings go on the Usings tab in the editor.

I am working with an Epicor Kinetic function in a Library. I don’t see a Usings tab. Is it in here and I am just missing it?

It’s in the code editor.

1 Like

Thanks for the info. I don’t have this though so I don’t know what to do.

It would be helpful if you showed us what you actually do have instead of everyone trying to guess.

2 Likes

the issue is I can’t get my Stream Reader to work and no where to set a using System.IO.

image

I’m even spelling it out.
image

but don’t see where to define the using System.IO

image

You’re not getting an error. You’re getting a warning.
This is because the cloud is moving to a Linux container soon.

When I try to instantiate a StreamReader it doesn’t do it. I know this because I have a message immediately after and it never shows. I just want to read my csv file, line by line and apply it to a Grid Data Source.