• Bhargavi Tunuguntla
  • SMARTIE
  • 1055 Points
  • Member since 2017
  • Apps Associates

  • Chatter
    Feed
  • 36
    Best Answers
  • 0
    Likes Received
  • 2
    Likes Given
  • 3
    Questions
  • 165
    Replies

Ex - There is one button(action) we have created.

when user clicked that button from LE so it should open view in Lightning ,
when user clicked from classic it should open in classic view
when user clicked from salesforce1 it should be open in respective view.
based on which things we can come to know. can any one gives me sample code ?


 

Hi Experts,

I have small requirement where i need to filter a long text area field called Desc__c which i am not able to do that can anyone help me please.

OrderItem oli1 = new OrderItem ();
        oli1.Orderid = order.Id;
        oli1.Desc__c= 'Test OLI 1'; 
      insert oli1;


 OrderItem oli2 = [SELECT Id, Orderid
                    FROM OrderItem WHERE  Desc__c = 'Test OLI 1' LIMIT 1];

In this filter condition its throwing an error can anyone help me please thanks in adavance
 for(Contact c:[selectid,accountid,phone,mailingstreet,mailingcity,mailingpostalcode,mailingcountry,mailingstate fromcontact where accountid in :trigger.new]) {
    account a = trigger.newmap.get(c.accountid);
    boolean updatedrecord = false;
   if(c.phone == trigger.oldmap.get(c.accountid).phone) {
      c.phone = a.phone;
      updatedrecord = true;
    }
Hi There can any one help me how to use custom controller for this code as i use Standard controller....below is the code...


<apex:page StandardController="Contact" >
<apex:form >
    <apex:pageBlock >        
<apex:pageBlockButtons Location="Top" >
<apex:commandButton action="{!save}" value="Save&New"/>
    <apex:commandButton action="{!save}" value="Save"/>
    <apex:commandButton action="{!cancel}" value="cancel"/>
     </apex:pageBlockButtons>   
        
    <apex:pageBlockSection title="General Information" columns="2" >
     <apex:inputField value="{!Contact.FirstName}" taborderhint="1"/>
     <apex:inputField value="{!Contact.LastName}" taborderhint="2" required="true"/>
     <apex:inputField value="{!Contact.Email}" taborderhint="3" required="true"/>
     <apex:inputField value="{!Contact.Phone}" taborderhint="4" required="true"/>
     </apex:pageBlockSection> 
        
     <apex:pageBlockSection title="Address Information" columns="2" >
     <apex:inputField value="{!Contact.MailingCountry}" taborderhint="5"/>
     <apex:inputField value="{!Contact.MailingCity}" taborderhint="6"/>
     <apex:inputField value="{!Contact.MailingState}" taborderhint="7"/>
     <apex:inputField value="{!Contact.MailingPostalcode}" taborderhint="8" required="true"/>
     </apex:pageBlockSection>  
     
     <apex:pageBlockSection title="Industry Information" columns="2">
     <apex:inputField value="{!contact.Business_Vertical__c}" required="true"/>
     <apex:inputField value="{!contact.Date_Procured__c}" required="true"/>
     <apex:inputField value="{!contact.Division_of_Vertical__c}" required="true"/>
     <apex:inputField value="{!contact.Area_Of_Division__c}"/>
     
     </apex:pageBlockSection>     
     <apex:pageBlockSection title="Amount Information" Columns="2">
     <apex:inputfield value="{!Contact.Amount_Invested__c}" required="true"/>
     <apex:inputfield value="{!Contact.Amount_Earned__c}" required="true"/>    
     </apex:pageBlockSection>
     
   
                              
<apex:pageBlockButtons Location="Bottom">
<apex:commandButton action="{!save}" value="Save&New"/>
    <apex:commandButton action="{!save}" value="Save"/>
    <apex:commandButton action="{!cancel}" value="cancel"/>
     </apex:pageBlockButtons>
    </apex:pageBlock>
   </apex:form>
</apex:page>
Hi, 

  There is very old trigger logic written in our instance this is failing due to not being bulkified can someone please suggest how to bulkifie below trigger 
trigger updateprimarycampaign on Opportunity (Before Update ,After insert)
{
 if ( checkRecursive_updateprimarycampaign.runOnce()) 
 {
    if(Trigger.isUpdate)
    {
        try
        {
            for (Opportunity op : Trigger.new) 
            {
                CampaignMember cm = [SELECT CampaignId FROM CampaignMember 
                                     where ContactId = :op.Contact__c and HasResponded = true and 
                                           CreatedDate <= :op.createddate limit 1];
               if ( cm.CampaignId == NULL)
               {
                    op.CampaignId = null;
               } 
               else
               {
                op.CampaignId = cm.CampaignId;
                }
            }
        }
        catch (Exception e)
        {
            for (Opportunity op : Trigger.new) {
                op.CampaignId = null;
            }
        }
    }
    else if (Trigger.isInsert)
    {
        Set<ID> setoppId = new Set<Id>();
        String getCampaignId;

        for(Opportunity opp: Trigger.new ) 
        {
            setoppId.add(opp.id);
        }
     
        List<Opportunity> lstOpp = [select id , CampaignId from Opportunity where id in :setoppId ];
        
        try
        {
            List<Opportunity> lstOppToUpdate = new List<Opportunity>();
            for (Opportunity op : lstOpp) 
            {
                CampaignMember cm = [SELECT CampaignId FROM CampaignMember 
                                     where ContactId = :op.Contact__c and HasResponded = true and
                                           CreatedDate <= :op.createddate limit 1];
               
               if ( cm.CampaignId == NULL)
               {
                    op.CampaignId = null;
                    lstOppToUpdate.add(op);
               } 
                else
               {
                   op.CampaignId = cm.CampaignId;
                   lstOppToUpdate.add(op);
                }
            }
            if(lstOppToUpdate.size() > 0 )
            {
                update lstOppToUpdate;
            }
        }
        catch (Exception e)
        {
            /*
                for ( Opportunity op : lstOpp ) 
                {
                    op.CampaignId = null;
                }
                update lstOpp;
            */
             update lstOpp; 
        }
    }   
}
}
Thanks
Sam
 
  • October 29, 2018
  • Like
  • 0
Create a Batch Apex Class on Account object… Fetch all the Accounts… If Account Type = ‘
Customer - Direct’ then Update the all the child contacts Status field = ‘Signed Off’. Send an email after all the processing. This email should contain the statistics like Processed records count.

Hello everyone,
on my custom object Leadevents__c I have create a custom button "New Contact" which creates the standard object "contact". For this I have all the data I need on my custom object: Name, AccountID etc.

On my custom object I have also a lookup to contacts.
User-added image
What I need is after the creation of a new contact (coming from my leadevents__c) that this contacts id gets passed into the related Leadevent and ends up as a look up value:

Here the result I would need:
User-added image
So I somehow need to update my Leadevents__c after a contact creation and figure out that the right contact is picked.
 

Does anyone have an idea to push me in the right direction? First thing I came up with (in theory) was creating a new contact via ProcessBuilder triggerd by a button on my leadevent, populate Leadevents__c ID on that contact and then "somehow" run a trigger that checks for contacts and Leadevents where the (Leadevents) - IDs match and then populate the contact id on my leadevent?

 

Hello,

I'm trying to create a page that allows users to add new records for a custom object with master-detail relationships.

Project_team__c is the parent and Contact__c and Rule_closeout_report__c are child objects (via master-detail).

The page I've created allows me to add information and save a new record, but the "Contact name" and "Rule closeout report" fields do not appear as lookup - they just allow the user to enter free text.

Provided the text is entered correctly, it works perfectly. But I want these fields to show as lookup fields. Could you please help me make this work?
 
<apex:page standardController="Project_team__c"  standardStylesheets="false" 
           applyBodyTag="false" applyHtmlTag="false" showHeader="false" sidebar="false" cache="true"  > 
	<apex:form>
		<html>
      		<body>

<style>
.buttons{background-color:#7D4082;background-image:none;color:#FFFFFF;font-weight:bold;font-size:120%;}          
   
.basictable, td {border-collapse: collapse; padding-right: 15px; font-size:90%; padding-top: 10px; padding-bottom: 10px; font-family:"Helvetica",sans-serif; } 
    
</style>          
                
			<apex:pageBlock title="Add project team members to your close-out report">
          
         			<table class=".basictable" >
                   	<tr>
                    <td><strong><apex:outputLabel value="Contact name:"></apex:outputLabel></strong></td>
                    <td><apex:inputField label="" style="width: 85%; height: 25px" value="{!Project_team__c.Contact__c}"></apex:inputField></td>
                    <td><strong><apex:outputLabel value="Role:"></apex:outputLabel></strong></td>
                    <td><apex:inputField label="" style="width: 85%; height: 25px" value="{!Project_team__c.Role__c}"></apex:inputField></td>
              		<td><strong><apex:outputLabel value="Notes:"></apex:outputLabel></strong></td>
                    <td><apex:inputField label="" style="width: 85%; height: 25px" value="{!Project_team__c.Notes__c}"></apex:inputField></td>
					<td><strong><apex:outputLabel value="Project number:"></apex:outputLabel></strong></td>
                    <td><apex:inputField label="" style="width: 85%; height: 25px" value="{!Project_team__c.Rule_closeout_report__c}"></apex:inputField></td>
                    </tr>
          			</table>
      
       		</apex:pageBlock>	 
     
            <br></br>
          	<div align="left" draggable="false" >
			<apex:commandButton styleClass="buttons" id="savenewteammember" value="Add new team member" action="{!save}" style="height:35px;width:18%;" />
        	</div>
			<br></br>          
                                                          
      		</body>
		</html>
	</apex:form>
</apex:page>

 

This is how it currently appears:

How it currently appears on screen

In the object specific challenge, i wrote the below code:

User-added image
And also checked the available for mobile app checkbox:

User-added image
And yet, in contact, while creating a new action, i cannot see the showassistant info visualforce page in the list. Please suggest what am i missing.
User-added image
I need to know how to lock and unlock a record in sfdc

Please let me know frrom real time perspective what other different techniques in what scenarios it will work.

which is the best preferred?

sheila
 
Hi all,
I have A custom object Goals__c and have a lookup of goals in contact standard object. When i am show the related List on Contacts Detail Page
I Want to Override the New Goals Button.
User-added image 
But i does not want to change my Goals__c Object new standard Button.
User-added image
is there any method to change redirection of VF page only on contact Goal__c  related list new Goals button. where as my Goal__c new button still set on standard VF page.
Hi ,

I have 2 objects Inquiry and Inquiry Details. 

On Inquiry I capture , 2 fields  : Cushion No. and Act. Sales 

Irrepsective of inquiry recrords, Cushion no. can be same . It acts like a code , and can have different Act. Sales against every inquiry.


so lets say
For Inquiry 1 , Cushion no : 123  , ActSales : 100

For Inquiry 2 , Cushion no : 123  , ActSales : 200

For Inquiry 3 , Cushion no : 123  , ActSales : 300

For Inquiry 4 , Cushion no : 456 , ActSales :  350

For Inquiry 5 , Cushion no : 456  , ActSales : 450

I have a lookup at inquiry details that looks up to the Inquiry object,

I need to pull in the blanket no. against the inquiry and sum of Act Sales against blanket number(Cushion No ; 123 Actual Sales :600, Cushion Number : 456 , Actual Sales : 800).

How can I achieve this logic via trigger.

I know the soql queries that can work for this.. But somehow having problem in cracking the logic for this one





 
Hi
I am testing my visualforce & apex coding skills .
I have implemented a extension class with standard controller to mimic the functionality of SAVE , SAVE&NEW and QUICKSAVE.
public with sharing class MimicSaveQuickSave {

    ApexPages.StandardController sController;
    
    public MimicSaveQuickSave(ApexPages.StandardController stdcontroller) {

         sController=stdcontroller;
         
    }

    public PageReference saveAndNew()
   {
   
      sController.save();
      PageReference pref=new PageReference('/003/o');
      pref.setRedirect(true);
      
      return pref;
   }
 }
<apex:page standardController="Contact" extensions="MimicSaveQuickSave">
  <apex:form >
  
    <apex:pageBlock title="My Content" mode="edit">
    
      <apex:pageBlockButtons >
      
        <apex:commandButton action="{!save}" 
                            value="Save"/>
                            
      <apex:commandButton action="{!QuickSave}" 
                            value="QuickSave"/> 

       <apex:commandButton action="{!saveAndNew}" 
                            value="SaveAndNew"/>
                            
       <apex:commandButton action="{!cancel}" 
                            value="cancel"/>

      </apex:pageBlockButtons>
      
      <apex:pageBlockSection title="My Content Section" columns="2">
        <apex:inputField value="{!contact.firstname}"/>
        <apex:inputField value="{!contact.lastname}"/>
       </apex:pageBlockSection>
    </apex:pageBlock>
  </apex:form>
</apex:page>
The SAVE &  SAVE&NEW is working but I am unable to code for QUICKSAVE
a) when I click SAVE&NEW button is it possible to redirect to the same visualforce page, so the enduser can enter the input values again.
b) how to implement QUICKSAVE functionality

