• Jesus Lorca Apps
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies

Hi, I am trying to query a custom setting but I am getting a very weird behaviour in a MANAGE package. Let's explain the case:

- Hierarchical Custom setting with a boolean field.
- VF page with a embedded LC. We do have a method in the controller to send emails. Through the boolean field we decide which behaviour we do want to have when sending emails.

- When I call the method to send emails from the LC, within the logic I query the boolean field from the custom setting, and then I have an if-else statement to decide the logic.

(the way I query the custom setting is:)

private static Boolean isQuarantineModeEnabled() {

MyCustomSetting__c config = MyCustomSetting__c.getInstance();

return config.MyBooleanField__c;

}

 

The "funny" thing that I don't understand is the fact that, after installing the manage package in a subscriber org, setting the right value to the custom setting boolean field, once I call the method to send emails from the LC, it does not work well  , although in the database the field has the right value, but for some reason salesforce still keeps the old value cached, and the if-else statement is not executed well.

 

Moreover, if from the developer console I just execute the anonymous apex, to refresh it:

MyCustomSetting__c.getInstance();   // NO updates in the database

 

then when I try to send emails again, it works, and it has the expected behaviour (the if-else statement works well). But unfortunately, after a while, it is stops working again, and you have to "refresh" it again. 

 

I am getting lost because of this as I have no idea why I am getting this behaviour. Does anybody have an idea about this? would be very useful! 

Hi To Everyone,

I am new to salesforce so not much aware about all the apex class coding and visula force. so sorry if i am asking something is silly.

My issue is that.
I have created custom object sat name Registration where i have created 1 field name "Profile_Form" .
now on  Registration layout i want to show all Profile list (profile that we craeted in user) on field "Profile_Form" to select. 
If i am using picklist, there i can list out onlt current available all profile list ,but in future  new profile could be added and old could be edited ,in that condition custom picklist will not work.

So i want the way to show list of all profiles on my custom field.


Please suggest.

​Thanks in advance,