I have this out of the box lookup that has Purchase agreement field not filterable!
I tried to develop a custom lookup using different ways:
1- use a table method
But The Purchase agreement field is empty.. it only shows values if I made the getPurchNumberSequence a display method.. but again I'm not able to apply filter!
2- add a custom query... it doesn't work and the column PurchNumberSequence doesn't appear at all
3- create a view that has the desired fields but it gives the error: AgreementLine isn't a form primary datasource
Your attempt to use fields from different tables in addLookupField() is wrong. addLookupField() adds fields from the table that the SysReferenceTableLookup object was created for.
You believe it adds PurchAgreementHeader.PurchNumberSequence, but in fact, it adds a field from AgreementLine that happen to have the same ID that PurchNumberSequence has in PurchAgreementHeader table. That's clearly wrong.
Also, shouldn't you override FormReferenceControl.lookupReference() instead of lookup()?
Was this reply helpful?YesNo
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.