Skip to main content
Solved

Display of new Combo Box value for a status field in Generic Inquiry


Forum|alt.badge.img+1

Hello,

 

I have added a small customization to the Vendor Status field such that it includes a new available option for selection. This was done through the Customization Project via the ‘Fields’ section of the ‘Vendors’ [AP303000] screen, where a new Combo-box value of ‘Z’ and description of ‘Pending Approval’ (see below screenshot) were added.

 

 

The respective value of ‘Pending Approval’ is available on the ‘Vendors’ [AP303000] screen, however when running the Generic Inquiry which shows the list of Vendors, there is a slight issue, whereby the Status is being shown as blank. I have some workarounds to this such as by using a Switch function to manually show the status description, although this is not “clean” as it could break in case of upgrades and it would be considered as sort of “hard-coding”, thus is not good practice.

 

 

Does anyone know whether there is perhaps some missing configuration that I need to do to make the value description show for the new Combo-box values?

 

Thanks in advance,

Nigel Pace

Best answer by Naveen Boga

Hi @npace29  I worked on a similar kind of issue for the different screen i.e Projects.

This is an Acumatica issue, where it is not showing the newly added status in the GI’s.

Here is the workaround to resolve the issue. 

  • Extend the Vendor DAC and add the Status field
  • Instead of using the default status list, you need to create a new list by adding the new status like below.

Please find the similar code below and verify.

 

 public class PMProjectExt : PXCacheExtension<PMProject>
    { 
        #region Status	
        [PXDBString(1, IsFixed = true)]
        [ProjectStatusExt.List()]
        [PXDefault(ProjectStatusExt.Planned)]
        [PXUIField(DisplayName = "Status", Required = true, Visibility = PXUIVisibility.SelectorVisible)]
        public string Status { get; set; }
        #endregion

   }

        public static class ProjectStatusExt
        {
            public class ListAttribute : PXStringListAttribute
            {
                public ListAttribute() : base(
                    new[]
                    {
                    Pair(Planned, PX.Objects.PM.Messages.InPlanning),
                    Pair(Active, PX.Objects.PM.Messages.Active),
                    Pair(Completed, PX.Objects.PM.Messages.Completed),
                    Pair(Cancelled, PX.Objects.PM.Messages.Canceled),
                    Pair(OnHold, PX.Objects.PM.Messages.Suspend),
                    Pair(PendingApproval, PX.Objects.PM.Messages.PendingApproval),
                    Pair(Contract.status.InUpgrade, PX.Objects.CT.Messages.InUpgrade),
                    Pair(Closed, "Closed"),
                    })
                { }
            }

            public class TemplStatusListAttribute : PXStringListAttribute
            {
                public TemplStatusListAttribute() : base(
                    new[]
                    {
                    Pair(Active, PX.Objects.PM.Messages.Active),
                    Pair(OnHold, PX.Objects.PM.Messages.OnHold),
                    })
                { }
            }

            public const string Planned = Contract.status.Draft;
            public const string Active = Contract.status.Active;
            public const string Completed = Contract.status.Completed;
            public const string OnHold = Contract.status.Expired;
            public const string Cancelled = Contract.status.Canceled;
            public const string PendingApproval = Contract.status.InApproval;

public const string Closed = "X"; //Symbol assigned in Workflow

            public class planned : PX.Data.BQL.BqlString.Constant<planned>
            {
                public planned() : base(Planned) {; }
            }

            public class active : PX.Data.BQL.BqlString.Constant<active>
            {
                public active() : base(Active) {; }
            }

            public class completed : PX.Data.BQL.BqlString.Constant<completed>
            {
                public completed() : base(Completed) {; }
            }

            public class cancelled : PX.Data.BQL.BqlString.Constant<cancelled>
            {
                public cancelled() : base(Cancelled) {; }
            }

            public class onHold : PX.Data.BQL.BqlString.Constant<onHold>
            {
                public onHold() : base(OnHold) {; }
            }

            public class pendingApproval : PX.Data.BQL.BqlString.Constant<pendingApproval>
            {
                public pendingApproval() : base(PendingApproval) {; }
            }
        }
    }

 

In the above, I have added Closed status with X symbol, the same way you need to add your status i.e. Pending Approval i.e. Z, and verify  

