• Soujanya Uppal 9
  • NEWBIE
  • 10 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 2
    Replies
hi everyone,

Through trigger-

I want to create an opportunity if the contact account is not null and account employee>700 and rating = warm

then Opportunity name=Account of the contact
hi everyone,

how to change owner on new record on account through the custom label in trigger????

I have done through this-

trigger changeownerTrigger on Account (before insert) {
    
    user u= [select id, name from user where Alias='ragh'];
    for(Account ac: trigger.new){
            
            if(ac.Industry=='Agriculture'){
                ac.ownerid=u.id;
                
                
            }
           
        }
  
    
}
Hi everyone!!

How to do with trigger?

Change contact owner on new record through trigger when industry = agriculture.
i want to change owner through trigger on new record when industry = agriculture else shows error

Please anyone give me code for this
i have tried this much

trigger changeownerTrigger on Account (before insert) {

    for(Account ac: trigger.new){
        
        if(ac.Industry=='Agriculture')
            
    }
}
Hi!!
i want to show pageblock when i write pancard then pancard pageblock shows after click on apply button  if i write passsport then passport block shows on click of apply button

Here is the code i have used---------

<apex:page standardController="Account" >
    <apex:form>
        <apex:pageBlock title="Applying Documents">
            <apex:pageBlockSection title="Documents to Apply">
                <apex:inputtext label="Enter Document"/>
            </apex:pageBlockSection>
            <apex:commandButton value="Apply"/>
            
            <apex:pageBlock title="Pancard">
                <apex:pageBlockSection title="Personal Details">
                    <apex:inputfield value="{!Account.Name}"/>
                    <apex:inputfield value="{!Account.Phone}"/>
                    <apex:inputfield value="{!Account.Website}"/>
                </apex:pageBlockSection>
                <apex:pageBlockSection title="Birth Details">
                    <apex:inputField label="Date of Birth" value="{!Account.SLAExpirationDate__c}"/>
                    <apex:inputtext label="Place of Birth"/>
                </apex:pageBlockSection>
                <apex:pageBlockSection title="Education Details">
                    <apex:inputtext label="Enter X Board"/>
                    <apex:inputtext label="Enter XII Board"/>
                </apex:pageBlockSection>
            </apex:pageBlock>
            
            <apex:pageBlock title="Aadhar Card">
                <apex:pageBlockSection title="Personal Details">
                    <apex:inputtext label="Mother Name"/>
                    <apex:inputtext label="Father Name"/>
                    <apex:inputtext label="Name"/>
                </apex:pageBlockSection>
                <apex:pageBlockSection title="Address Information">
                    <apex:inputtext label="City"/>
                    <apex:inputtext label="State"/>
                    <apex:inputtext label="Street"/>
                    <apex:inputtext label="Pincode"/>
                </apex:pageBlockSection>
            </apex:pageBlock>
            
            <apex:pageBlock title="Passport">
                <apex:pageBlockSection title="Personal Details">
                    <apex:inputtext label="Name"/>
                    <apex:inputtext label="Mother Name"/>
                    <apex:inputtext label="Father Name"/>
                    <apex:inputtext label="Email"/>
                </apex:pageBlockSection>
                <apex:pageBlockSection title="Address Information">
                    <apex:inputtext label="City"/>
                    <apex:inputtext label="State"/>
                    <apex:inputtext label="Street"/>
                    <apex:inputtext label="Pincode"/>
                </apex:pageBlockSection>
                <apex:pageBlockSection title="Education Details">
                     <apex:inputtext label="Enter X Board"/>
                    <apex:inputtext label="Enter XII Board"/>
                </apex:pageBlockSection>
            </apex:pageBlock>
            
            
        </apex:pageBlock>
    </apex:form>
</apex:page>User-added image
Hi!!
i want to show pageblock when i write pancard then pancard pageblock shows after click on apply button  if i write passsport then passport block shows on click of apply button

Here is the code i have used---------

<apex:page standardController="Account" >
    <apex:form>
        <apex:pageBlock title="Applying Documents">
            <apex:pageBlockSection title="Documents to Apply">
                <apex:inputtext label="Enter Document"/>
            </apex:pageBlockSection>
            <apex:commandButton value="Apply"/>
            
            <apex:pageBlock title="Pancard">
                <apex:pageBlockSection title="Personal Details">
                    <apex:inputfield value="{!Account.Name}"/>
                    <apex:inputfield value="{!Account.Phone}"/>
                    <apex:inputfield value="{!Account.Website}"/>
                </apex:pageBlockSection>
                <apex:pageBlockSection title="Birth Details">
                    <apex:inputField label="Date of Birth" value="{!Account.SLAExpirationDate__c}"/>
                    <apex:inputtext label="Place of Birth"/>
                </apex:pageBlockSection>
                <apex:pageBlockSection title="Education Details">
                    <apex:inputtext label="Enter X Board"/>
                    <apex:inputtext label="Enter XII Board"/>
                </apex:pageBlockSection>
            </apex:pageBlock>
            
            <apex:pageBlock title="Aadhar Card">
                <apex:pageBlockSection title="Personal Details">
                    <apex:inputtext label="Mother Name"/>
                    <apex:inputtext label="Father Name"/>
                    <apex:inputtext label="Name"/>
                </apex:pageBlockSection>
                <apex:pageBlockSection title="Address Information">
                    <apex:inputtext label="City"/>
                    <apex:inputtext label="State"/>
                    <apex:inputtext label="Street"/>
                    <apex:inputtext label="Pincode"/>
                </apex:pageBlockSection>
            </apex:pageBlock>
            
            <apex:pageBlock title="Passport">
                <apex:pageBlockSection title="Personal Details">
                    <apex:inputtext label="Name"/>
                    <apex:inputtext label="Mother Name"/>
                    <apex:inputtext label="Father Name"/>
                    <apex:inputtext label="Email"/>
                </apex:pageBlockSection>
                <apex:pageBlockSection title="Address Information">
                    <apex:inputtext label="City"/>
                    <apex:inputtext label="State"/>
                    <apex:inputtext label="Street"/>
                    <apex:inputtext label="Pincode"/>
                </apex:pageBlockSection>
                <apex:pageBlockSection title="Education Details">
                     <apex:inputtext label="Enter X Board"/>
                    <apex:inputtext label="Enter XII Board"/>
                </apex:pageBlockSection>
            </apex:pageBlock>
            
            
        </apex:pageBlock>
    </apex:form>
</apex:page>

User-added image
i am getting this error Missing ';' at '{' please help

list<Account> accList= [select id,name,billingcity,annualrevenue,industry,rating from Account];
list<account> accNew= new list<account>();
for(account ac:accList){
    if(ac.Billingcity=='Hyderabad')
        {
            ac.Rating='Hot';
        }
        elseif(ac.Billingcity=='Paris')
       {
            ac.Rating='Cold';
        }
        elseif(ac.Billingcity=='Austin')
       {
            ac.Rating='Warm';
        }
        elseif(ac.Billingcity=='Vizag')
       {
            ac.Rating='Yahoo';
        }       
        else(ac.Billingcity=='Other')
        {
            ac.Rating='Google';
        }
   
accNew.add(ac);    
    }
update accNew; 
hi everyone,

how to change owner on new record on account through the custom label in trigger????

I have done through this-

trigger changeownerTrigger on Account (before insert) {
    
    user u= [select id, name from user where Alias='ragh'];
    for(Account ac: trigger.new){
            
            if(ac.Industry=='Agriculture'){
                ac.ownerid=u.id;
                
                
            }
           
        }
  
    
}