zed Suite Support

Login or Sign Up to participate.

Welcome Guest Search | Active Topics |

How to run a stored procedure
z56cjt
#1 Posted : Friday, June 25, 2010 9:50:08 AM
Rank: Administrator
Groups: NewUsers , Registered, ForumUsers

Joined: 12/1/2009
Posts: 26
Points: 78
Step 1- Create your stored procedure in the B1 Database using a SQL script.

Step 2- Create a new query in the B1WebAPI category inside the B1 client with syntax like this:

DECLARE @MinDays INT
DECLARE @DocDateType VARCHAR(3)
DECLARE @Reconsiled VARCHAR(3)
DECLARE @AgeDate DATETIME
SET @MinDays = 0
SET @DocDateType = 'POS'
SET @Reconsiled = 'NO'
SET @AgeDate = GETDATE()

EXEC dbo.V33_QueryAgeReport [%CustCardCodeFrom] , [%CustCardCodeTo] , @AgeDate,@MinDays,@DocDateType,@Reconsiled

Step 3- Call that query via the B1WebAPI and pass it the required parameters.

The B1WebAPI will pass that information to the query you saved in B1, execute the stored procedure with those params and then return the results.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.