Modding the Epicor CRM App to Make the Map Show All Customers

Some of our sales reps are a bit frustrated with the EpicorCRM app only showing customers on its map if you are physically inside that country. Given that we’re close to the Canadian border it kind of doesn’t make sense to filter them this way. I couldn’t find any sort of setting to change this behavior so I decided to do a little digging into it.

If you check your Settings > Application Log > and toggle Debug mode, it will show details on the REST calls it makes to Kinetic’s CRM BAQs. If you copy the URL request for zCRM-Customers into a browser, it will return a JSON file where I could easily confirm that customers outside of the country are indeed being passed to the app, but not being displayed because of a box below the URL on the app, are being filtered out by something that says something close to "filter “ISO Country Code eq ‘US’ top:1000"” which means you’re only seeing US customers, max 1000 at a time.

I dumped the APK file, opened it with WinRAR, got down into \assets\www\app\services\erp-data-service.js.
Somewhere around Line 2817 is the function that places those filter options, and I broke it by commenting it out. Don’t know if I broke anything else yet, but the map loads all customers just fine now.

Downsides are, the app’s not going to auto-update anymore, and I had to spend a bit of time re-signing it so I’m able to sideload it on Android.

Also, I’m not sure if I’m allowed to share the modded APK here. Please let me know if that’s against the rules (because it sounds like it is.)

I’d really like to see this be default behavior, or something optional in the future.

That’s pretty slick you’re doing all of that. Not sure about any kind of rules with that, but more power to you.

And what do you mean, “the app’s not going to auto-update anymore?” They ditching it? Or are you saying that once you mod it/sideload it, it won’t update?

Yep. Since I signed it with a different keystore name.

1 Like

Do you know how the ISO code of US is being sent in? Cause you can make your own BAQ to use I’m fairly certain and you could modify the query so that it didn’t execute with that logic… @klincecum has done some magical things with BAQ events/BPMs to make them do some pretty exceptional things…

What I am getting at is, maybe you can hack at the BAQ instead of the APK.

Like if you made it an updatable BAQ you could probably catch those options before it ran… maybe… and then just erase them and proceed? Or just run a completely different BAQ haha and get the results back from that and bind them to the BAQ result dataset for the original one???

Just thinking really odd here around messing with the BAQ instead of the APK.

I am almost certain you can make your own BAQ from their base one and you just have to prefix or suffix it with a certain set of characters so that it knows you want to use this modified BAQ instead of the base one. They made this so you could add in the other UD fields or whatever that you wanted… I feel like I’m not making this up but it’s been 2+ years since I touched any of that :sweat_smile:

So it’d be like CRMCustomers-CUS or something like that. You can look in the user guide.

The BAQ links the Customer table to one called Country, which contains the ISOCode field. I thought of trying to mess with the BAQ as it would have been much easier, but unsure of how to approach that without also destroying some other functionality of the app, I took the hackier approach and was somehow successful. I’m actually not a programming guy at all.

Also since I install the solution files to keep the BAQs updated for the CRM users under my own account, I’m the author of the BAQs now. I can edit them all I want :slightly_smiling_face:

Yeah Matt I’m very impressed that you took it that far and it’s something to be proud of. I just wonder if you can figure out from some of @klincecum 's posts on BAQs that he’s done if you can just modify the BAQ and make it do something else… That way you won’t have to do all the stuff you did.

Again, this is all just ideas, but you’ve got me half tempted to try. But I am pretty sure I have seen @klincecum run a BAQ and do things with it that it was never intended to do and I’m pretty sure you could get it to return a whole different set of results if you wanted to.

1 Like

I appreciate all the encouragement. You go above and beyond posting here, so I’m glad to share my findings with everyone here.

Are we summoning klincecum with those mentions? :smile:

If you summon any one expert too many times you run out of wishes, so choose wisely (jk, they’d all help with every request if they didn’t already have full time jobs). I was not summoning any expert, just telling you that he has posted extensively (which takes a TON of time to do) and you could read through what he posted and probably get something going. I’m not asking him to re-post what he already posted, but use it in this context… that’s too much to ask.

robin williams disney GIF

Unfortunately, I am unavailable. I want to be, but I went down a rabbit hole this morning, and my brain is done.

Exit Strategy Bai GIF

1 Like

Haha I know man, I am not asking you to help. you have a ton of posts that can get someone in the right direction already.

1 Like

Hey, it’s better than the shopping and the litter boxes I’m about to do, but they don’t require any brain power.

Rest up and enjoy your weekends you all
Or party hard, your choice, I’ve already made my decision

1704063186648875

2 Likes