• Sunny Sohail
  • NEWBIE
  • 40 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 10
    Replies
Hello,

Is it possible to create a trigger that would change specific contacts owners to the account owner? Currenty we have a "TEST" user account in salesforceand anytime a contact is owned by this "TEST"user we want to change the contact owner to the account owner. Is this possible? any assistance would be appreciated.
 

Hello,

im fairy new to triggers and im having some issues creating a trigger that will make a field mandatory. I tried to do this with a basic Validation rule however i beleive this exceeds salesforce point and click capabilities.

Case:
Im trying to create a validation rule where a user would be required to fill out the "Distributor_Name__c" name on the quotes object if "silver" is slected from the "Proofpoint_Advantage_Program_Level__c" field on the accounts object.

"Distributor_Name__c"  is a lookup field that looks up accounts and "Proofpoint_Advantage_Program_Level__c"  is a picklist.

i have tried creating a cross object validation rule however on the quotes object account fields do not show up. Is this possible? if not would this be done via trigger? This is what i attempted however iv had little success. Any help would be appreciated.

trigger Requiredistyfield on Quotes (Before insert,before update) {
    for (account quoteloop: Trigger.New){
        if (quoteinloop.Proofpoint_Advantage_Program_Level__c== 'silver'l)
            accountinloop.Distributor_Name__c!=NULL;
            }
        }


 
Hello,

im am trying to create a trigger that will update any accounts employee size from blank to 10 and i am getting an "Illegal assignment from String to Integer" error message. The below code should update any account that has a NULL employee size to 10. Any help would be useful.

trigger UpdateEmployeesize on Account (Before insert,after update) {
    for (account accountinloop: Trigger.new){
        if(accountinloop.NumberOfEmployees== 'NULL'){
            accountinloop.NumberOfEmployees='10';
            }
        

}
}
Hello,

I am fairly new to writting triggers and have a question regarding overiding fields via trigger. Basically what I wantr to happen is to force users to input a "billingstate" using the 2 letter abbreviation. For example if someone inputs "UTAH" I want the "Billingstate" to update to "UT". I know that this is somewhat possible using validation rules but I really want to understand how this is done via trigger. The below is a simple code that will only affects accounts in Utah and this is what I have, but this code does not seem to work. Basically the below code should force the state to update "UTAH" to "UT" upon creation and upon update to the record.

trigger ForceAccountstate on Account (before insert,after update) {
    for (Account AccountInLoop : Trigger.new) {
if (Billingstate = UTAH)
Billingstate = 'UT';
    }
}
Hello,

Is there a way for a user to update our employee field on the account record using data.com clean button but not through the actual salesforce record? Basically we have a field called "employees" and we want reps to be able to use the data.com clean to update the value for "employees" but not let them update that field manually by editing that field. Hope this makes sense? Just wondering if there is any work flow or trigger that can be utillized to achieve this.

thank you
Currently when we set up a new user we have to add their names to 2 different picklists. If I am creating a sales rep user we have to add his or her name to the "salesrep" picklist and if I am creating BDR user I have to add his or her name to the "BDR" picklist. Is there a way that these names are automatically added to the picklist upon a user creation?
Hello,

Is it possible to create a trigger that would change specific contacts owners to the account owner? Currenty we have a "TEST" user account in salesforceand anytime a contact is owned by this "TEST"user we want to change the contact owner to the account owner. Is this possible? any assistance would be appreciated.
 

Hello,

im fairy new to triggers and im having some issues creating a trigger that will make a field mandatory. I tried to do this with a basic Validation rule however i beleive this exceeds salesforce point and click capabilities.

Case:
Im trying to create a validation rule where a user would be required to fill out the "Distributor_Name__c" name on the quotes object if "silver" is slected from the "Proofpoint_Advantage_Program_Level__c" field on the accounts object.

"Distributor_Name__c"  is a lookup field that looks up accounts and "Proofpoint_Advantage_Program_Level__c"  is a picklist.

i have tried creating a cross object validation rule however on the quotes object account fields do not show up. Is this possible? if not would this be done via trigger? This is what i attempted however iv had little success. Any help would be appreciated.

trigger Requiredistyfield on Quotes (Before insert,before update) {
    for (account quoteloop: Trigger.New){
        if (quoteinloop.Proofpoint_Advantage_Program_Level__c== 'silver'l)
            accountinloop.Distributor_Name__c!=NULL;
            }
        }


 
Hello,

im am trying to create a trigger that will update any accounts employee size from blank to 10 and i am getting an "Illegal assignment from String to Integer" error message. The below code should update any account that has a NULL employee size to 10. Any help would be useful.

trigger UpdateEmployeesize on Account (Before insert,after update) {
    for (account accountinloop: Trigger.new){
        if(accountinloop.NumberOfEmployees== 'NULL'){
            accountinloop.NumberOfEmployees='10';
            }
        

}
}
Hello,

I am fairly new to writting triggers and have a question regarding overiding fields via trigger. Basically what I wantr to happen is to force users to input a "billingstate" using the 2 letter abbreviation. For example if someone inputs "UTAH" I want the "Billingstate" to update to "UT". I know that this is somewhat possible using validation rules but I really want to understand how this is done via trigger. The below is a simple code that will only affects accounts in Utah and this is what I have, but this code does not seem to work. Basically the below code should force the state to update "UTAH" to "UT" upon creation and upon update to the record.

trigger ForceAccountstate on Account (before insert,after update) {
    for (Account AccountInLoop : Trigger.new) {
if (Billingstate = UTAH)
Billingstate = 'UT';
    }
}