• Priyanka Bardhan
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 1
    Replies
DML can be done using attribute allowDML="true" to component.
But as per my understanding, DML can't be done for below cases:
  • You can't use data manipulation language (DML) operations in a “getxxx” method in a controller.
  • You can't use data manipulation language (DML) operations in a constructor method in a controller.
  • You can't use the @future annotation in a “getxxx” or “setxxx” method in a controller, or in the constructor for a controller.

Question: Whether Visualforce email templates allow you to include visualforce components with allowDML="true" and is there any way to actually do DML in case of any error scenario? My requirement is do insert error logs in case of any errors happened /blank PDF generated?

Thanks & Regards,
Priyanka Bardhan
Hi All,
Can anyone help on the below?

Since we can't use text area fields in SOQL filter criterias, the alternative approach is to fetch all records and then iterate (using for loop) to check filter criteria using below snippet.
 
List<Account> filteredaccounts = new List<Account>();
for(Account act : [select id, name, textareaids__c from Account) {
    if(act.textareaids__c.contains('developer test')) {
        filteredaccounts.add(act);
    }
}
But how to do in case of comparing long text area with set of ids?
Example - 

textareaids__c = 'id1, id2, id3, id5';
Set variable which contains id4, id5, id3.

Here I want to compare and match inside for loop to get the filtered accounts. Since we got a match of id3 and id5, store the account record in list.


 
Hi,
Can anyone please help with OR condition in SOSL?
I am trying to find ids in Custom Object records. Below snippet I am trying in workbench. I tried with double quote also, but it didn't work. Please note ids contains hypen.

List<List<sObject>> instanceRecs = [FIND {'7675675670-6795-4621-817e-74a6b056556' OR '56524ab-eaaf-4eb2-bccf-85bfd565650'} IN ALL Fields Returning Instance__c];

Also, whether it is possible to search set of ids in SOSL?

Thanks,
Priyanka
Hi All,
 
Can anyone please help on the below approach?

Requirement - There is a custom object with 2 fields - Categories, Areas and both fields are of Long text area datatype. Both the fields stores comma separated values same like below:
 
Table structure records in those fields are like below:
 
ID       |      Categories               |    Areas
Rec1        C1, C2, C3, C4...               A1, A2, A3, A4...
Rec2        C2, C3, C7, C8                  A4, A5, A6, A9
 
Requirement is if user is trying to key new selections with combinations of category and area which already exists in above table then it should show validation.
 
Example - If user is trying to key C2, C4, C7, C8 and Area A3, A4, A6 then it should give an error message. 
Validation will be checking the combinations using the selections made during keying:
C2-A3, C2-A4, C2-A6
C4-A3, C4-A4, C4-A6
C7-A3, C7-A4, C7-A6
C8-A3, C8-A4, C8-A6
Above combinations needs to be validated with the table records combinations same format.
Solution Approach:
1. Implement static methods to do Salesforce SOQL query to get all the records first.
Define Static set and map variables. Set variable will be to define the combinations and Map will be if we want to have the record along.
2. Implement the below method to collect the values from comma separated to set list.
  
    public static Set<String> storeValuesInSet(String fieldValue){
        Set<String> value_lst = new Set<String>();
        //split the values and put them in a set.
        String[] values = fieldValue.split(',');
        for (Integer x = 0; x < values.size(); x++){
             value_lst.add(String.valueOf(values[x]));
         }
        return value_lst;
    }
3. The values will be stored during for loops. One for loop will be to iterate through the object records. Since fields are long text area and value is comma separated, inside first for loop will call the method storeValuesInSet and then iteratinfg
Set<String> uniqueKeys = new Set<String>();
Below will be map values:
Rec 1, Set< C1-A1, C1-A2, C1-A3, C1-A4 >
Rec 1, Set< C2-A1, C2-A2, C2-A3, C2-A4 >
Rec 1, Set< C3-A1, C3-A2, C3-A3, C3-A4 >
Rec 1, Set< C4-A1, C4-A2, C4-A3, C4-A4 >
Rec 2, Set< C2-A4, C2-A5, C2-A6, C2-A9 >
Rec 2, Set< C3-A4, C3-A5, C3-A6, C3-A9 >
Rec 2, Set< C7-A4, C7-A5, C7-A6, C7-A9 >
Rec 2, Set< C8-A4, C8-A5, C8-A6, C8-A9 >
2. Once user clicked save button, we can use contains method of set variable to find duplicates.
 
Please let me know if there is any other good way for achieving this or whether the above is correct approach?.Thanks for your help. 
 
Thanks & Regards,
Priyanka
Whether it is possible to add standard account logo image of salesforce in visualforce page and also customizing the text in that logo ?

When an authenticated user on our site clicks on "logout" and is sent to the /secur/logout.jsp they see the message "You are now logged out".

Whether it is possible to customize this message?

I would like to know if it possible to perform ApexPages.StandardSetController(List<List<SObject>>) for SOSL?

 

Regards,

Priyanka

Hi All,
 
Can anyone please help on the below approach?

Requirement - There is a custom object with 2 fields - Categories, Areas and both fields are of Long text area datatype. Both the fields stores comma separated values same like below:
 
Table structure records in those fields are like below:
 
ID       |      Categories               |    Areas
Rec1        C1, C2, C3, C4...               A1, A2, A3, A4...
Rec2        C2, C3, C7, C8                  A4, A5, A6, A9
 
Requirement is if user is trying to key new selections with combinations of category and area which already exists in above table then it should show validation.
 
Example - If user is trying to key C2, C4, C7, C8 and Area A3, A4, A6 then it should give an error message. 
Validation will be checking the combinations using the selections made during keying:
C2-A3, C2-A4, C2-A6
C4-A3, C4-A4, C4-A6
C7-A3, C7-A4, C7-A6
C8-A3, C8-A4, C8-A6
Above combinations needs to be validated with the table records combinations same format.
Solution Approach:
1. Implement static methods to do Salesforce SOQL query to get all the records first.
Define Static set and map variables. Set variable will be to define the combinations and Map will be if we want to have the record along.
2. Implement the below method to collect the values from comma separated to set list.
  
    public static Set<String> storeValuesInSet(String fieldValue){
        Set<String> value_lst = new Set<String>();
        //split the values and put them in a set.
        String[] values = fieldValue.split(',');
        for (Integer x = 0; x < values.size(); x++){
             value_lst.add(String.valueOf(values[x]));
         }
        return value_lst;
    }
3. The values will be stored during for loops. One for loop will be to iterate through the object records. Since fields are long text area and value is comma separated, inside first for loop will call the method storeValuesInSet and then iteratinfg
Set<String> uniqueKeys = new Set<String>();
Below will be map values:
Rec 1, Set< C1-A1, C1-A2, C1-A3, C1-A4 >
Rec 1, Set< C2-A1, C2-A2, C2-A3, C2-A4 >
Rec 1, Set< C3-A1, C3-A2, C3-A3, C3-A4 >
Rec 1, Set< C4-A1, C4-A2, C4-A3, C4-A4 >
Rec 2, Set< C2-A4, C2-A5, C2-A6, C2-A9 >
Rec 2, Set< C3-A4, C3-A5, C3-A6, C3-A9 >
Rec 2, Set< C7-A4, C7-A5, C7-A6, C7-A9 >
Rec 2, Set< C8-A4, C8-A5, C8-A6, C8-A9 >
2. Once user clicked save button, we can use contains method of set variable to find duplicates.
 
Please let me know if there is any other good way for achieving this or whether the above is correct approach?.Thanks for your help. 
 
Thanks & Regards,
Priyanka