• abi060988
  • NEWBIE
  • 25 Points
  • Member since 2011

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

 

Hi,

 

How to remove "People, Groups" option from Salesforce Standard Search box?

 

Thanks,
Devendra

trigger Dynamic_Lookup on OpportunityUserAssociation__c(before insert)
{
OpportunityUserAssociation__c myopportunity = trigger.new[0];
String Newuser;
String Flag='No';
Integer LRcount=100;
Integer LRtotcount=100;
Integer RMcount=0;
Integer loopi=0, CurrUserCnt=0, AllUserCnt=0;
AggregateResult[] val;

// changed if condition to send error message only if the opportunity is being assigned to lead recruiter
 
    if(myopportunity.AssignedUser__c == null && myopportunity.AssignedUser__r.UserRole.Name == 'Lead Recruiter' )
    {
        trigger.new[0].AssignedUser__c.addError(' Select User');
    }

if(myopportunity.AssignedUser__c!= null)
{
    
    val = [ Select count(OpportunityUserAssociation__c.AssignedUser__c) cnt from OpportunityUserAssociation__c
    where OpportunityUserAssociation__c.Status__c='Open'
    and OpportunityUserAssociation__c.AssignedUser__c=:myopportunity.AssignedUser__c and  OpportunityUserAssociation__c.AssignedUser__r.UserRole.Name!='Recruiter'];

      for(AggregateResult ar1 : val)
       {
          LRcount = Integer.valueOf(ar1.get('cnt'));
          CurrUserCnt = LRcount + 1;
          if(Integer.valueOf(ar1.get('cnt'))>=3)
           {
               //LRcount = Integer.valueOf(ar1.get('cnt'));
                LRcount = 100;  
                trigger.new[0].AssignedUser__c.addError('Selected LR have maximum Assignments');               
               //breakstart;   
                
               //breakend;
           }         
       }
}
if(CurrUserCnt==3)
{
        LIST<User> UserList = [Select u.Id from User u where
        u.UserRole.Name = 'Lead Recruiter'
        and u.UserRole.ParentRoleId != null
        and u.ManagerId!=null
        and u.ManagerId = :myopportunity.ManagerId__c and u.Id!=:myopportunity.AssignedUser__c];
    
 for(Integer i = 0; i<UserList.size(); i++)
 {
        Newuser = UserList[i].Id;
        //AggregateResult[] val = [Select count(Assign_To__c) cnt from Opportunity where Opportunity.Status__c='Open' and Opportunity.Assign_To__c=:Newuser ];
        val = [Select count(OpportunityUserAssociation__c.AssignedUser__c) cnt from OpportunityUserAssociation__c where OpportunityUserAssociation__c.Status__c='Open' and OpportunityUserAssociation__c.AssignedUser__c=:Newuser ];
        
     for(AggregateResult ar1 : val)
     {
        loopi=loopi+1;
        System.debug('UUser : '+ i + ' : ' +Newuser );
        System.debug('ccount : '+ i + ' : ' +ar1.get('cnt'));
        
         if(Integer.valueOf(ar1.get('cnt'))==3)
          {
            AllUserCnt=1;
          }
          else
          {
            AllUserCnt=2;
            break;
          }
        if(Integer.valueOf(ar1.get('cnt'))<=3)
        {
            LRcount = Integer.valueOf(ar1.get('cnt'));
            LRcount =LRcount +1;
            //System.debug('Count : '+ i + ' : ' +LRcount );
            //trigger.new[0].Assign_To__c.addError('Selected LR have maximum Assignments');
            //break;
        }        
      }
      if(AllUserCnt==2){break;}
      if(loopi==0)
      {LRcount=0;}
  }
}// else part
 
  if(string.valueOf(LRcount)!='')
    {
        //trigger.new[0].LR_Count__c=string.valueOf(LRcount);
        trigger.new[0].LR_Count__c='NO';
        //LIST<Opportunity> Opportunity = [update Opportunity set LR_Count__c = 'No'];
    }
    else
    {
        trigger.new[0].LR_Count__c='NOooo';
        //LIST<Opportunity> Opportunity = [update Opportunity set LR_Count__c = 'No'];
    }
//if(LRcount==100 )
    if(AllUserCnt==1)
    {
        Flag='Yes';
    }
    
    for(OpportunityUserAssociation__c myopportunity1 : trigger.new)
    {
          myopportunity1.LR_Count__c = Flag;
        //myopportunity1.LR_Count__c = string.valueOf(LRcount);
        //myopportunity1.LR_Count__c = string.valueOf(AllUserCnt);
    }
    
}

         

hi all,

 

We have created a button in the lookup, by clicking the button we are redirecting it to custom object page. the page is getting redirected but some of the fields are not visible and scroll bar is also not available.

 

Kindly advice.

 

Regards,

