Setting a variable based off of a Calculated field

I am trying to set a bool variable from a BMP. It is a pre-Processing on CustShip.GetHeadOrderInfo.

I am trying to pull it from a calculated field that i created in a BAQ.
I started by setting a variable to equal the packnum.

but i cannot get the correct syntax for pulling back the value from my calculated field. (it is called Error). Here is the custom code i am trying to do it from.

bool Error = false;
int BAQPackID;
BAQPackID = PackID;

Ice.Contracts.DynamicQuerySvcContract tQuery = Ice.Assemblies.ServiceRenderer.GetService < Ice.Contracts.DynamicQuerySvcContract > (Db);

if(tQuery != null)
    Ice.Tablesets.DynamicQueryTableset dsQuery = tQuery.GetByID("qryCustShipEntryError");

    if(dsQuery != null)
        Ice.Tablesets.QueryExecutionTableset dsBAQ = tQuery.GetQueryExecutionParameters(dsQuery);
        dsBAQ.ExecutionParameter[0].ParameterID = "PackID";
        dsBAQ.ExecutionParameter[0].IsEmpty = false;
        dsBAQ.ExecutionParameter[0].ParameterValue = ToString(PackID);

        DataSet results = tQuery.Execute(dsQuery, dsBAQ);

        if (results != null && results.Tables.Count > 0 && results.Tables[0].Rows.Count > 0)
            DataRow row = results.Tables[0].Rows[0];
            row["RowMod"] = "U";

                tQuery.Update(dsQuery, results);
            catch (Exception e)
                string emsg2 = "usefule info " + e.Message;

        dsBAQ = null;

    dsQuery = null;

I get error "No Overload for method ToString takes 1 arguments

Try PackID.ToString(). Or something like that. The error is saying that you have too many parameters in the ToString function.

1 Like

I am going to have to put you on the payroll LOL Thank you. I knew it was an easy problem.

1 Like