• Hari N 20
  • NEWBIE
  • 60 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 13
    Questions
  • 12
    Replies
Hi All,
I am getting error as following : IN operator must be used with an iterable expression .
My code is : 
List<Task> ts1=[Select Id,WhoId from Task];
    for(Task ts2 : ts1){
    Map<ID, Obj1__c> mapAccounts = new Map<ID, Obj1__c>([SELECT Id, Name, Filed1__c  FROM Obj1__c WHERE                                                                                                               Field1__r.Id IN: ts2.whoId]);
}
Filed1__c is lookup to account.
How to resolve this?

Thanks in Advance
Hi All,
I am inserting data into task object using batch apex from one object.
I have to fill more fields in task object but they are in different object.
I want to write trigger for this.
When I am filling from object1, I am mapping account name also.
Now, In second object also I have account name.
When I am filling remaining data, I want to map these data with same account name.
How to do this.

Thanks in Advance
Hi All,
I have one custom object under account related list.

How to retrieve that custom object fields using single SOQL query? 
Hi,
I am getting following error while running batch apex manuaaly.

Line: 5, Column: 3
expecting a semi-colon, found '707'

Code is : Id 807N000000i4ljj= Database.executeBatch(new BatchClassName(), 200);

Please help me
I have one custom object and I have custom field which is lookup to account in the same object.
When record inserted in this custom object, I want create a task under open activities in account object. (Task shoud get create under same name of the account which we select from lookup field in custom object)

I want to write trigger for the same.
Please share syntax, if any one has syntax.
Hi All,
I have one custom object. When ever I insert record on that custom object, I want to create a task in open activities of account object.
I want to write batch apex for this.
How can I achieve this?
Please share syntax for the same if you have.

Thanks in Advance

Regards,
Hari
Hi All,
I want to generate records from one object into another object. I have written a trigger for this and working fine.
I want this output in batch apex form
What ever I get the records in object1 today, I want a schedule batch apex that all records should get create in object2 at Midnight only.
How can I do this?
Please provide me syntax

Thanks in Advance

Regards,
Hari
Hi All,
I have written a trigger on Account.
I am storing mutiple phone number values in phone number field and I am splitting those values into three different fields.
It is working fine. If I update any phone number in phone field, I want to see the same change in those fields. This updation is not working.

Please suggest me the changes

This is the code I have written.

trigger AccountPhoneTrigger on Account (before insert) {
 List<String> descriptionValues;
 List<Id> accountIds = new List<Id>(); 
        for(Account acc: Trigger.New){
        if(!String.isBlank(acc.Phone)){
           descriptionValues = acc.Phone.split(',');
            
           for(Integer count = 0; count < descriptionValues.size(); count ++){
                    acc.Pho1__c = descriptionValues[0].trim();
                       acc.Pho2__c = descriptionValues[1].trim();
                       acc.Pho3__c = descriptionValues[2].trim();
                        
           }
        }
            
   
    }
}
Hi All,
I want insert record and update record.
When I create a record in Account, I want create same record in Contact also.
I want to Update the same record in Account and the contact also should update.

Please share if any one has syntax for this.

Thanks in Advance

Regards
Hari
Hi All,
I want to convert to today date into only day.

For example, date is 10/24/2016 and it is monday then I want to concert this date as monday and want to store in a string.
Please help me.
Please provide syntax for the same

Thanks in Advance

Regards
Hari
Hi,
I have two objects. Object1 and Object2.
I have 10 fields in object1. After creating a record in object1, I want to create a record in Object2.
I want only 3 field values from Object1.
If anyone have code syntax, please share.

Thanks in Advance

Regards,
Hari
Hi
I have a checkbox in case. When I checked this checkbox, I want to automatically close the case after one day.
Please suggest me how to do it?
I tried using new task, but it is not working.

Thanks in Advance

Regards
Hari

Hi All,
I have created a Email service to create a record in a custom object with a attachment from any email.
I have two field in this object, one email field and one rejected checkbox.
In email field, sender of email address will populate.
Now, when ever I selects rejected checkbox, I want to send a auto - email back to the sender with the same attachment which is in the same notes & attachmentment section of that record.

Please suggest best approach to solve this

Thanks in Advance

Hi All,
I want to generate records from one object into another object. I have written a trigger for this and working fine.
I want this output in batch apex form
What ever I get the records in object1 today, I want a schedule batch apex that all records should get create in object2 at Midnight only.
How can I do this?
Please provide me syntax

Thanks in Advance

Regards,
Hari
Hi All,
I have written a trigger on Account.
I am storing mutiple phone number values in phone number field and I am splitting those values into three different fields.
It is working fine. If I update any phone number in phone field, I want to see the same change in those fields. This updation is not working.

Please suggest me the changes

This is the code I have written.

trigger AccountPhoneTrigger on Account (before insert) {
 List<String> descriptionValues;
 List<Id> accountIds = new List<Id>(); 
        for(Account acc: Trigger.New){
        if(!String.isBlank(acc.Phone)){
           descriptionValues = acc.Phone.split(',');
            
           for(Integer count = 0; count < descriptionValues.size(); count ++){
                    acc.Pho1__c = descriptionValues[0].trim();
                       acc.Pho2__c = descriptionValues[1].trim();
                       acc.Pho3__c = descriptionValues[2].trim();
                        
           }
        }
            
   
    }
}
Hi All,
I am getting error as following : IN operator must be used with an iterable expression .
My code is : 
List<Task> ts1=[Select Id,WhoId from Task];
    for(Task ts2 : ts1){
    Map<ID, Obj1__c> mapAccounts = new Map<ID, Obj1__c>([SELECT Id, Name, Filed1__c  FROM Obj1__c WHERE                                                                                                               Field1__r.Id IN: ts2.whoId]);
}
Filed1__c is lookup to account.
How to resolve this?

Thanks in Advance
Hi All,
I have one custom object under account related list.

How to retrieve that custom object fields using single SOQL query? 
Hi All,
I want to generate records from one object into another object. I have written a trigger for this and working fine.
I want this output in batch apex form
What ever I get the records in object1 today, I want a schedule batch apex that all records should get create in object2 at Midnight only.
How can I do this?
Please provide me syntax

Thanks in Advance

Regards,
Hari
Hi All,
I want insert record and update record.
When I create a record in Account, I want create same record in Contact also.
I want to Update the same record in Account and the contact also should update.

Please share if any one has syntax for this.

Thanks in Advance

Regards
Hari
Hi,
I have two objects. Object1 and Object2.
I have 10 fields in object1. After creating a record in object1, I want to create a record in Object2.
I want only 3 field values from Object1.
If anyone have code syntax, please share.

Thanks in Advance

Regards,
Hari

Hi All,
I have created a Email service to create a record in a custom object with a attachment from any email.
I have two field in this object, one email field and one rejected checkbox.
In email field, sender of email address will populate.
Now, when ever I selects rejected checkbox, I want to send a auto - email back to the sender with the same attachment which is in the same notes & attachmentment section of that record.

Please suggest best approach to solve this

Thanks in Advance