Abi

hi everyone,

 

select query to list the standard objects in salesforce using SOQL.

Hi everyone,

 

In our organization, there are three roles namely x,y, and z. If x submitted a candidate for approval, then the approval will go to y and if y approves a candidate then candidate will go for z approval.I have created approval process with the mandatory options. Created two approval steps i) x to y and ii) y to z.

 

Now Y is submiting a candidate for approval to Z. Z can view the candidate which was submitted by Y. But if he click approve button it is showing an error message stating "This approval request requires the next approver to be determined by the Manager field. This value is empty. Please contact your administrator for more information."

Whenever I create/update a opportunity in Salesforce, it should pop up a confirmation message. I found a JavaScript function but I don’t know how to use this in save button of a record.

i need to get the manager id of a user in an object.

 

I have created an email field in an object. i want to get the manager id of a logged in user. How to get this using triggers?

 

I want to use this mail id in workflows rules.

 

kindly give me some suggestions

I'm creating an opportunity and assigned it to two users using junction object. I need send an email alert to both of the users if they didn't associate any candidate for that opportunity within 2 hrs. If any one user associated a candidate with the opportunity within that 2 hrs, he should not receive an email. The other user who didn't associate a candidate should receive an email. Kindly advice.

How to get the created time of an opportunity based on the created date. The created date datatype is datetime.

Hi everyone,

 

I need to share an opportrunity to a particular user.

 

I did the below changes in the security settings.

 

Click Sharing Settings -> In the organization wide defaults edited the default access of opportunity from public read/write to public read only.

 

And created a new sharing rule like

 

Rule Type : Based on record owner

 

Opportunity : Owned  by members of : Roles : MR

 

Share with : Roles and subordinates : LR and their subordinates

 

Opportunity Access : Read Only

 

I shared an opportunity to that role but it is not displayed in LR and their subordinates.

 

Kindly advice me on sharing the records.

 

 

 

 

i) Whether i can able to create junction object for opportunity and user objects?

 

ii) Is there a way to select two values in the lookup?

 

Kindly advice.  

Whenever I create or edit a record the owner and the assigned user should receive an email.

 

From : the record Owner

To : Assign To user ( I created a custom field( i.e. lookup) in opportunity as assign to).

 

I created an Email Template and attached in email alert and then the recipient types are Opportunity owner and Related User: Assign To. From Email Address as Current users' email address

 

But I didn't receive any email when I create or edit the record.

I created custom page layout for opportunity. In that i have Assign to lookup which will display the user names based on the login user role. Now i need to display the assigned opportunity to the opportunities of selected user.

For example i have created a view named assigned opportunities with filter conditions like Assign To Equals "ABI".

this i need to create manually in each and every user login. How to create this based on the roles?

 

X is the manager. Y and Z are executives and they are reporting to X. X created 2 records and assigned it to Y. It should be displayed in the assigned opportunities of Y but not in Z. And X created another record and assigned it to Z and it should be displayed in the assigned opportunities of Z but not in Y.  Please suggest me how to do this? R else plz suggest me any other way to achieve this?

How long it will take place to share a record?

How to get the count of records which are assigned to another user.

 

I created a lookup called assign to in the leads and assigned a lead to another user. How to get the count of no.of records assigned to another user.

We have 4 roles namely MR, RM, LR, and R. MR reports to CEO, RM reports to MR, LR reports to RM, and R reports to LR.

MR will create a requirement and needs to assign it to LR directly and LR will assign to R.

In the Requirements page when MR login in the assign to field the LR names should be listed and if LR login, the assign to field should populate R names.

I created a lookup but it is not working properly. Is there any other way to assign a record to an user. I tried to create queues also but the opportunity object is not available in the object list.

hi everyone,

 

select query to list the standard objects in salesforce using SOQL.

Hi everyone,

 

In our organization, there are three roles namely x,y, and z. If x submitted a candidate for approval, then the approval will go to y and if y approves a candidate then candidate will go for z approval.I have created approval process with the mandatory options. Created two approval steps i) x to y and ii) y to z.

 

Now Y is submiting a candidate for approval to Z. Z can view the candidate which was submitted by Y. But if he click approve button it is showing an error message stating "This approval request requires the next approver to be determined by the Manager field. This value is empty. Please contact your administrator for more information."

 

Hi,

 

How to remove "People, Groups" option from Salesforce Standard Search box?

 

Thanks,
Devendra

I'm creating an opportunity and assigned it to two users using junction object. I need send an email alert to both of the users if they didn't associate any candidate for that opportunity within 2 hrs. If any one user associated a candidate with the opportunity within that 2 hrs, he should not receive an email. The other user who didn't associate a candidate should receive an email. Kindly advice.

How to get the created time of an opportunity based on the created date. The created date datatype is datetime.

How long it will take place to share a record?