Solved

Selector modification

  • 8 August 2022
  • 7 replies
  • 65 views

Userlevel 1
Badge

It is about ContractItems Screen there is a field called SetupItem am trying to display in that selector all the items including KitItems 

i tried removing attributes and added new query but its not working out

Can u please help me with the solutions

  #region BaseItemID  
        [PXRemoveBaseAttribute(typeof(ContractInventoryItemAttribute))]
        [PXMergeAttributes(Method = MergeMethod.Append)]
         [Inventory]
        [PXRestrictor(typeof(Where<InventoryItem.kitItem, NotEqual<boolTrue>>), null)]
        //  [ContractInventoryItemAttributeNew]

        [PXUIField(DisplayName = "Setup Item")]
        public int? BaseItemID { get; set; }
        #endregion

icon

Best answer by Naveen Boga 8 August 2022, 14:02

View original

7 replies

Userlevel 7
Badge +17

Hi @FarhanaM60  Please use the below CacheAttached code to get the Stock Items in the Setup Item selector field.

Please find the code and screenshot for reference.

  public class ContractItemMaintExt : PXGraphExtension<ContractItemMaint>
{

[PXMergeAttributes(Method = MergeMethod.Merge)]
[PXRemoveBaseAttribute(typeof(ContractInventoryItemAttribute))]
[PXRestrictor(typeof(Where<InventoryItem.kitItem, NotEqual<boolTrue>>), null)]
[Inventory]
protected virtual void ContractItem_BaseItemID_CacheAttached(PXCache cache) {}

}

 

Userlevel 1
Badge

hi Thank you for the reply… but i want to display all inventory items which are in Kit specifications screen

 

Like In Inventory table Kit item must be true

 

When we restrict not equal true means it displaying all the items except kititem

when we say equal true its not displaying -its loading with the empty selector

 

 

 

Userlevel 7
Badge +17

Hi @FarhanaM60  Can you please confirm that you wanted to display ONLY KIT ITEMS in the selector?

 

Userlevel 1
Badge

no all items including kit items

Userlevel 7
Badge +17

@FarhanaM60  If that is the case you need to remove the Restrictor as well like below.


Please find the code for reference.

 

 public class ContractItemMaintExt : PXGraphExtension<ContractItemMaint>
{

[PXMergeAttributes(Method = MergeMethod.Merge)]
[PXRemoveBaseAttribute(typeof(ContractInventoryItemAttribute))]
[PXRemoveBaseAttribute(typeof(PXRestrictorAttribute))]
[Inventory(DisplayName = "Setup Item")]

protected virtual void ContractItem_BaseItemID_CacheAttached(PXCache cache) {}

}

 

Userlevel 1
Badge

Still its not working.. it is not bringing kit items into that selector

Userlevel 7
Badge +17

@FarhanaM60  The above code is working for me and it is showing Kits and all other Stock items.

Please replace the code with the new code and build properly and verify.

 

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved