• Nandhini s 11
  • NEWBIE
  • 10 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 3
    Replies
I have a text field say,
Name: ABC 1 
I need to extract the field value without the number to another field.
How can i do that?
Result:
(New field) Name truncated: ABC
I have written the below trigger to update Number of child opportunity in parent opportunity record. But it's not working, 

trigger NoOfChildOppty on Opportunity (after insert,after update,after delete,after undelete) {
set<id> oId = new set<id>();
    List<opportunity> oppty = new List<opportunity>();
    if(!trigger.isDelete)
{  
    for(opportunity o: trigger.new)
    {
         oId.add(o.Parent_Opportunity__r.id );
        
    }}
    else
    {
         for(opportunity o: trigger.old)
    {
        oId.add(o.Parent_Opportunity__r.id );
        
    }    }
    for(opportunity op: [select id,No_Of_child_Oppty__c from opportunity where id =: oId])
    {
        
        List<opportunity> opp = [select id from opportunity where Parent_Opportunity__r.id=: op.id];
       op.No_Of_child_Oppty__c = opp.size();
       oppty.add(op);                
    }
    update oppty;
}
 
Hi guys,

I know 'with sharing' enforces sharing rules of the current user and 'Without sharing' doesn't.
My doubt is, what is sharing rules? is it the criteria/owner based sharing rule we write for an object? or does it mean the access a user has on an object?

Where do we use these keywords in real time?
Is the current user, the user who executes the code?
Hi Guys,
Does View/Modify all permission allow users to access records owned by the users in the same profile or can they access all the records in the object irrespective of the owner?
Hi Guys,
I'm doing a hands-on exercise on triggers. The requirement is:
When a Billing Address is modified in accounts, get the new Postal Code. Then check which Contacts on the Account are outside that Postal Code. If 1 or more Contacts are outside of the Postal Code, mark Out_of_Zip as TRUE.

I've written the below trigger but the Out_of_Zip field is not getting updated. I'm not sure how to check if the trigger is firing or not.
Can someone tell me where to check the logs for triggers ?

trigger OutOfZipTrigger on Account (before update) {
    for(Account a: trigger.new){
        Account oldAccount = Trigger.oldMap.get(a.id);
  if(a.BillingAddress != oldAccount.BillingAddress )
    {
       List<contact> con = [select id,MailingPostalCode from contact where accountId =: a.id] ;
        for(contact c: con){
    if(a.BillingPostalCode != c.MailingPostalCode){
              a.Out_of_Zip__c = True;
               //acc.add(a);
           }
       }
    }
    }
}

 
Hi guys,

I'm fairly new to salesforce. I'm planning on doing ADM 201 certification this month.
Can someone help me with any guide or trailmix that will be helpful.
Say, there are 3 users. User A, User B and User C.
User A wats to share his records with user B and User C.
He wants to give read access to User B and read write access to User C.
Is this possible?
Hi Guys,
Does View/Modify all permission allow users to access records owned by the users in the same profile or can they access all the records in the object irrespective of the owner?
Say, there are 3 users. User A, User B and User C.
User A wats to share his records with user B and User C.
He wants to give read access to User B and read write access to User C.
Is this possible?

Hi All,

I want to know that why we use map instead of list in salesforce. Please help with scenario.

Thanks,
Parteek