EXEC_SP - Returns data, but not to BO

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
KnightWare
Posts: 139
Joined: Sat Feb 10, 2018 12:56 am

EXEC_SP - Returns data, but not to BO

Post by KnightWare »

My EXEC_SP IS retuning data and displays in Query Grid. The Syntax is: EXEC_SP 'dbo.C_DISTINCT_VENDOR' RETURN Vendors. The Vendors BO is setup to hold the results, if I understand the Docs, I need this. The Attributes of the Vendors BOP are the fields retuned by the SP + ID, BASVersion & BasTimeStamp. The Query is Working becuase the reults are displayed on the grid. The problem is nothing is in the "Vendors" object that I can see. When I select the record in the grid, the defult action is to call a proceess who's action is LoggedInRegularUser.SelectedVendor=Vendors. The SelectedVendor attribute is of type=Vendors. However the process fails with "Value of Vendors could not be resolved".
BLOMASKY
Posts: 1470
Joined: Wed Sep 30, 2015 10:08 pm
Location: Ocala FL

Re: EXEC_SP - Returns data, but not to BO

Post by BLOMASKY »

It is working as designed. when you have an EXEC_SP Returning a BO, it is for display only. You can not have any operations with records where you are passing the Vendor to the process. If you want more than just display, you have to have a stored procedure actually populate a BO (with INSERT Statement). Then you just use a plain old ordinary query FIND ALL Vendors

Bruce
KnightWare
Posts: 139
Joined: Sat Feb 10, 2018 12:56 am

Re: EXEC_SP - Returns data, but not to BO

Post by KnightWare »

I started down that road of inserting, but I really don't have to do anything with the specific records except know which one I've selected on screen. In other words - Users are filling in a Vendor Log with Communications. For My dashboard I want to display in the left panel the DISTINCT list of Vendor's from the log, and the right some log info based on which Vendor is selected on the left. I have the Stored Procedure working and it does return the proper distinct records to the grid. For the Right panel the Query is written to except the selected vendor object on the left in a Process, but as you now confirm, it's an empty set. I thought the syntax of the query, "EXEC_SP <SP> RETURN <VENDORS>" , returned the Select results into the Vendor BO I setup.
KnightWare
Posts: 139
Joined: Sat Feb 10, 2018 12:56 am

Re: EXEC_SP - Returns data, but not to BO

Post by KnightWare »

If the RETURN Object is display only in the results grid, is there a way to capture values that are currently selected? If not lookls like I have to do the insert as you say.
johntalbott
Posts: 619
Joined: Wed Jun 17, 2015 11:16 pm
Location: Omaha, Nebraska
Contact:

Re: EXEC_SP - Returns data, but not to BO

Post by johntalbott »

If I correctly understand what you are trying to do, I believe using a SQL View to get the distinct Vendors will give you what you want. BO's can be mapped to a View.

1. In SQL Server create a view called viewDistinctVendors
2. Create a BO viewDistinctVendors of type "Database: existing external" that maps to the SQL View called viewDistinctVendors
3. Use the BO viewDistinctVendors as the basis for your vendor selector query
VocalDay Solutions - Agility - Predictability - Quality

We specialize in enabling business through the innovative use of technology.

AwareIM app with beautiful UI/UX - https://screencast-o-matic.com/watch/crfUrrVeB3t
KnightWare
Posts: 139
Joined: Sat Feb 10, 2018 12:56 am

Re: EXEC_SP - Returns data, but not to BO

Post by KnightWare »

Ahead of you. Once I started to change the SP to a Select into ( and I actually finished it!) , I then realized I could just jump to this view.

Still a newbie.
KnightWare
Posts: 139
Joined: Sat Feb 10, 2018 12:56 am

Re: EXEC_SP - Returns data, but not to BO

Post by KnightWare »

Although I now realize that having a view spells trouble between TEST and PRODUCTION. I have to define the connection to the SQL view and thats two different DB's for Test and Production.
Jaymer
Posts: 2430
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: EXEC_SP - Returns data, but not to BO

Post by Jaymer »

BLOMASKY wrote: Sat Nov 03, 2018 11:21 pm It is working as designed. when you have an EXEC_SP Returning a BO, it is for display only. You can not have any operations with records where you are passing the Vendor to the process. If you want more than just display, you have to have a stored procedure actually populate a BO (with INSERT Statement). Then you just use a plain old ordinary query FIND ALL Vendors

Bruce
... or, continue to use EXEC_SP ?
Now, since Portugal, and Robin's demo on cell clicking in a grid, you could now make your own Row Operations VIA Javascript (which starts AwareApp.startProcess2) to kick off something when you click on a cell. A bit more work but saves the whole writing to temp file method.
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
nhofkes
Posts: 94
Joined: Mon Sep 07, 2020 6:03 am
Location: Netherlands

Re: EXEC_SP - Returns data, but not to BO

Post by nhofkes »

A possible solution for this issue is described in this post.
Niels
(V9.0 build 3241 - MariaDB - Windows)
Post Reply