Hi;
I have wrritten the following code in xxEndpoint.cs to run a stored procedure.
public int Runprocedure(IDbConnection connection)
{
connection.Execute("UpdateNumbers",
param: new
{
ProductId = ProductId
}, commandType: CommandType.StoredProcedure);
return 0;
}
Now I am calling it fro xxDialog.ts. I have written the following but don't know how pass the lookup value to the stored procedure.
Q.serviceRequest(ProductService.baseUrl + '/Runprocedure');
Compile first, then T4,
then in xxDialog.ts
ProductService.Runprocedure(
{
Parametr1: this.form.ProductId.value,
Parametr2: this.form.Statement.value
},
response =>{});
@Zahar661
Thank you
hi there - I have been searching through the wiki but can't get to a solution on this so any help would be greatly appreciated, I am trying to pass the Id of a record on a dialog through to a stored procedure (MySQL) but after many attempts and variations on the above and other SP related posts I am now unable to get even close to to a result.
Like the above issue #4098 I am not expecting a result returned back to the user, just trigger a bunch of code on the server.
My difficulty relates to passing the parameter from the dialog to the endpoint, with the above example "Parameter1:" and "Parameter2:" not making much sense to me in relation to the parameter "ProductId = ProductId" in the endpoint, see one of my many interpretations below in the screenshots
[Dialog onClick]

[Endpoint] - the project will not rebuild with this error

[Endpoint] - if the parameter is hard coded, the below warning message is returned

[Error when the button is clicked on hard-coded parameter]

@chrisomeara Hi!
EndPoint add request


in Dialog onClick

[Error when the button is clicked on hard-coded parameter]
I won't help here. I do not use stored procedure
[Error when the button is clicked on hard-coded parameter]
I won't help here. I do not use stored procedure
thanks @Zahar661 - very fast response and all the tools to lead me to the answer!
[Endpoint] - note I got the call to the SP working without the number of args error via a SQL execution - I suspect a MySQL thing

[ServiceRequest] - added that to the existing XYZmodel.cs from the bulk action request demo example!

[Dialog] - a little more work here for me on refreshing the dialog and grid





Most helpful comment
Compile first, then T4,
then in xxDialog.ts