Pls help me out

Thanks
sheila

 
Is it possible to create a new record when you're on an existing record. For example: When you're viewing a contact or oppotunity, is it possible to create a new record from the same page? 

I could not find a 'New' button in the page layout. Basically I would like to have a 'New' button next to Edit, Delte, Clone. Is this possible?

Thanks in advance
Create new record
Hi Developers! A Salesforce admin here humbly requesting any assistance! I have request to change the workflow that I have on the leads object, that states, when a lead is placed back in Status: "Nurture" status (not on creation) or Reject, it changes the owner to a designated queue. They would now like it to return to the person that once had ownership of it automatically.  Thinking I can create a trigger on after Update event which will check the "Lead Status" and if it is equal to "Nurture" or "Reject" then it can assign the lead to the previous owner by querying on "Lead History" object to get the Previous Owner. I have watched numerous youtube videos on creating triggers and I am afraid I am no closer to coding this, then I was before I started my deep youtube dive. Any links to resources, advice you can offer or actual code would be greatly helpful!
<apex:page Controller="CustomerController" >
    <apex:form >
        
        <apex:pageBlock title="Customer">

            <apex:pageBlockSection columns="2" title="Basic Information"> 
                <apex:inputField value="{!c.Name}"/>
                <br/>
                <apex:inputField value="{!c.Address_1__c}"/>
                <apex:inputField value="{!c.Address_2__c}"/>
                <apex:inputField value="{!c.Country__c}"/>
                <apex:inputField value="{!c.States__c}"/>
                <apex:inputField value="{!c.city__c}"/>
                <apex:inputField value="{!c.Zip_Code__c}"/>
                <apex:inputField value="{!c.Account__c}"/>
            </apex:pageBlockSection>
            <apex:pageBlockSection columns="2" title="Tour Information"> 
                <apex:inputField value="{!c.Passport_Number__c}"/>                
            </apex:pageBlockSection>
            <apex:pageBlockSection columns="2" title="Health Information"> 
                <apex:inputField value="{!c.Blood_Group__c}"/>                
            </apex:pageBlockSection>
            <apex:pageBlockSection columns="1" title="Tour Packages"> 
            </apex:pageBlockSection>
            <apex:pageBlockTable value="{!listBookings}" var="b">
                <apex:column headerValue="Type a Destination">
                    <apex:inputField value="{!b.Type_a_destination__c}"/>
                </apex:column>
                <apex:column headerValue="Travel Mode">
                    <apex:inputField value="{!b.Travel_Mode__c}"/>
                </apex:column>
                <apex:column headerValue="From Date">
                    <apex:inputField value="{!b.From_Date__c}"/>
                </apex:column>
                <apex:column headerValue="To Date">
                    <apex:inputField value="{!b.To_Date__c}"/>
                </apex:column>
                <br/>
                <apex:column headerValue="Bookings for Customer">
                    <apex:inputField value="{!b.Customer__c}"/>
                </apex:column>
            </apex:pageBlockTable>
            <apex:pageBlockButtons >
                <apex:commandButton value="Add Multiple Bookings" action="{!addBookings}"/>
                <apex:commandButton action="{!save}" value="Save"/>
            </apex:pageBlockButtons>
          <!--<apex:pageBlockTable value="{!samepage}" var="c">
          <!--<apex:column headerValue="Name">
          <apex:outputField value="{!c.name}"/>
          </apex:column>
          
          <apex:column headerValue="Address 1">
          <apex:outputField value="{!c.Address_1__c}"/>
          </apex:column>
          
          <apex:column headerValue="Address 2">
          <apex:outputField value="{!c.Address_2__c}"/>
          </apex:column>
          </apex:pageBlockTable>-->
        </apex:pageBlock>
        
    </apex:form>
