[SOLVED] Added a shortcut and got this runtime error. Weird

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
Jaymer
Posts: 2430
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

[SOLVED] Added a shortcut and got this runtime error. Weird

Post by Jaymer »

I've added plenty of shortcuts before, so this is kinda strange.

Tenant BO: om_Lead
.. AcctNum
.. Name
.. ShortName

Lead BO: ob_Tenant
.. LeadName
.. LeadPhone

I didn't have a shortcut pointing UP to the owner because if you were logged in as an employee/user of Tenant, you know who you work for.
But we needed an "All Leads" search for internal use - across ALL Tenants.
So I added "sc_Tenant" = Lead.ob_Tenant.ShortName.

I added it to my All Leads Query and all was fine.
When running one of the regular queries for a user, like "Show My Leads", immediately I got this error in a popup box:

Code: Select all

   Internal Error: Problem in ob_Tenant.ShortName for shortcut attribute sc_Tenant Path ob_Tenant.ShortName contains lists
I had to click the OK button several times - the same error window kept popping up.

Server output window says: com.bas.basserver.persistence.PersistenceException: Problem in ob_Tenant.ShortName for shortcut attribute sc_Tenant Path ob_Tenant.ShortName contains lists

Thing is... that ShortName field isn't a list. Its Text(20), and just has a name in it.
I changed to the longer Name field and got the same error.
Deleted the shortcut and the Query went back to running fine.
I never even edited the Query(s) that were throwing the error - only the one All Leads query that I added the new shortcut to.

damn strange
Last edited by Jaymer on Tue Mar 20, 2018 4:46 am, edited 1 time in total.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
rob_h7
Posts: 85
Joined: Mon Jan 25, 2010 3:52 am

Re: Added a shortcut and got this runtime error. Weird

Post by rob_h7 »

Hey Jaymer

It's just crap data. Was the relationship multi allowed but then changed to not? It happens when there's a single relationship but there's multiple records inserted.

So my guess is one of your Lead records has managed to get multiple Tenants inserted.
Rob . Aware 8.4 (build 2718), Developer Edition, using Linux, MYSQL
Jaymer
Posts: 2430
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Added a shortcut and got this runtime error. Weird

Post by Jaymer »

well thats an interesting theory... I can run some SQL and see if I find a COUNT(*) > 1 somewhere in a REF table.
the ob_Tenant has always been Single ref - for about 2 weeks, but I've never had to have a shortcut going to the owing tenant until now. Thanks for the idea.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Posts: 2430
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: [SOLVED] Added a shortcut and got this runtime error. We

Post by Jaymer »

Sure enough Rob, there were some leads who were pointing to the parent Tenant twice.
I don't think it was because that attribute was ever Multiple, but more likely related to very early test records that were entered and/or imported.

But, GREAT CATCH, hopefully this will help someone else in the future if they search on that error msg. THANK YOU!!!

You can't really find the offending records using aware.

here's my SQL that identified the recs.

Code: Select all

select rid,  count(*)
FROM [AA].[dbo].[TENANT_REF]
group by RID
having count(*)>1
Because we only want COUNT>1, (we are hiding all the records that should be there), this should normally have 0 lines of output, based on my described schema.
If it lists something, then it found a child record with MORE THAN 1 entry in the file - it should only have 1. You'll have to manually delete the erroneous row(s).
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
rob_h7
Posts: 85
Joined: Mon Jan 25, 2010 3:52 am

Re: [SOLVED] Added a shortcut and got this runtime error. We

Post by rob_h7 »

Glad it helped!
Rob . Aware 8.4 (build 2718), Developer Edition, using Linux, MYSQL
Post Reply