• sonam guptha
  • NEWBIE
  • 50 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 27
    Questions
  • 67
    Replies
Hi,

 I have 2 profiles  profile 1 and profile 2, Here profile 1 data users don't want to see profile 2 users data,at the same time e profile 2 users data don't want to view by profile 1 data users.how can we achieve it.

 I really appreciate quick responses.

Thanks
HI,

-Iam struggling with problem please provide me some solution.
-how can we create three tabs in a single visual force page and that 3 tabs need to show different values on the page on a Account Search?

for example:

iam searching Account ‘Wipro’ on that particular visual force page,as result i have to show the different values on the three tabs?
search ————> Account ‘Wipro’

Result should be like :—

tab 1          tab 2        tab3
  |             |             |
  |             |             |
  |             |             |
Avg         sum        startdate
of           of           of 
Account      Account     Account   
Thanks In Advance!
HI,

iam trying to send an email notification based on custom column,so here i have to send an email when my EndDate__c is less than 60 days,the below code is working fine but its grabing few accounts even more than 60 days,can i get any help to fix it?

i think iam not calculating right value here?
if(m.EndDate__c.daysBetween(D) < 60 )
global class expireNotify implements Database.Batchable<sObject> {
   global Database.QueryLocator start(Database.BatchableContext bc) {
       //Date d = Date.today()+90;
       String soql = 'SELECT EndDate__c, Name FROM Account WHERE EndDate__c !=NULL';
       return Database.getQueryLocator(soql);
   }
  
   global void execute(Database.BatchableContext bc, List<account> recs) {
       List<Messaging.SingleEmailMessage> mailList = new List<Messaging.SingleEmailMessage>();
       Date D =Date.today();
                  Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
                    List<String> toAddresses = new List<String>();
                    String messageBody;
                    list<string> accstring =new list<string>();
                    integer i=0;
       for(account m : recs) {
           if(m.EndDate__c.daysBetween(D) < 60 )
           {
                  i+=1;    
           
            messageBody = i+'-->'+ m.Name ;
            accstring.add(messageBody );           
           }    
       }                
       toAddresses.add('spnvarun0121@gmail.com');
           mail.setToAddresses(toAddresses);
           mail.setSubject('Welcome to Sweet 16 Siebel Batch');
           string allstring = string.join(accstring,'<br/>');
       mail.setHtmlBody('<html><body>Hi Sir Hope you are well <br>'+'<br> List of accounts <br>'+allstring + ',<br>Your accounts Expires today. <br>Kindly contact your administrator.<br><br><b>Regards,</b><br>Magulan D<br/></body></html>'); 

                  mailList.add(mail);   

       Messaging.sendEmail(mailList);
   }
  
   global void finish(Database.BatchableContext bc) {
   }
}


 
HI

Below is my trigger iam counting child records based and prinitng on parent object,but one error iam seeing if there are no child objects with that picklist value still its showing count as 1,i wanted to show the value as zero,if no records present on it,please help me out
trigger requirementsTrigger on Requirements__c (after insert, after update) {
    List <Id> progIds = new List<Id> ();
    List <Programs__c> programs = new List<Programs__c>();
    List <AggregateResult> requirements = new List<AggregateResult>();
    
    for(Requirements__c req:trigger.new){
        progIds.add(req.Programs__c);
    }
    
    programs = [Select Id, Count__c From Programs__c Where Id In :progIds];
    requirements = [Select Programs__c, Count(Id) From Requirements__c Where Programs__c IN: progIds
            AND Waived__c = 'Yes' AND Status__c IN ('Active')
            Group By Programs__c];
    for(AggregateResult ar: requirements){
        for(Programs__c p:programs){
            if(ar.get('Programs__c') == p.Id){
                p.Count__c = Decimal.ValueOf(String.ValueOf(ar.get('expr0')));
            }
        }
    }
    update(programs);
}

 
HI,

Iam afraid as a begginer.
on a account table i have custom field termEndDate__c which was a formula field of type date,so when termEndDate__c is set to less than 90 days on a particular account, i have to send an email with the account name,and this has to done on monthly basis as a schedule and we need to include account name in the email,and has to check all the accounts in my salesforce org should send an email which accounts are less than 90 days. is it possible.please help me out

 
Hi,

Here iam adding sum of revenue__c to account column acc.Finance__c.
for Example :-- 
 if  opportunity.member__c.Revenue__c is 10 
 & opportunity.member__c.Revenue__c is 20
 total = 30 
 this value iam printing on acc.Finance__c column,but now the problem is its keep on adding the values when we are changing the value on same record.
 for example :--
 for the same above record the value is 30.
 if i change the same opportunity.member__c.Revenue__c from 10 to 20
 & opportunity.member__c.Revenue__c is 20
 the value should be 40 but here it counting has 50.
 its counting the old value even.
 can any one help me to resolve it??
 
trigger updateAccount on member__c (After Insert,After update,After Delete,) {
    
    List<Account> UpdateList = new List<Account>();

    Id recTypeFinance = [select Id,name from RecordType where name='Finance' and SObjectType='member__c' limit 1].Id;
    
    string ids;
    if(Trigger.isInsert || Trigger.isUpdate)
    {
        for(Asset__c asst : Trigger.new) {
            if(asst.Opportunity__c != null)
                ids= asst.id;
        }
        
        For(member__c ast:[select Id,Opportunity__c,Revenue__c,RecordTypeId from member__c where ID=:ids]){     
            
            if(ast.RecordTypeId == recTypeFinance){
         for(opportunity opp : [Select Id,AccountId from Opportunity where Id =: ast.Opportunity__c]){
                    for(Account acc : [Select Id,Finance__c from Account where Id =: opp.AccountId]){
                        if(acc.Finance__c == null){
                            acc.Finance__c= ast.Revenue__c;
                        }else{
                            acc.Finance__c += ast.Revenue__c;
                        }
                        UpdateList.add(acc);
                    }
                }
            }
        }
        update UpdateList;
     }