</apex:page>
public with sharing class CustomerController {

    Booking__c b=new Booking__c();
    public list<Booking__c> listBookings{ get; set; }
    public Customer__c c { get; set; }

    public List<Customer__c> samepage { get; set; }
    
    public CustomerController(){
       c=new Customer__c();
        listBookings=new list<Booking__c>();
        listBookings.add(b);
    }

    Public void addBookings()
        {
            Booking__c b = new Booking__c();
            listBookings.add(b);
        }
    
    public PageReference save() {
       upsert c;  
       upsert b;
      samepage= [select id,Name,Address_1__c,Address_2__c,Country__c,States__c,city__c,Zip_Code__c,Account__c,Passport_Number__c,Blood_Group__c,Type_a_Destination__c,From_Date__c,To_Date__c from Customer__c where id=:c.id];
      
        return null;
    }
    
    public PageReference saveBookings() 
    {
        for(Integer i=0; i<listBookings.size(); i++)
            {
                insert listBookings;
            }
        upsert c;
        upsert b;
        return Page.Allbookingssaved;
    }
   }

Initially Tour Packages and Add Multiple Bookings should not be displayed.When i click save button the Tour Package section with Add Multiple Bookings needs to display.How can i achieve this?
Hello All,

I am sending email thru trigger with attachment however after sending email , attachment is being received however when I checked into the salesforce attachment is not visible into the email.

