Skip to main content
Solved

How to enable search via description


Forum|alt.badge.img
  • Semi-Pro II
  • 259 replies

Hello all,

How can I enable searching a Labor item not only by Labor Item ID but also with Description using Project Editor? Currently i am only able to search via Labor Item ID.

 

Thanks in advance.

Best answer by Naveen Boga

@Harry  Below is the simple code that you need to add to get the required functionality.

Also attached sample customization package, you can deploy in your instance and verify.

 

using PX.Data;
using PX.Objects.IN;

namespace PX.Objects.EP
{
    public class TimeCardMaint_Extension : PXGraphExtension<PX.Objects.EP.TimeCardMaint>
	{
		#region Event Handlers 

		[PXMergeAttributes(Method = MergeMethod.Merge)] 
		[PXDimensionSelectorAttribute("INVENTORY", typeof(Search<InventoryItem.inventoryID, Where<InventoryItem.itemType, Equal<INItemTypes.laborItem>, 
			And<Match<Current<AccessInfo.userName>>>>>), typeof(InventoryItem.inventoryCD), DescriptionField =typeof(InventoryItem.descr))]
		protected virtual void EPTimeCardSummaryWithInfo_LabourItemID_CacheAttached(PXCache cache)
		{
		} 
		#endregion
	}
}

 

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

7 replies

Forum|alt.badge.img
  • Author
  • Semi-Pro II
  • 259 replies
  • January 11, 2024

This is the current code being used:
 

 


Sagar Greytrix
Captain II
Forum|alt.badge.img+3

Hi @Harry ,

You can add fields to FastFilterFields to allow search in selector.

Kindly find below screenshot for the same.

Hope, it helps,

Regards,

Sagar, Greytrix


Forum|alt.badge.img
  • Author
  • Semi-Pro II
  • 259 replies
  • February 14, 2024

Hey @sagar07 , thank you for your suggestion. I tried the above steps, but still it doesn’t work.

 

 


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3417 replies
  • February 14, 2024

@Harry Acumatica is using below PXLoborItem Attribute for the LabourItemID field to load the Items.

As you wanted to search with the description, it may not be possible from the Project Editor and it requires customization to do this.

[PMLaborItem(typeof(projectID), typeof(earningTypeID), typeof(Select<EPEmployee, Where<EPEmployee.bAccountID, Equal<Current<EPTimeCard.employeeID>>>>))]

 


Forum|alt.badge.img
  • Author
  • Semi-Pro II
  • 259 replies
  • February 14, 2024

Hello @Naveen Boga ,

Would it be possible for you to share the particular code? Would really be grateful.

Thanks in advance.


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3417 replies
  • Answer
  • February 14, 2024

@Harry  Below is the simple code that you need to add to get the required functionality.

Also attached sample customization package, you can deploy in your instance and verify.

 

using PX.Data;
using PX.Objects.IN;

namespace PX.Objects.EP
{
    public class TimeCardMaint_Extension : PXGraphExtension<PX.Objects.EP.TimeCardMaint>
	{
		#region Event Handlers 

		[PXMergeAttributes(Method = MergeMethod.Merge)] 
		[PXDimensionSelectorAttribute("INVENTORY", typeof(Search<InventoryItem.inventoryID, Where<InventoryItem.itemType, Equal<INItemTypes.laborItem>, 
			And<Match<Current<AccessInfo.userName>>>>>), typeof(InventoryItem.inventoryCD), DescriptionField =typeof(InventoryItem.descr))]
		protected virtual void EPTimeCardSummaryWithInfo_LabourItemID_CacheAttached(PXCache cache)
		{
		} 
		#endregion
	}
}

 


Forum|alt.badge.img
  • Author
  • Semi-Pro II
  • 259 replies
  • February 14, 2024

Hey @Naveen Boga , thank a lot for your help. Just to know whether you added the code by using graph extension or DAC Extension?


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