Hi @Giri K
On the Relations grid Document field uses EntityIDSelectorAttribute to Search for data. This attribute is looking for target DAC NoteID PXNote attribute. PXNote attribute should contains 2 properties: Selector and ShowInReferenceSelector. I haven’t found a way how to override NoteID attribute but we can override EntityIDSelectorAttribute.
public class EntityIDSelectorExtAttribute : EntityIDSelectorAttribute
{
public EntityIDSelectorExtAttribute(Type typeBqlField) : base(typeBqlField)
{
}
protected override void CreateSelectorView(PXGraph graph, Type itemType, PXNoteAttribute noteAtt, out string viewName, out stringt] fieldList, out stringt] headerList)
{
if (itemType == typeof(INRegister))
{
noteAtt.Selector = typeof(Search<INRegister.refNbr, Where<INRegister.docType, Equal<INDocType.transfer>>>);
noteAtt.ShowInReferenceSelector = true;
}
base.CreateSelectorView(graph, itemType, noteAtt, out viewName, out fieldList, out headerList);
}
}
// Acuminator disable once PX1016 ExtensionDoesNotDeclareIsActiveMethod extension should be constantly active
public class OpportunityExt : PXGraphExtension<OpportunityMaint_CRRelationDetailsExt, OpportunityMaint>
{
public PXSelect<INRegister> INRegister_Dummy;
EntityIDSelectorExtAttribute(typeof(CRRelation.targetType))]
PXMergeAttributes(Method = MergeMethod.Merge)]
protected virtual void _(Events.CacheAttached<CRRelation.targetNoteID> e) { }
CRRelationDetail(
statusField: typeof(INRegister.status),
descriptionField: typeof(INRegister.tranDesc),
ownerField: null,
documentDateField: typeof(INRegister.tranDate))]
PXMergeAttributes(Method = MergeMethod.Append)]
protected virtual void _(Events.CacheAttached<INRegister.refNbr> e) { }
}