Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested answer

Output parameters of stored procedure not coming

(0) ShareShare
ReportReport
Posted on by 20

I am calling one stored procedure from the Navision thru the ADO command. the procedure is containing the input and output both parameters. inside the procedure, I have written the update statement and sending a string through output parameters. but inside the Navision, I am not getting the output string. however, the stored procedure is getting executed successfully. if I am removing the update statement from the procedure then able to read the output string. 

  • Ghanshyam2402 Profile Picture
    20 on at
    RE: Output parameters of stored procedure not coming

    ---Sending output parameters to the procedure

    ADOParameter:=ADOCommand.CreateParameter('@success',200,2,100,'');

    ADOCommand.Parameters.Append(ADOParameter);

    ADOParameter:=ADOCommand.CreateParameter('@msg',200,2,100,'');

    ADOCommand.Parameters.Append(ADOParameter);

    ---fetching output parameters from the procedure

    ltxtResult := FORMAT(ADOCommand.Parameters.Item('@msg').Value);

    MESSAGE(ltxtResult);

    ltxtResult := FORMAT(ADOCommand.Parameters.Item('@success').Value);

    MESSAGE(ltxtResult);

  • Suggested answer
    Nitin Verma Profile Picture
    21,548 Moderator on at
    RE: Output parameters of stored procedure not coming

    Hi,

    Can you please mark which one is output parameter in the code?

    Thanks.

  • Ghanshyam2402 Profile Picture
    20 on at
    RE: Output parameters of stored procedure not coming

    hi Nitin Verma, seeking your help on this

  • Ghanshyam2402 Profile Picture
    20 on at
    RE: Output parameters of stored procedure not coming

    Hi Nitin,

    ltxtConnectionString := 'Driver={SQL Server};PROVIDER=SQLOLEDB;SERVER=10.10.0.***' +
    ';DATABASE=OperationProcess;UID=****;PWD=********';

    IF ISCLEAR(ADOConnection) THEN
    CREATE(ADOConnection,FALSE,TRUE);

    ADOConnection.ConnectionString:= ltxtConnectionString;
    ADOConnection.Open;

    IF ISCLEAR(ADOCommand) THEN
    CREATE(ADOCommand,FALSE,TRUE);

    VarActiveConnection := ADOConnection;

    ADOCommand.ActiveConnection := VarActiveConnection;
    ADOCommand.CommandText := 'OperationProcess.dbo.spr_Requisition_CreateTemplateDineInMenu';

    ADOCommand.CommandType := 4;
    ADOCommand.CommandTimeout := 0;

    ADOParameter:=ADOCommand.CreateParameter('@CommissaryLocation',200,1,100,CommissaryLocation);
    ADOCommand.Parameters.Append(ADOParameter);

    ADOParameter:=ADOCommand.CreateParameter('@OutletList',200,1,100,OutletList);
    ADOCommand.Parameters.Append(ADOParameter);

    ADOParameter:=ADOCommand.CreateParameter('@ProductionBOM',200,1,100,ProductionBOM);
    ADOCommand.Parameters.Append(ADOParameter);


    ADOParameter:=ADOCommand.CreateParameter('@success',200,2,100,'');
    ADOCommand.Parameters.Append(ADOParameter);

    ADOParameter:=ADOCommand.CreateParameter('@msg',200,2,100,'');
    ADOCommand.Parameters.Append(ADOParameter);


    ADOCommand.Execute;

    ltxtResult := FORMAT(ADOCommand.Parameters.Item('@msg').Value);
    MESSAGE(ltxtResult);


    ltxtResult := FORMAT(ADOCommand.Parameters.Item('@success').Value);
    MESSAGE(ltxtResult);


    ADOConnection.Close;
    CLEAR(ADOConnection);

  • Suggested answer
    Nitin Verma Profile Picture
    21,548 Moderator on at
    RE: Output parameters of stored procedure not coming

    Hi Ghanshyam2402 ,

    Can you please show me your code here?

    Thanks

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 1,174

#2
YUN ZHU Profile Picture

YUN ZHU 1,006 Super User 2025 Season 1

#3
Mansi Soni Profile Picture

Mansi Soni 836

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans