You need to sign in to do that
Don't have an account?
Nurav1982
Custom Setting vs AJAX/Javascript
Hello All,
I have this following requirement.
I need to expose a button on a non-VF page.
Upon clicking the button, I need to check values from two fields (which are exposed in the page layout) say F1 and F2.
If the fields' value combination do exist from an approved list of combinations then I need to call TIBCO else I need to pop up an error message.
We cannot change the page , in which the button will be placed, as a VF page.
The fields F1 / F2 are hierarchial picklists.
Eg :
Say the approved List of combinations for F1,F2 are as follows {A,1} {A,2} {A,3}
F1 can have {A,B}
F2 can have {1,2,3,4,5}
Scenario #1 : User has chosen {A,1} and presses this custom button then TIBCO needs to be called
Scenario #2 : User has chosen {B,1} and presses this custom button then error message needs to be shown to the user.
(
***{B,1} is selectable while creating a record because it is supported in the hierarchial picklist combination. But for this ***specific*** functionality, the combination {B,1} is not supported
)
I thought of doing the below for this requirement
Approach #1 : Custom Object/AJAX/Javascript
a) Create a custom object that houses the valid list of combinations.
The custom object will have two custom fields F1,F2 containing only valid combinations.
b) Create a button in the page layout
c) When the user presses the button, use AJAX/Javascript to issue a SOQL SELECT to the custom object from step a).
c-1 : If I find a record from the custom object then call TIBCO
c-2 : If I dont find a record from the custom object then popup an error message
Approach #2 : Custom setting
My colleague has suggested me to try out with custom settings instead of the above route but I am not so sure about using that.
Also how different it would be from approach #1 even if I go with custom setting.
Can you guys provide your inputs ?.
Is approach #1 better or approach #2 better ?
Thanks in advance for your time !
Nurav
I have this following requirement.
I need to expose a button on a non-VF page.
Upon clicking the button, I need to check values from two fields (which are exposed in the page layout) say F1 and F2.
If the fields' value combination do exist from an approved list of combinations then I need to call TIBCO else I need to pop up an error message.
We cannot change the page , in which the button will be placed, as a VF page.
The fields F1 / F2 are hierarchial picklists.
Eg :
Say the approved List of combinations for F1,F2 are as follows {A,1} {A,2} {A,3}
F1 can have {A,B}
F2 can have {1,2,3,4,5}
Scenario #1 : User has chosen {A,1} and presses this custom button then TIBCO needs to be called
Scenario #2 : User has chosen {B,1} and presses this custom button then error message needs to be shown to the user.
(
***{B,1} is selectable while creating a record because it is supported in the hierarchial picklist combination. But for this ***specific*** functionality, the combination {B,1} is not supported
)
I thought of doing the below for this requirement
Approach #1 : Custom Object/AJAX/Javascript
a) Create a custom object that houses the valid list of combinations.
The custom object will have two custom fields F1,F2 containing only valid combinations.
b) Create a button in the page layout
c) When the user presses the button, use AJAX/Javascript to issue a SOQL SELECT to the custom object from step a).
c-1 : If I find a record from the custom object then call TIBCO
c-2 : If I dont find a record from the custom object then popup an error message
Approach #2 : Custom setting
My colleague has suggested me to try out with custom settings instead of the above route but I am not so sure about using that.
Also how different it would be from approach #1 even if I go with custom setting.
Can you guys provide your inputs ?.
Is approach #1 better or approach #2 better ?
Thanks in advance for your time !
Nurav
Custom settings will be preferred, when the same thing needs to be performed in an apex controller class.
Regards,
- Harsha
All Answers
Custom settings will be preferred, when the same thing needs to be performed in an apex controller class.
Regards,
- Harsha
Thanks for your inputs.
I guess I have to take approach #1 because the page is a non-VF page and I cannot be using apex controller for implementing the desired functionality.
But do you believe anything else could be done or the approach #1 is the only way for this scenario.
Your inputs are appreciated :)
Thanks
Nurav
There are other but thay need to have a separate vf page and controller cretaed. So, better go with Approach #1.
Regards,
- Harsha