• Uday Kumar 43
  • NEWBIE
  • 30 Points
  • Member since 2015

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 0
    Questions
  • 3
    Replies
Hi 
I have a requiremnt where there is a standard object OPPORTUNITIES we had a business scenario where opportunity name should over ride with the name which is used in field update by using work flow while creation of record. the business got back to me and changed the requiremnt like if the user does not enter any value in the required field on standard opportunity object and try to save it then it should bring the fieldupdate by using workflow or in case2 if user gives some some name it should directly take that name. 

I am good with second scenario by just going in to the work flow and make it checked "every time when record is created" use this work flow the problem comes next how to overcome to save a field (Standard Required field) without giving value in it and make it over ride by field update value, I tried with below code but its not going through. please help me out with your suggestions.

List<Opportunity> lstOpps = new List<Opportunity>();
    Set<Id> setAccountIds = new Set<Id>();
    if(Trigger.isInsert && Trigger.isBefore) {
         for(Opportunity o: Trigger.new){
             lstOpps.add(o);
             setAccountIds.add(o.AccountId);
        if(String.isBlank(o.Name) && !rtMapById.get(o.RecordTypeId).getName().containsIgnoreCase('National')){
            //lstOpps.add(o);
            //setAccountIds.add(o.AccountId);
        //o.Name = rtMapById.get(o.RecordTypeId).getName()+'-'+o.AccountId+'-'+Date.today().format(); 
    }
         }
    Map<Id, Account> mapAccounts = new Map<Id,Account>([select id,name from Account where id in : setAccountIds]);
    for(Opportunity o: Trigger.new){
     o.Name = rtMapById.get(o.RecordTypeId).getName()+'-'+mapAccounts.get(o.AccountId).Name+'-'+Date.today().format(); 
    }



 
Hi Team,

How to populate the opty field value in the Task object comments field.Let's say we have a field called  Description,whenerver we are entered in the description field same comments it should be populate in the Task comment field.

How to acheive this one.

Thanks in Advance
Hi 
I have a requiremnt where there is a standard object OPPORTUNITIES we had a business scenario where opportunity name should over ride with the name which is used in field update by using work flow while creation of record. the business got back to me and changed the requiremnt like if the user does not enter any value in the required field on standard opportunity object and try to save it then it should bring the fieldupdate by using workflow or in case2 if user gives some some name it should directly take that name. 

I am good with second scenario by just going in to the work flow and make it checked "every time when record is created" use this work flow the problem comes next how to overcome to save a field (Standard Required field) without giving value in it and make it over ride by field update value, I tried with below code but its not going through. please help me out with your suggestions.

List<Opportunity> lstOpps = new List<Opportunity>();
    Set<Id> setAccountIds = new Set<Id>();
    if(Trigger.isInsert && Trigger.isBefore) {
         for(Opportunity o: Trigger.new){
             lstOpps.add(o);
             setAccountIds.add(o.AccountId);
        if(String.isBlank(o.Name) && !rtMapById.get(o.RecordTypeId).getName().containsIgnoreCase('National')){
            //lstOpps.add(o);
            //setAccountIds.add(o.AccountId);
        //o.Name = rtMapById.get(o.RecordTypeId).getName()+'-'+o.AccountId+'-'+Date.today().format(); 
    }
         }
    Map<Id, Account> mapAccounts = new Map<Id,Account>([select id,name from Account where id in : setAccountIds]);
    for(Opportunity o: Trigger.new){
     o.Name = rtMapById.get(o.RecordTypeId).getName()+'-'+mapAccounts.get(o.AccountId).Name+'-'+Date.today().format(); 
    }



 
Hi Team,

How to populate the opty field value in the Task object comments field.Let's say we have a field called  Description,whenerver we are entered in the description field same comments it should be populate in the Task comment field.

How to acheive this one.

Thanks in Advance