Print Page | Close Window

Dexterity Programming Question

Printed From: Microsoft Dynamics Forums
Category: Microsoft Dynamics GP (Great Plains)
Forum Name: GP - Customization and Integration
Forum Discription: Report Writer, Crystal Reports, SQL Reporting Services, eConnect, Integration Manager, Extender, Modifier, VBA, Dexterity, VSTools, and related topics
Printed Date: October 16 2019 at 10:38pm

Topic: Dexterity Programming Question
Posted By: dc_calif
Subject: Dexterity Programming Question
Date Posted: April 17 2018 at 11:29am
I'm trying to call a stored procedure within Dexterity.   I've taken the example from the help files so I know the syntax is correct.

In the Dexterity help it has the following example:

In SQL Create the stored Procedure:
CREATE PROC Count_Seniors
DECLARE @Count int
/* Count the number of employees over age 65 */
SELECT @Count = count(first_name) from EMPLOYEES where Age > 65

Then create a  Dexterity prototype procedure, also named Count_Seniors:

               sproc returns long Ret_Code;
               call sproc "Count_Seniors", Ret_Code;

The problem occurs when I compile the above script.  It tells me 'Cannot find script Count_Seniors'.

I made sure I did a "GRANT EXECUTE ON dbo.Count_Seniors TO DYNGRP"

I'm able to call the Count_Seniors stored procedure from a query window so I know it works.

If I remove the quotes around the call so it looks like this  "call sproc Count_Seniors, Ret_Code;"   When I compile this new code, dexterity blows up with a Dexterity Development Environment has stopped working message.

I'm at a loss of what is going on.

Any suggestions?


Posted By: BounPhommarath
Date Posted: April 24 2018 at 10:37am
The code is correct. Something is funky with your dictionary somewhere else. I've encountered an issue like this in the past where Dex would report compile errors seemingly good code and then crash violently. This cost me a lot of wasted project time trying to figure out what was wrong with the code. As it turned out, I had imported a form from another dictionary which had missing resources in the target dictionary. Or it referenced things that weren't in the current dictionary.

Well, good old Dex, had many resources that it had not resolved yet. When I compiled my perfectly good code, Dex exploded due to the completely unrelated (and uncompiled new code). To fix the problem, I had to surgically fix the imported form and made sure it compile correctly first. Then Dex behaved well with my new code.

In short, your code is fine.

Boun Phommarath
Microsoft Dynamics GP Dexterity Expert

Print Page | Close Window