• Manoj Deshmukh
  • NEWBIE
  • 15 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 22
    Replies
Create 3 fields on VF page. One is lookup to user, 2nd is picklist and 3rd one is text field

Now, we need to implement the functionality like as below

The person that we select in user lookup can only edit/change values from 2nd and 3rd field. In case of other user, other than selected user in user lookup, user cannot change the value. Instead it will come as readonly

On the final step of this project I am getting this error:
Challenge Not yet complete... here's what's wrong: 
The final approval is not configured correctly for 'Discount Approval Process'. Approving the opportunity did set the opportunity's Approval_Status__c field value to 'Approved'.


User-added image

User-added image
I have two custom objects. The first object, First_Object__c, has multiple related records from the second custom object, Second_Object__c. Only one Second_Object__c record can be in status "In Progress" at any given time. After the owner of the First_Object__c record is changed , I need the owner of the one Second_Object__c record that is currently in status "In Progress" to be immediately updated. This needs to happen whether the owner is previously a user or a queue.

Maybe here's a better way to put it:
IF record owner of First_Object__c is changed, THEN change record owner of related record of Second_Object__c to the same owner IF status is "In Progress".

I cannot use a Master/Detail relationship because I need the related records to be owned by different users and/or queues.
Hi all,
       I've 2 objects account and pickupshipment they have lookup relation my requirement is in the vf page if i select an account from the lookup field then automatically the seller address fields in the pickupshipment will be filled with the account billing fields value can any one help me with this one 
Thanks in advance
trigger taskRestriction on task (Before insert,after update) {
  
    list<Contact> clist =new list<Contact>();
    
    String userid=UserInfo.getUserId();
  
  
    
        for (Task t : Trigger.new) {
       
        if (t.WhoId !=Null &&  userid!='0059000000126EoAAI' && userid!='0056F000007XrZEQA0' && userid!='00590000004Sc9zAAC'  ) {
                
          clist= [select ID, ownerId ,Account_name__C, Account.Lock_record__C from Contact where 
          ID=:t.WhoId and Account.Lock_record__C!=True and  OwnerId !=:UserInfo.getUserId()]; 
                
            }
            
            IF(Clist.size()>0)
            {
            T.adderror('This contact is assigned to other user, Kindly Contact Sir/Madam to Change the Ownership');
            }
            }
            
            
                    
}
    public static void insertIndividual(List<Contact> tNew, List<Contact> tOld){
        try{

            //
            List<Individual> lst_indiv = new List<Individual>();
            //
            for(Contact con : tNew){
              lst_indiv.add(FirstName = con.FirstName, LastName = con.LastName, Salutation=con.Salutation);
            }    
            //
            //
            if(!lst_indiv.isEmpty()){
                insert lst_indiv;
            }
        }catch(Exception exc){
            LogHelper.generateLog('ContactMethods.insertIndividual()', exc, 'Trigger');
        }
    } //insertIndividual

Hello, I'm very new to Salesforce Development and I am struggling to figure this out. So i want to create 2 VF pages and 2 controllers and I want to create new account and insert that account when I'm pressing the Save button, then i want to redirect to second visualforce page and on the second visualforce page i want to fetch the id from the account which is just created and outputfield the value, the name of account. I just started creating the first visualforce page and controller. I dont know if i'm doing this right.

apex:page controller="screen1">
   <apex:form>
       <apex:pageBlock>
           <apex:pageBlockSection>
               <apex:inputField value="{!account.name}"/>
               <apex:commandButton value="Save" action="{!save}"/>
           </apex:pageBlockSection>
       </apex:pageBlock>
   </apex:form>
</apex:page>


Controller:

public class screen1 
{
  
    public Account account;

    public Account getAccount()
    {
      if(account == null)
      {
         account = new account();
      }
      return account;
    }

     public PageReference save()
     {
       getAccount();
       if(account != null)
       {
           insert account;
       }
       PageReference pageRef = new PageReference('/apex/screen2');
       pageRef.setRedirect(true);
       return PageReference;
     }
}
I have an error here: Error: Compile Error: DML requires SObject or SObject list type: Account at line 20 column 12

HI ALL,
i have two custom filelds on account object and two custom fields on another custom object with same api names if i insert an account the values of that fields should be display in custom object also 
can you please help me
Create 3 fields on VF page. One is lookup to user, 2nd is picklist and 3rd one is text field

Now, we need to implement the functionality like as below

The person that we select in user lookup can only edit/change values from 2nd and 3rd field. In case of other user, other than selected user in user lookup, user cannot change the value. Instead it will come as readonly