View original
Did this topic help you find an answer to your question?

4 replies

deebhane
Semi-Pro I
Forum|alt.badge.img+1
  • Semi-Pro I
  • 62 replies
  • March 7, 2022

hi @npace29 

Would  to check have you declared the schema field for your custom field. If yes please share your GI 

 


Forum|alt.badge.img+1
  • Author
  • Varsity I
  • 26 replies
  • March 7, 2022

@deebhane Thanks for your reply.

 

The GI is the standard one provided by Acumatica for the Vendors screen. I have attached it for your perusal.

 

 

Thanks again,

Nigel Pace


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3381 replies
  • Answer
  • March 7, 2022

Hi @npace29  I worked on a similar kind of issue for the different screen i.e Projects.

This is an Acumatica issue, where it is not showing the newly added status in the GI’s.

Here is the workaround to resolve the issue. 

  • Extend the Vendor DAC and add the Status field
  • Instead of using the default status list, you need to create a new list by adding the new status like below.

Please find the similar code below and verify.

 

 public class PMProjectExt : PXCacheExtension<PMProject>
    { 
        #region Status	
        [PXDBString(1, IsFixed = true)]
        [ProjectStatusExt.List()]
        [PXDefault(ProjectStatusExt.Planned)]
        [PXUIField(DisplayName = "Status", Required = true, Visibility = PXUIVisibility.SelectorVisible)]
        public string Status { get; set; }
        #endregion

   }

        public static class ProjectStatusExt
        {
            public class ListAttribute : PXStringListAttribute
            {
                public ListAttribute() : base(
                    new[]
                    {
                    Pair(Planned, PX.Objects.PM.Messages.InPlanning),
                    Pair(Active, PX.Objects.PM.Messages.Active),
                    Pair(Completed, PX.Objects.PM.Messages.Completed),
                    Pair(Cancelled, PX.Objects.PM.Messages.Canceled),
                    Pair(OnHold, PX.Objects.PM.Messages.Suspend),
                    Pair(PendingApproval, PX.Objects.PM.Messages.PendingApproval),
                    Pair(Contract.status.InUpgrade, PX.Objects.CT.Messages.InUpgrade),
                    Pair(Closed, "Closed"),
                    })
                { }
            }

            public class TemplStatusListAttribute : PXStringListAttribute
            {
                public TemplStatusListAttribute() : base(
                    new[]
                    {
                    Pair(Active, PX.Objects.PM.Messages.Active),
                    Pair(OnHold, PX.Objects.PM.Messages.OnHold),
                    })
                { }
            }

            public const string Planned = Contract.status.Draft;
            public const string Active = Contract.status.Active;
            public const string Completed = Contract.status.Completed;
            public const string OnHold = Contract.status.Expired;
            public const string Cancelled = Contract.status.Canceled;
            public const string PendingApproval = Contract.status.InApproval;

public const string Closed = "X"; //Symbol assigned in Workflow

            public class planned : PX.Data.BQL.BqlString.Constant<planned>
            {
                public planned() : base(Planned) {; }
            }

            public class active : PX.Data.BQL.BqlString.Constant<active>
            {
                public active() : base(Active) {; }
            }

            public class completed : PX.Data.BQL.BqlString.Constant<completed>
            {
                public completed() : base(Completed) {; }
            }

            public class cancelled : PX.Data.BQL.BqlString.Constant<cancelled>
            {
                public cancelled() : base(Cancelled) {; }
            }

            public class onHold : PX.Data.BQL.BqlString.Constant<onHold>
            {
                public onHold() : base(OnHold) {; }
            }

            public class pendingApproval : PX.Data.BQL.BqlString.Constant<pendingApproval>
            {
                public pendingApproval() : base(PendingApproval) {; }
            }
        }
    }

 

In the above, I have added Closed status with X symbol, the same way you need to add your status i.e. Pending Approval i.e. Z, and verify  


Forum|alt.badge.img+1
  • Author
  • Varsity I
  • 26 replies
  • March 7, 2022

@Naveen B Thanks a lot for your detailed response. Much appreciated :slight_smile:

 

I will definitely try it out :) 

 

Will keep you posted.

 

Nigel Pace


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings