How to limit the dropdown choices on a record producer

Sanket Pawar
Tera Contributor

I have a quick link added on portal "submit a request" under a topic "procurement", when I will click on that link it will redirect me to a record producer and on the record producer there is a category filed which has multiple choices.

 

The requirements here is that, when i will click on "submit a request" link  from the procurement tab then only 1 choice should be visible for example "x" and other choices should be hidden in category dropdown, but if i click the same link from any other topic or section then ,the category field should show all the choices.

 

Any guidance will be helpful!

3 REPLIES 3

Sainath N
Mega Sage
Mega Sage

@Sanket Pawar : As the URL's will be different while coming to this record producer from different places, you can use the URL to identify and add the logic to delete the options.

 

Below is the code. I tried to differentiate between the native UI and the portal.

 

function onLoad() {
    var url = top.location.href.toString();
    if (url.indexOf('/sp') < 0) { // '/sp' can be replaced with the differentiator you find between your two URL's.
        alert('Native UI');
    } else {
        alert('Portal'); // Add your logic here to remove options
    }
}

 

Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.

Sanket Pawar
Tera Contributor

Hi @Sainath N ,

But in this case there is no differentiator in 2 URLs.

I have 2 tabs 

1)procurement ->submit a request link 

2)Finance >submit a request link 

both the links are same but what i have observed that both the tabs have a unique topic id in the url, which gets dissppeared when click on the submit a request link

is there any way to copy the topicid/sysid from previous tab and compare it to the other page after redirection?

@Sanket Pawar : In this case, I can think of only duplicating the record producer and making each one available in the required category of the service portal.

Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.