Thanks
  • October 04, 2018
  • Like
  • 0
MY VISUALFORCE PAGE CONATINS
<apex:pageblocktable value="{!var21}" var="a" ID="B">
                <apex:column >
                <apex:commandlink Value="EDIT" action="{!editaccount}" target="_blank">
                 <apex:param value="{!a.id}" assignTo="{!idvariable}"></apex:param>

                    </apex:commandlink>
                </apex:column>
                 <apex:column value="{!a.name}"/>
             </apex:pageblocktable>

MY CONTROLLER APEX:

 public string idvariable{get;set;}  

 public pagereference editaccount()
    {
        PageReference newPage = new PageReference('/'+idvariable+'/e');

  newPage.setRedirect(true);

  return newPage;
    }
<apex:page standardController="Broker__c" recordSetVar="Brokers">
    <apex:form>
  <apex:pageBlock >
    <apex:pageBlockTable value="{!Brokers}" var="b">
      <apex:column >
          <apex:commandLink action='/apex/BrokerVisualForcePage'>
              {!b.name}
              <apex:param name="bid" value="{!b.id}" />
          </apex:commandLink>
        </apex:column>
        </apex:pageBlockTable>
  </apex:pageBlock>
        <apex:pageBlock>
            <apex:detail subject="{!$CurrentPage.parameters.bid}"  id="detid"/>
        </apex:pageBlock>
    
        </apex:form>
    
