• Rajnish Bishnoi 13
  • NEWBIE
  • 25 Points
  • Member since 2016

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

I have a soql query where I am using custom labels to specify the date range in string example : THIS_WEEK or something else in future and binding it to the lastmodified date time. when I bind it throws me the below error any thoughts would be appreciated.
In apex

soql query :
  Select status ,CaseNumber,Priority from case where LastModifiedDate =:Label.Thisweek (Thisweek contains a value : THIS_WEEK)

error : Invalid bind expression type of String for column of type Datetime 
 
  • July 22, 2016
  • Like
  • 0
Hi ,

I am not able to get record in query in test class if i am providing the 3rd reference filter in query.
But if i am not providing the filter in query then i am able to get the record and i can access thet 3rd reference data also.
Not able to understand what is the issue with query filter.... please help.
My query is on User and i am providing filter on Custom object which is related to user through Contact Object.

Thanks,
Rajnish
Hi ,

I am not able to get record in query in test class if i am providing the 3rd reference filter in query.
But if i am not providing the filter in query then i am able to get the record and i can access thet 3rd reference data also.
Not able to understand what is the issue with query filter.... please help.
My query is on User and i am providing filter on Custom object which is related to user through Contact Object.

Thanks,
Rajnish
Hi,

I have a soql query where I am using custom labels to specify the date range in string example : THIS_WEEK or something else in future and binding it to the lastmodified date time. when I bind it throws me the below error any thoughts would be appreciated.
In apex

soql query :
  Select status ,CaseNumber,Priority from case where LastModifiedDate =:Label.Thisweek (Thisweek contains a value : THIS_WEEK)

error : Invalid bind expression type of String for column of type Datetime 
 
  • July 22, 2016
  • Like
  • 0
Hi,

I am getting error for list remove() method.

Error :
Compile Error: Method does not exist or incorrect signature: [List<Services_and_Equipment__c>].remove(Services_and_Equipment__c)


I am comparing two lists. Based on some condition adding the values in new list.
I want to then remove these values from older list (the values which are added to new list).
Below is the code.
for(Services_and_Equipment__c varAdd : lst_Add_SE) {
    for(Services_and_Equipment__c varDisc : lst_Disconnect_SE) {
       if(varAdd.Services_and_Equipment_Name__r.Service_Type__c 
          ==  varDisc.Services_and_Equipment_Name__r.Service_Type__c) {
                     lst_AddDisconnect_SE.add(varAdd); 
                     lst_AddDisconnect_SE.add(varDisc); 
                     lst_Complex_SE.remove(varAdd);  
                     lst_Disconnect_SE.remove(varDisc);
       }                        
    }     
}
Thanks.

 
Hi Experts,

I am really new in apex class. I hope you can help me, I created a batch job to create/insert Account List records.
Link to my batch job question: http://salesforce.stackexchange.com/questions/132504/help-in-converting-my-apex-class-to-batch-job?noredirect=1#comment188702_132504

This Account List has Account List Item (RELATIONSHIP: Master-Detail)
Here is the code of my Account List Item
 
public with sharing class Eisai_InsertAccountListItem_cls{
    List<Account_List_Item_vod__c> toInsertAcctListItem = new List<Account_List_Item_vod__c>();
    List<Account_List_vod__c> allHOAccountList = new List<Account_List_vod__c>();
    List<Affiliation_vod__c> allAffiliationList = new List<Affiliation_vod__c>();
    List<Affiliation_vod__c> allChildAffList = new List<Affiliation_vod__c>();
    List<User> usersIdList; 
    Set<Id> usersIdSet = new Set<Id>();
    Set<String> affToAcctValSet = new Set<String>();
    Set<String> allHOAccountListName = new Set<String>();

    public Eisai_InsertAccountListItem_cls(){


        for (Affiliation_vod__c allAffiliationList : [SELECT ID, OwnerId, Name, From_Account_vod__c, To_Account_Value__c FROM Affiliation_vod__c 
                                                                                WHERE Parent_vod__c = false
                                                                                AND OwnerId IN:getActiveUsers()])
        {
            if(!affToAcctValSet.contains(allAffiliationList.To_Account_Value__c)){
                  allChildAffList.add(allAffiliationList);
                affToAcctValSet.add(allAffiliationList.To_Account_Value__c);
            }
        }

        for (Account_List_vod__c allHOAccountListQuery : [SELECT Id, OwnerId, Name, Name_Substring__c FROM Account_List_vod__c 
                                                                                                      WHERE Name_Substring__c IN :affToAcctValSet]){
            allHOAccountList.add(allHOAccountListQuery);
        }

            for(Affiliation_vod__c affRec: allChildAffList)
                for(Account_List_vod__c allHOAccountListInsert : allHOAccountList){
                    if(allHOAccountListInsert.Name_Substring__c.equals(affRec.To_Account_Value__c)){ 
                  //     &&  allAffiliationList.OwnerId.equals(allHOAccountListInsert.OwnerId)){
                        Account_List_Item_vod__c AccListItem = new Account_List_Item_vod__c(
                              Account_List_vod__c = allHOAccountListInsert.Id,
                              Account_vod__c = affRec.From_Account_vod__c
                        );
                        toInsertAcctListItem.add(AccListItem);
                     }
                }

    Database.SaveResult[] srList = Database.insert(toInsertAcctListItem, false);

    for (Database.SaveResult sr: srList){
        if(sr.isSuccess()){
            System.debug('Inserted Account List Item Id: ' + sr.getId());
        } else {
            for(Database.Error err : sr.getErrors()){
            System.debug(err.getStatusCode() + ': ' + err.getMessage());
        }
               }
    }


}//end of Constructor

    public Set<Id> getActiveUsers(){

        usersIdList = new List<User>([SELECT Id
                                      FROM User
                                      WHERE (Profile_Name_vod__c LIKE '%Eisai_Epilepsy%' 
                                             OR Profile_Name_vod__c LIKE '%Eisai_PrimaryCare%'
                                             OR Profile_Name_vod__c LIKE '%Eisai_System%') 
                                      AND IsActive = TRUE]); 

        for(User users : usersIdList){
            usersIdSet.add(users.Id);  
        }
        return usersIdSet;
    }
}//end of Class

I am receiving an error message like this below:

User-added image

Note: There are many child affiliation record (Parent = False) with 1 To_Account_vod_value(Account Name) and but different From_Account_vod (Person Accounts) So I tried to limit to get only 1 record (To_Account_vod_value) by this line of codes:
 
for (Affiliation_vod__c allAffiliationList : [SELECT ID, OwnerId, Name, From_Account_vod__c, To_Account_Value__c FROM Affiliation_vod__c 
                                                                        WHERE Parent_vod__c = false
                                                                        AND OwnerId IN:getActiveUsers()])
{
    if(!affToAcctValSet.contains(allAffiliationList.To_Account_Value__c)){
          allChildAffList.add(allAffiliationList);
        affToAcctValSet.add(allAffiliationList.To_Account_Value__c);
    }
}

Thanks 
Marion
Hi All,

i want to display  some other web pages or UI pages of some other website in salesforce UI using canvas, any one has knowldge of canvas please share it and help to complete.