Error Code CS1513

I am trying to run a baq from a form. This is my first attempt at doing this.
I keep getting the following error which I know is because its missing a left }. However, when I add a } then the errors greatly increase.

Error without the }
Compiling Custom Code …

----------errors and warnings------------

Error: CS1513 - line 73 (673) - } expected

** Compile Failed. **

Error when I add }

Compiling Custom Code …

----------errors and warnings------------

Error: CS1061 - line 46 (646) - ‘Script’ does not contain a definition for ‘RunBAQ’ and no extension method ‘RunBAQ’ accepting a first argument of type ‘Script’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 47 (647) - ‘Script’ does not contain a definition for ‘Button_Click’ and no extension method ‘Button_Click’ accepting a first argument of type ‘Script’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 56 (656) - ‘Script’ does not contain a definition for ‘RunBAQ’ and no extension method ‘RunBAQ’ accepting a first argument of type ‘Script’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 57 (657) - ‘Script’ does not contain a definition for ‘Button_Click’ and no extension method ‘Button_Click’ accepting a first argument of type ‘Script’ could be found (are you missing a using directive or an assembly reference?)
Error: CS1061 - line 70 (670) - ‘Ice.Adapters.DynamicQueryAdapter’ does not contain a definition for ‘GetQueryExecutionParametersById’ and no extension method ‘GetQueryExecutionParametersById’ accepting a first argument of type ‘Ice.Adapters.DynamicQueryAdapter’ could be found (are you missing a using directive or an assembly reference?)

** Compile Failed. **
Here is a copy of my code. Any help would be greatly appreciated.

// **************************************************
// Custom code for JobEntryForm
// Created: 1/10/2024 5:49:43 AM
// **************************************************

extern alias Erp_Contracts_BO_JobEntry;
extern alias Erp_Contracts_BO_JobMtlSearch;
extern alias Erp_Contracts_BO_Project;
extern alias Erp_Contracts_BO_Part;

using System;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Windows.Forms;
using Erp.Adapters;
using Erp.UI;
using Ice.Lib;
using Ice.Adapters;
using Ice.Lib.Customization;
using Ice.Lib.ExtendedProps;
using Ice.Lib.Framework;
using Ice.Lib.Searches;
using Ice.UI.FormFunctions;
using Ice.Adapters;
using Ice.BO;

public class Script
{
// ** Wizard Insert Location - Do Not Remove ‘Begin/End Wizard Added Module Level Variables’ Comments! **
// Begin Wizard Added Module Level Variables **

// End Wizard Added Module Level Variables **

// Add Custom Module Level Variables Here **

public void InitializeCustomCode()
{
	// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Variable Initialization' lines **
	// Begin Wizard Added Variable Initialization

	// End Wizard Added Variable Initialization

	// Begin Wizard Added Custom Method Calls

	this.RunBAQ.Click += new System.EventHandler(this.RunBAQ_Click);
	this.Button.Click += new System.EventHandler(this.Button_Click);
	// End Wizard Added Custom Method Calls
}

public void DestroyCustomCode()
{
	// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Object Disposal' lines **
	// Begin Wizard Added Object Disposal

	this.RunBAQ.Click -= new System.EventHandler(this.RunBAQ_Click);
	this.Button.Click -= new System.EventHandler(this.Button_Click);
	// End Wizard Added Object Disposal

	// Begin Custom Code Disposal

	// End Custom Code Disposal
}

private void RunBAQ_Click(object sender, System.EventArgs args)
{
		// ** Place Event Handling Code Here **
DynamicQueryAdapter dqa = new DynamicQueryAdapter (oTrans);
dqa.BOConnect();
QueryExecutionDataSet qeds = dqa.GetQueryExecutionParametersById ("ks_ChkstdCost");
qeds.ExecutionParameter.Clear();
qeds.ExecutionParameter.AddExecutionParameterRow("JobNum", BAQParam.Text, "nvarchar",false, Guid.NewGuid(),"A");
}

Errors for 46 and 56 are because it isn’t recognizing RunBAQ as a button name. This sometimes happens if you haven’t saved after adding the button.

Errors for 47 and 57 are complaining that you don’t have a function named Button_Click. If you have one, not included in what you posted.

Error for 70 means you need to add the adapter.
In your customization, under tools, choose Assembly Reference Manager.
Click the button Add Custom Reference.
Look for Ice.Adapters.DynamicQueryAdapter
It should start you in the correct directory.

I have had to save and come back in for it to recognize the adapter was added. (not always, but has happened)

Hope this gets you going in the right direction.

Thank you so much. I got everything fixed except line 70. When I go to the assembly reference the ice.adapters. DynamicQueryAdapter is not there. When I try to add it I get an error that it already exists. i have saved and come back in like your suggestion but It still doesn’t show.

Would being on public cloud have any effect on this at all?

I can’t say for certain about the Cloud as we are on premise.

Try searching for Ice.Contracts.BO.DynamicQuery
Sorry I was going off the error / memory.

When I checked one of mine, I had it as:

image

I don’t believe you need the Ice.Lib.Bpm.Shared as I don’t think I added that until I was getting to move to Kinetic (Kinetic requires it, never had to add it on 10)

I have the Business Objects one but the code I was using as an example said I needed the DyanmicQueryAdapter and I can’t get it to show in the assembly reference per my last reply.

Greatly appreciate all your help.

If it’s listed here, I’m not sure what else you need.

Hopefully someone else has some insight.