</apex:page>


 
Hi Everyone,
User is not able to amend Contracts whose End Date is in the past.The error received when click 'Amend' is "Can't amend contract because no active subscriptions are available". 

I tried to get over it and found the issue was fixed :
https://success.salesforce.com/issues_view?id=a1p3A000000AU0lQAG

But I am unable to get the solution, how it can be done.I still facing the same issue to amend expired contracts. Can anyone tell me a resolution for this?

Thanks in Advance.
Hi All

I want to create a method which accepts object name and list of fields as parameters,this method should insert records to the object :

Public static void methodToInsert(String ObjectName,List<String> FieldNames)
{
//ObjectName -- holds the user passed object name
//fieldNames -- holds the names of the fields of that specific object (passed by user)
}

Generally my intention is to create records dynamically based on given object and field names

Thanks in Advance.
Hi Everyone

I have a child object 'Revenue Class' for my opportunity.I want to display the related revenue claases along with the opportunity in opportunity subpage of forecast page.

Is there a way to display the revenue class beside the opportunity?

Thanks.
HI guys,
i need to assign  territory on one user to another user. how can this be achieved in coding.please let know the solution and code if present or any references will be helpful.
Regards,
Harsha.
How to update Case when case contact role is updated.
Hi All,
I am working on Lightning Readiness report ,There is one scenario, i have to get the count of sharing button present in page layout of objects in the Org, using soql. can anyone help with the soql (in how many objects page layout  sharing button is present )
PermissionSet perm = [SELECT Name FROM PermissionSet WHERE Name = 'AccountAdmin' LIMIT 1];

List<PermissionSetAssignment> assignList = [SELECT AssigneeId FROM PermissionSetAssignment WHERE AssigneeId =: perm.Id];

List<Id> UserIds = new List<Id>();

public Boolean getNewAdd(){
    
      for(PermissionSetAssignment assign : assignList){
        UserIds.add(assign.AssigneeId);
          System.debug('[UserIds] ' + assign.AssigneeId);
      }
      if(UserIds.contains(UserInfo.getUserId()) ){
            return true;
        }else{
            return false;
      }
}
  • August 08, 2019
  • Like
  • 0
Both Account and Contact has a picklist field Status_c with values Open,Close,InProgress 
account record has 3 child record in contact
if all 3 contact has picklist value = 'close', then account picklist value will get updated to 'close'.
Hii all, 
I am facing issue in SFDX: Authorization. As"SFDX: Authorize an Org " Command is not showing in my option. What to do.User-added image
Hallo All,

