Calculate URL to open in url-open

Yup, no problem there.

So… sorry about the image dump below, but here was my set-up:

Textbox with EP Binding to TransView.Pasted.

The second text box had an EpBinding to TransView.FixedPath

I then created an event so when the value of “Pasted” changes, it will update “FixedPath”.

Trigger:

Condition:

Expressoion: '{TransView.Pasted}'.startsWith('S:')

Row-Update:

Expression: '{TransView.Pasted}'.replace(/^S:/, '/reallycoolpath').replace(/\+/g, '/')

2 Likes

If it works… you should be able to see your event firing in debugger:

This is good, but where you initiate the TransView. What event or how do you set up that event?

If you’re on Quote Entry… TransView is already there and I’m sure Epicor already took care of that. Shouldn’t need to worry about it.

There’s already a system event that initiates it as a dataview:

1 Like

@dcamlin Thank you so much and thank you for your patience with me.

I’m not sure why it wasn’t working when I wrote the expression, eventually I copy/pasted your expression and it worked. I have since made several tweaks to get where I wanted to go, because Windows 11 “Copy as Path” puts quotation marks around the path and removing those was quite the chore and it messed with the slashes for some reason.

I’m good now, and now I am trying to make it look nice and figure out the error trapping.

3 Likes

I’ve implemented this without the condition for testing and simply assumed it would be formatted the way I expect. I know before I go real world I will need a few conditions, but as I tried to implement what you have here everything is evaluated as FALSE even if the pasted value is indeed S:\blah\blah\blah

Not sure what I am missing.

First I will want to see if the link pasted has the quotation marks or not, if it does not start with S:\ I would test for \Customer Folders\ in the path and if none of those conditions are met I could simply save whatever they paste.

-Tory

Can you show your console output?

F12

Tap on kinetic window

Ctrl alt 8

Paste path

Screenshot console

I think the problem is your condition expression above has the “replace” action in it… you’re not looking to replace anything there. You’re just evaluating the current value.

So I initially tested with: '{TransView.Pasted}'.startsWith('S:')

That’s a true/false expression.

You’re not trying to “replace” anything here.

1 Like

You can check multiple things in a single condition expression… so you could try:

'{TransView.Pasted}'.includes('"') && '{TransView.Pasted}'.startsWith('S:')

edit: to be honest, you know you always what to remove the quotation marks, right? so there’s really no reason to make that part of the condition… just always include that in your row-update expression. That’s where the “replacing needs to happen”.

Also, these are JavaScript expressions, and there is no “.replaceAll()” function.

Instead, you would format your .replace() using “/g”. This serves as a global flag, so the replace will look for all instances in the value.

So, your replace for getting rid of all quotation marks would be:
'{TransView.Pasted}'.replace(/"/g, '')

1 Like

Opps, I grabbed the wrong screenshot. That was a random test, I was trying to get a positive on anything at that point. I promise I did have it the way your original one was, however I will try again. I will also open the console and try to look for the output, I’m not great in the console yet so will stumble on that for a while.

Thanks for help so far guys.

2 Likes

Love the popcorn icon LOL.

OK I am getting creative, probably a bad idea but its ‘working’…

Instead of using StartsWith I switched to includes, this is working. I feel there is some magical invisible character showing up in the string when I evaluate it. I think it comes through with apostrophe’s in the beginning and end of the string when it evaluates. The other thing that keeps kicking my hind quarters is the , if I add that to the includes or starts with the whole thing just plain doesn’t run. Can we do something like Char(92) as a replacement for a character?

What language is this? Looks like JavaScript.

PS Thank you so very much for your patience.

1 Like

Something odd happening, when something evaluates as FALSE that event fires then it goes back and fires the TRUE action afterwards?!?! It appears that when the TRUE happens I am good, unless its something odd with Dialog Show?!?

1 Like

I’m a little lost here. Are you talking about “includes” a comma?

And yes, you can replace something with a backslash (Char(92))…

You should be able to do that with something like: .replace(/,/g, '\\')

That would replace all commas with backslashes (as an example).

You have to escape the backslash (to tell the system to treat it literally) by adding a preceding backslash. Clear as mud.

So, .replace(/,/g, '\') won’t work, but .replace(/,/g, '\\') should.

… and yes, this is primarily javascript

So, it shows the dialog… and then STILL performs the row-update?

Can you watch this in debugger? Do you happen to have multiple test events firing?

Sorry our Go Live is a month away and while I want this piece right, it is not actually critical so I got dragged off this today. I will play with it some more and report back as I have time.

OK well tonight its not acting up so its working fine.

I sort of cleared out the event and started over slowly one step at a time. The previous attempt I kept relinking elements in the event, I’m not sure if that confuses it or maybe I didn’t properly re-link. This time I used the tool to automatically link the nodes in the event.

2 Likes

Ugh new problem :frowning:

I combined all the customizations into one layer and tested. I was so impressed at home great it all looked! I was so stoked to apply it to the menu. First problem, regardless of the fact I did publish the layer it was not available to be applied as a layer on the menu…
Ok, well let me just log out and back in that will fix it…
Log back in, still not there.
Ok let’s go to Application Studio and see if I can publish it again, but first another quick test to see how great it is.
Poop Its acting like a tracker now, no edit functions! I checked the data binding is set! What am I missing? Why would my layer start acting like a tracker?

HELP!!!

OK, might be my Application Studio in general acting up as all layers are acting like trackers, haven’t tested other pages yet but so far Quote Layers that I know are working properly attached to menu listings are working fine live from the menu but when I preview in APplication Studio are acting like trackers.

Help would still be appreciated, but hopefully this feedback will help. I will try clearing cookies and such again, we shall see.

Jiminey Christmas it’s back. Boy that gave me a small heart attack, boy Application Studio can be buggy.

Maybe it was clearing the cookies…

1 Like