• PulaK_PrabhakaR
  • NEWBIE
  • 60 Points
  • Member since 2017


  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 0
    Questions
  • 8
    Replies
Hello,
I would like to create a formula text field that would give me a value based on evaluation two different pick lists.

Example

If PicklistA is X and Picklist B is Y, then give me the value P1,
If PicklistA is X and PicklistB is Z, then give me value P2,
If PicklistA is W and PicklistB is T, then give me value P3,
and on it on until I account for all 16 different possibilites.

What would be the formula structure for this?
Thanks!
Create a validation rule on a 12 digit number field for the following condition.  
1) All 12 digit number should not be same. (1111 1111 1111),  
2) 3 consecutive numbers should not be same (1112 2223 3334) ,
3) Field length= 12.

 
Hi All

I have written a trigger for Apex sharing rule based on some criteria.But its showing error when other user creating account ..

AccountShare: execution of AfterInsert caused by: System.DmlException: Insert failed. First exception on row 0; first error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id: [] Trigger.AccountShare: line 34, column 1
trigger AccountShare on Account (after insert, after update) 
{
 if(checkRecursion.runOnce()){
    for(Account acc : Trigger.new){
        if(acc.Account_Manager__c!=null){   
            List<AccountShare> shares = new List<AccountShare>();
            Map<String,String> mParentID = New Map<String,String>();
            Map<String,String> UId = New Map<String, String>();
            system.debug('+++'+acc.Account_Manager__c);
            for(User usrmgr : [select id from user where id=:acc.Account_Manager__c]){
               AccountShare share1 = new AccountShare();
               share1.AccountId=acc.Id;
               share1.UserOrGroupId= usrmgr.id;
               share1.AccountAccessLevel='Edit';
               share1.OpportunityAccessLevel='Edit';
               share1.CaseAccessLevel='Edit';
               Insert share1;
               system.debug('+++'+share1.id);
            }
          
          for(User u :[Select UserRoleId from User  where id= :acc.Account_Manager__c])
          {
            for(UserRole ur : [Select ParentRoleId from UserRole where id=:u.UserRoleId]){
              mParentID.put(String.ValueOf(ur.get('ParentRoleId')),String.ValueOf(ur.get('ParentRoleId')));
              system.debug('+++1111');
            }
          }
           for(User u1 :[Select id from User u where u.UserRole.id in :mParentID.KeySet()]){
          
           //system.debug(mParentID);          
              for (Account rec : [SELECT Id FROM Account WHERE Id = :acc.id]) {  
               system.debug('+++2222');
               
                      AccountShare share2 = new AccountShare();
                     
                      share2.AccountId=rec.Id;
                      share2.UserOrGroupId=u1.id;
                      share2.AccountAccessLevel='Edit';
                      share2.OpportunityAccessLevel='Edit';
                      share2.CaseAccessLevel='Edit';
                      
                      Insert share2;  
                      
                      system.debug('+++'+share2.id);
                }                    
                    
            }
        }
    }
 }
}

 
public class ViewDocument{   
    public  customer__c cust{get;set;}    
    public string recId{get;set;}

    public ViewDocument(ApexPages.StandardController ctrl){
        recId=ApexPages.currentPage().getParameters().get('Id');              
         cust=[SELECT id, Viewed_Status__c, Viewed_On__c FROM customer__cWHERE Id=:recId];
    }
    
    public pageReference countClicks(){
    
       pagereference pr=new pagereference('/'+cust.Id);
        return pr;
       
    }     
}

please
Apex Code =  ublic with sharing class Saveaccountdetail {
Public Account Account {get;set;}
Public Account Accts {get;set;}
Public Saveaccountdetail (){
Id id= ApexPages.currentPage().getParameters().get('id');
Accts = (id == null)? new Account() : [SELECT Name, Phone, Industry FROM Account WHERE Id = :id];
}
Public PageReference Save()
{try  
{
insert (Accts);
}
catch(System.DMLException e) {
ApexPages.addMessages(e);
return null;
}
PageReference redirectSuccess = new ApexPages.StandardController(Account).view();
return (redirectSuccess);
}
}

Visual Force Page 
<apex:page controller="Saveaccountdetail" tabStyle="Account" > <apex:form > <apex:pageBlock title="New Account"> <apex:pageBlockSection > <apex:inputField value="{!Account.name}" /> <apex:inputField value="{!Account.Industry}" /> <apex:inputField value="{!Account.Phone}" /> </apex:pageBlockSection> <apex:commandButton value="Save" action="{!Save}"/> </apex:pageBlock> </apex:form> </apex:page>
Hii,
   Am having 3 objects : Account,Opportunity and Course objects.I want Opportunity name to be populated as respective Account_name with Course_name.This should be done without using any code.
How to do this? help me to do this action.

Thanks in advance..

 
Hello,
I would like to create a formula text field that would give me a value based on evaluation two different pick lists.

Example

If PicklistA is X and Picklist B is Y, then give me the value P1,
If PicklistA is X and PicklistB is Z, then give me value P2,
If PicklistA is W and PicklistB is T, then give me value P3,
and on it on until I account for all 16 different possibilites.

What would be the formula structure for this?
Thanks!
Create a validation rule on a 12 digit number field for the following condition.  
1) All 12 digit number should not be same. (1111 1111 1111),  
2) 3 consecutive numbers should not be same (1112 2223 3334) ,
3) Field length= 12.

 
please give me the validation rule for pancard 
it urgent?

When someone takes the time/effort to repspond to your question, you should take the time/effort to either mark the question as "Solved", or post a Follow-Up with addtional information.  

 

That way people with a similar question can find the Solution without having to re-post the same question again and again. And the people who reply to your post know that the issue has been resolved and they can stop working on it.