Alfredo Ibarra
Alfredo Ibarra

Reputation: 73

Error CS0246: "The type or namespace name could not be found"

I need to include a string into a BQL so, I have created a private class within a class to define a constant string that is utilized in the BQL.

The problem that I'm facing is, that this code it is not passing the validation when I publish.

I'm getting the following error: " \App_RuntimeCode\PX_Objects_SO_AddSOFilter_extensions.cs(48): error CS0246: The type or namespace name 'TypeCS' could not be found (are you missing a using directive or an assembly reference?)

\App_RuntimeCode\PX_Objects_SO_AddSOFilter_extensions.cs(60): error CS0246: The type or namespace name 'TypeCS' could not be found (are you missing a using directive or an assembly reference?)

\App_RuntimeCode\PX_Objects_SO_AddSOFilter_extensions.cs(48): error CS0246: The type or namespace name 'TypeCS' could not be found (are you missing a using directive or an assembly reference?) " Any help or suggestion will be greatly appreciated.

namespace PX.Objects.SO
{
     [PXNonInstantiatedExtension]
    public class SO_AddSOFilter_ExistingColumn : PXCacheExtension<PX.Objects.SO.AddSOFilter>
    {

        private class TypeCS : Constant<string>
        {
            public TypeCS() : base("CS")
            {
            }
        }


        #region OrderType   
        [PXDBString(2, IsFixed = true, InputMask = ">aa")]
        [PXSelector(typeof(Search2<SOOrderType.orderType,
        InnerJoin<SOOrderTypeOperation, On<SOOrderTypeOperation.orderType, Equal<SOOrderType.orderType>>>,
        Where<SOOrderType.active, Equal<True>, 
            And<SOOrderType.requireShipping, Equal<True>, Or<SOOrderType.orderType, Equal<TypeCS>,
...               

        [PXDefault(typeof(Search2<SOOrderType.orderType,
        InnerJoin<SOOrderTypeOperation, On<SOOrderTypeOperation.orderType, Equal<SOOrderType.orderType>>, 
        LeftJoin<SOSetup, On<SOSetup.defaultOrderType, Equal<SOOrderType.orderType>>>>,
        Where<SOOrderType.active, Equal<True>, 
            And<SOOrderType.requireShipping, Equal<True>, Or<SOOrderType.orderType, Equal<TypeCS>,
   ...              [PXUIField(DisplayName = "Order Type")]
                [PXFormula(typeof(Default<AddSOFilter.operation>))]
            public string OrderType { get; set; }
        #endregion

    }

}

Upvotes: 1

Views: 1467

Answers (1)

Brendan
Brendan

Reputation: 5613

Make the bql constant public as the framework is not able to see the constant being declared as private.

public class TypeCS : Constant<string>
{
    public TypeCS() : base("CS")
    {
    }
}

Upvotes: 2

Related Questions