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");
}