New UI - Conditional Main Lookup/Link Lookup

Posted by Meryk on 25-Sep-2015 03:27

Hello,

I have a quick create page with 3 lookups. Let's Say "lookupA", "lookupB" and "lookupC". 

lookupA is a selector, the two others are picklists.

Here is what I want to achieve :

If (lookupB is not empty){

lookupC is a link lookup on B

}

else{

lookupC is a link lookup on A

}

Knowing that A will always have a value as it is required.

Am I being clear? Not sure if this makes sense ..

The only method I can see now is rbf_setLookupFilter. But not sure how I can use this for my case.

Any suggestions please?

Thank you

Meryem

All Replies

Posted by jsniemi79 on 25-Sep-2015 07:54

Meryem,

The rbf_setLookupFilter is what you would use to accomplish what you are trying to do. I haven't done it with multiple fields, so I can't say for sure, but I don't see why it wouldn't work.  One thing to note, lookupA coulld  be a picklist or selector, but lookupB and LookupC must be selectors for this to work.  That is a requirement of the setLookupFilter api.

You would need to add a script component to your page that contains a function with the logic you listed above, using the setLookupFilter api.  Then, add a call to the page load to call that function and pass in the appropriate value if it is already populated (Edit Page).  You would also need to go into the events for the LookupA and LookupB and make a call to the function on change and pass in their value.  Something like "setLinkLookups(this.value);"

Does that help answer your question?

Posted by Meryk on 29-Sep-2015 04:49

Hi Jsniemi

This method only applies to SELECTOR type lookup fields and cannot be used for dependent lookups, as said in the documentation : documentation.progress.com/.../

I need to filter a picklist based on the conditions listed above. I tried this method and it is not filtering the picklist.

Any help with that ?

Thanks,

Meryem

Posted by jsniemi79 on 29-Sep-2015 08:48

Meryem,

You are correct, that API will only work if the dependent is a selector, not a picklist. I  don't believe there is a built in API to handle what you are trying to accomplish if they must remain picklists.  I'm sure there is a way to handle it through code, but I haven't gone down that path.  Hopefully someone else can chime in.

Sorry,

Jason

Posted by Mohammed Siraj on 29-Sep-2015 11:07

There are some limitations with rbf_setLookupFilter, as discussed above.

Works only against Lookup fields which are configured as Selector's.

Cannot be used, if there is already a link lookup field in the page.

For the above use-case, will consider it as an enhancement & address in forthcoming releases.

Posted by Meryk on 02-Dec-2015 06:19

Has anything been done on this please?

I will add this is the ideas sections as well.

Thank you

Meryem

Posted by Mohammed Siraj on 03-Dec-2015 00:33

An enhancment in this regard has already been filed & is targetted for Rollase 2016 Q1 release.

Posted by IramK on 13-Apr-2016 10:07

Has this been made available in the 4.2 release?

Iram

This thread is closed