I have masterdetail relationship between two objects quotes(parent) and quotelineitems(child)

REQUIREMENT: i am trying to create a trigger to update a field in quotes based on field condition in quotelineitems


NOTE: quotelineitems(child) also have lookup relationship with product(parent)

CODE:

trigger test2 on Quote (before insert) 
{
    if(trigger.isinsert && trigger.isbefore)
    {
        for(Quote q1:trigger.new)
        {
            list<quotelineitem> qli  = [select id,Produktname__c,Gegenkonto_AGBP__c from quotelineitem where Gegenkonto_AGBP__c = '84000' or Gegenkonto_AGBP__c = '84001'];
            list<quote> q = [select id,Name,Angebotsinhalt__c from quote where recordtype.name = 'angebot'];
            if(qli.Gegenkonto_AGBP__c == '84000')
            {
                q.Angebotsinhalt__c = qli.Produktname__c;
            } 
            else if(qli.Gegenkonto_AGBP__c == '84001')
            {
               q.Angebotsinhalt__c = 'produktion'; 
            }
            else
            {
                q.Angebotsinhalt__c = 'sonstiges';
            }
        }
    }
}

ERRORS:

Variable does not exist: Gegenkonto_AGBP__c
Variable does not exist: Produktname__c
Variable does not exist: Angebotsinhalt__c
Variable does not exist: Gegenkonto_AGBP__c
Variable does not exist: Angebotsinhalt__c
Variable does not exist: Angebotsinhalt__c


but when i look at the objects metadata i have all the above mentioned fields but when i try to code i am getting the above errors.

quote object fields:

Angebotsinhalt__c(text field)

quotelineitem fields:
Produktname__c(text field)
Gegenkonto_AGBP__c(picklist field)

Can someone please let me know at which part of the code i have gone wrong so that i can rectify?

Thanks for your help!




 

Ex - There is one button(action) we have created.

when user clicked that button from LE so it should open view in Lightning ,
when user clicked from classic it should open in classic view
when user clicked from salesforce1 it should be open in respective view.
based on which things we can come to know. can any one gives me sample code ?


 

I have a trigger to insert document record whenever Contact record is created and I have one custom field Image__c which is Ritch Text Area data type, I am storing images in Image__C field, How can get this image__c into the document?
Hi Experts,

I have small requirement where i need to filter a long text area field called Desc__c which i am not able to do that can anyone help me please.

OrderItem oli1 = new OrderItem ();
        oli1.Orderid = order.Id;
        oli1.Desc__c= 'Test OLI 1'; 
      insert oli1;


 OrderItem oli2 = [SELECT Id, Orderid
                    FROM OrderItem WHERE  Desc__c = 'Test OLI 1' LIMIT 1];

In this filter condition its throwing an error can anyone help me please thanks in adavance
User-added imageAny resason why its taking as null.
Code whre i am hard coding the value:
User-added image
Hi Team, Please help me on how to create a user when a contact is created using trigger.
 for(Contact c:[selectid,accountid,phone,mailingstreet,mailingcity,mailingpostalcode,mailingcountry,mailingstate fromcontact where accountid in :trigger.new]) {
    account a = trigger.newmap.get(c.accountid);
    boolean updatedrecord = false;
   if(c.phone == trigger.oldmap.get(c.accountid).phone) {
      c.phone = a.phone;
      updatedrecord = true;
    }
There is a custom field total in account. I want to update field value with the sum of previous record total value and new record total record value if they have same industry and record type
Hi There,
can any one help me to write a trigger to update account phone number from the  recent created  contact or recent updated contact phone. 
the scenario should hold if there is multiple contact on account, updated uith the latest  created  contact phone or recent updated contact phone.
Hi ,

I am unable write code cover for the below else condition because of Test.isRunningTest(), In every time if condition is executed, but else is not executing. help me on this. 

if ((Name__c != null && Cheque_Number__c != null && Branch__c != null ) || Test.isRunningTest()) {
errMsg = 'Name existing in database';
} else {
errMsg='';
}

Thanks in Advance

Regards,
raju
This query Select Id,User.name,TeamMemberRole from AccountTeamMember where Account.Id ='accontID' in query editor gives username wrt user.name but when i run the same query in Execute Anonymous the debug log gives me Userid for User.Name. What do you guys think the reason is? Appreciate your help
  • October 04, 2018
  • Like
  • 1