Announcements
Added a new field on my form group. now i have added code and created a display method with the following code .I just want to add filter on this display field to search record.
any suggestions?
[ExtensionOf(formStr(BankAccountTrans))] final class BankAccountTrans_ScmFormCust_Extension { [SysClientCacheDataMethodAttribute(true)] public static display InvoiceId markedInvoice (BankAccountTrans _this) { return LedgerJournalTrans::findJournalForVoucher(_this.Voucher,_this.TransDate).MarkedInvoice; } }
Context method is called when user right click on field and gets the context menu with options. As per below article, Options to 'Filter by Field', Filter by Selection were added in the code.
You are adding display method on the standard form - If it's your custom form you can override the context method of display method control. But since it's a standard form there is no event available for context method.
But you can write COC for context method.
[Extensionof(formControlStr(FormName, ControlName))] internal final class ClassName_Extension { public void context() { next context(); //add the code as mentioned in the blog. } }
I am not sure about adding the filter to display method on the blog you posted. But you can give it a try and let us know the output.
Thanks,
Girish S.
Hi Girish,
found this, article for adding search filter on display field. Can you help me understand how "Override Context method of Form control " while I am doing form customization.
according too my knowledge i can not override a method while I'm customizing a form.
got you. Thanks for reply .
My suggestion will be hiding the current grid and creating a new grid with all the available fields along with the fields from the view.
Thanks,
Girish S.
i totally understood what you are saying, but in my case i have added field into "Field group" of table as i wan to add field inside the field group .
but when i will create a view (the view field will be added into the grid ) its field will be added on "form grid" outside the field group. I have to add the field in "field group". in that case , what will be the scenario?
any guidance?
Hi, You can refer this article on how to implement Girish's suggestion.
Hi Junaid,
You cannot add search filter for display method. Thats the drawback of display method.
To avoid this, you can create a view for the display method and add that view as form DataSource. You can add the fields from the view to the design and you will have filter automatically.
Thanks,
Girish S.
André Arnaud de Cal...
294,165
Super User 2025 Season 1
Martin Dráb
232,968
Most Valuable Professional
nmaenpaa
101,158
Moderator