• Deepali Kulshrestha
  • PRO
  • 3488 Points
  • Member since 2016
  • Salesforce Developer
  • Cloud Analogy

  • Chatter
  • 116
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
  • 1082
I want to call a function in every 5-second lightning component controller. 
I am getting NullPointerException error while saving a new contact record.
Here is the exact error message:
Error: Invalid Data. 
Review all error messages below to correct your data.
Apex trigger ContactTrigger caused an unexpected exception, contact your administrator: ContactTrigger: execution of AfterInsert caused by: System.NullPointerException: Attempt to de-reference a null object: ()

I am new to apex coding and this code isn't written by me, so finding it hard to troubleshoot the issue. Would anyone be able to help?
Here is Apex Trigger:
trigger ContactTrigger on Contact (before delete, after insert, after update,after delete,after undelete) { 
    if(Trigger.isAfter) {
            if(Trigger.isUpdate) {

And here is the Apex Class:
public class ContactTriggerHandler {
    public static void onAfterUpdate(List<Contact> newContacts, Map<id,Contact> oldContacts) {
            id cpCapitalPartnerRT = fetchRecordTypeId('Account','CP Capital Partner');
            List<Contact> newList = new List<Contact>();
            set<Id> oldAndNewAccountIds = new set<id>();
            for(Contact con : newContacts) {
            Map<Id,Account> accountDetails = new Map<Id,Account>([Select Id,RecordTypeId from Account where Id in :oldAndNewAccountIds]);
            for(Contact con : newContacts) {
                    if(accountDetails !=NULL && con!= Null && con.accountId != oldContacts.get(con.Id).accountId  ) { 
                        if(  accountDetails.containsKey(con.accountId) && (accountDetails.get(con.accountId).recordTypeId == cpCapitalPartnerRT || accountDetails.get(oldContacts.get(con.Id).accountId).recordTypeId == cpCapitalPartnerRT) ) {

                    } else if(accountDetails !=NULL && con!= Null && accountDetails.get(con.accountId).recordTypeId == cpCapitalPartnerRT ) {  
    public static void OnAfterDelete(contact[] oldList){
        updateCPIntralinksAccess(oldList, null);
     public static void OnAfterInsert(contact[] newList){
        updateCPIntralinksAccess(newList, null);
    public static void OnUndelete(contact[] newList){ 
    private static void updateSalutationOnCommunicationContent(List<Contact> newContacts, Map<id,Contact> oldContacts){
        set<id> contactsToProcess = new set<id>();

        for(Contact con : newContacts) {
            if((String.isNotBlank(con.email) && !con.email.contains('@generalatlantic.com'))  && ((con.Seniority_Rank__c != oldContacts.get(con.Id).Seniority_Rank__c) ||
                                                                                                  (con.FirstName != oldContacts.get(con.id).FirstName)) || (con.International_Salutation_Type__c!= oldContacts.get(con.Id).International_Salutation_Type__c || String.isBlank(oldContacts.get(con.Id).email))
        if(contactsToProcess.size() > 0) {
            List<Correspondence_Preference__c> corrPrefToProcess = new List<Correspondence_Preference__c>([Select Id, Company__c, RecordType.Name from Correspondence_Preference__c where Recipient_Type__c = 'To' AND Contact__c In :contactsToProcess]);
            set<string> cpNames = new Set<String>();
            set<string> accountNames = new Set<String>();
            for(Correspondence_Preference__c cp : corrPrefToProcess) {
            List<Communications_Content__c> ccList = new List<Communications_Content__c>([Select Id,Salutation__c,Company__c,Correspondence_Preference__c from Communications_Content__c where Company__c IN :accountNames AND Correspondence_Preference__c IN :cpNames]);
            CommunicationContentTriggerHandler handler = new CommunicationContentTriggerHandler(true,200,true);
    private static void updateSortedCorrespondencePreferneceData(List<Contact> newContacts, Map<id,Contact> oldContacts) {
        set<id> contactsToProcess = new set<id>();
        for(Contact con : newContacts) {
            if((con.Seniority_Rank__c != oldContacts.get(con.Id).Seniority_Rank__c) ||
               (con.Email != oldContacts.get(con.id).Email)
              ) {
        if(contactsToProcess.size() > 0) {
            List<Correspondence_Preference__c> corrPrefToProcess = new List<Correspondence_Preference__c>([Select Id, Commitment__c, RecordTypeId from Correspondence_Preference__c where Contact__c In :contactsToProcess]);
    private static id fetchRecordTypeId(string sObj, string rt) {
        System.debug('fetch params>>'+sObj + '<<<rt>>>'+rt);
        String recordtypeId = Schema.getGlobalDescribe().get(sObj).getDescribe().getRecordTypeInfosByName().get(rt).getRecordTypeId(); 
        return Schema.getGlobalDescribe().get(sObj).getDescribe().getRecordTypeInfosByName().get(rt).getRecordTypeId();
    public static void updateCPIntralinksAccess(List<Contact> newContacts, Map<id,Contact> OldMap){
        Map<ID,List<contact>> mapConWithAcc = new Map<ID,List<contact>>();
        List<account> accList = new List<account>();
        String temp= '';
        Map<Id,String> accUpdateMap = new Map<Id,String>();
        Set<ID> accid = new Set<ID>();
        for(contact con: newContacts){
            if(oldMap == null || (oldMap.get(con.id).CP_Intralinks_Access__c != con.CP_Intralinks_Access__c)){ 
            if(oldMap.get(con.Id).AccountId != con.AccountId)

        for(Account acc : [Select id,CP_Intralinks_Access__c,(Select id,CP_Intralinks_Access__c,accountid from contacts) from account where id in :accid]) {
            set<string> val = new set<string>();
            String finalVal = '' ;
            for(Contact ct : acc.contacts) {
                if(String.isNOtBlank(ct.CP_Intralinks_Access__c)) {
            List<String> valList = new List<String>();
            if(valList.size() > 0) {
                finalVal = String.join(valList,',');
            acc.CP_Intralinks_Access__c = finalVal ;
        if(accList.size() > 0) {
            update accList ;

I have found a way through CSS to change the colour of the label for all of my <lightning:input> fields using the code below:

.THIS label.slds-form-element__label{
    font-size: 1.00rem;
    color: blue;

but I have 2 fields that are <ui:inputDate> fields, how do I change the colour of their label?

User-added image

Here is the code for the Purchase Date field:

<ui:inputDate aura:id="PurchaseDate" label="Purchase Date" class="field" value="{!v.AcctForm.PurchaseDate__c}" displayDatePicker="true" /> 

Thank you in advance for any assitance you can provide.
Hello Everyone

Need Small Help

I am new to the slds, i am trying to display certain lightning cards, my Requirement is when i click on that card it should change the color
can anyone please suggest how can i do that

below is my code and snapshot

<aura:component >
 <a class="slds-badge__icon" href="javascript:void(0);">1BHK Available</a>
<a class="slds-button slds-button_neutral" href="javascript:void(0);">2BHK Available</a>
<a class="slds-button slds-button_brand" href="javascript:void(0);">3BHK Available</a>
<a class="slds-button slds-button_outline-brand" href="javascript:void(0);">1BHK Blocked</a>
<a class="slds-button slds-button_destructive" href="javascript:void(0);">1BHK Blocked</a>
<a class="slds-button slds-button_text-destructive" href="javascript:void(0);">1BHK Blocked</a>
<a class="slds-button slds-button_success" href="javascript:void(0);">1BHK Blocked</a>

User-added image
Using validation rule How to  make sure no two Opportunities have same Name. 
Rule will throw error only if “Some Field” field “value” is checked to false.
And able to control email sending behaviour based on User/Profile.


I dont want to  allow making Opportunity Stage = “Closed Won” or “Closed Lost” when the Opportunity Amount is greater or equal $500,000.



I need to implement a validation rule which should take effect  for all new record created after a specific date. I have a field called  Unit_Cost__c , this field can not be blank for all records created after  July 25, 2019. Below is a draft of my work.  The error message is: Syntax error. Missing ')'

AND(DateValue(CreatedDate)=>Date(2019, 07,25 ), 
(ISBLANK(  Unit_Cost__c  )))
Hello, I am beginner. Help me with This,
1.When Should we use Map In Trigger.
2.Give me some trigger scenerios for account, contact, lead, opportunity in which Map can be used.
i am getting error while solving trailhead challange. please find below error.

"Method does not exist or incorrect signature: void generateStringArray(Integer) from the type StringArrayTest"

I tried some code given as best answers.

1. First Code I tried
public class StringArrayTest
public static List<String> generateStringArray(Integer n) {
List<String> myArray = new List<String>();
for(Integer i=0;i<n;i++) {
myArray.add('Test '+i);
return myArray;

2. Second Code I tried
public class StringArrayTest {
public static List<String> generateStringArray(Integer n) {
List<String> List1 = new List<String>();
for(Integer i =0; i < n; ++i)
List1.add('Test ' + i);
return List1;

I am executing this code from DEBUG > Open Execute Anonymous Window and writing below code to call method.


Please suggest, How can I fix this

I'm currently using the Document object/table in SOQL to extract attachments in Salesforce classic.
As far as I'm aware in Lightning it is necessary to use File instead of Document object to extract attachments.
In SOQL there is no such File table and I need to know how to extract attachments data in Lightning Experience?
I'm new to code, can someone help and give me an idea how I can create an entry form as below with Lightning Component?
User-added image
Can anyone explain Difference between Process Builder and Flows with example ? 
Thanks in Advance. 
public with sharing class AccountListCon {
    static List<String> TARGET_FIELDS = new List<String>{

    public SearchCondition condition{ get;set; }
    public List<AccountList__c> results { get;set; }
    public String sortingField { get;set; }

    public void init(){
        this.condition = new SearchCondition();
        this.results = new List<AccountList__c>();

    public PageReference clear(){
        return null;

    public PageReference search() {

        if( condition.validate() ){
            return null;

        String soqlQuery = condition.getSoqlQuery();
        System.debug('[soql] ' + soqlQuery);

            this.results = database.query(soqlQuery);
        }catch(DmlException e){
            System.debug('[DmlException]' + e);
        }catch(Exception e){
            System.debug('[Exception]' + e);
        return null;

    public PageReference sort(){

        if(this.sortingField == null ){
            return null;

        if(this.sortingField == this.condition.sortkey){
        else {
            this.condition.sortkey = this.sortingField;
        return null;

    public String getSortKey(){
        return this.condition.sortkey;

    public String getSortOrder(){
        return this.condition.sortOrderToString();

    public Class SearchCondition {

    private Time JST_AM0 = Time.newInstance(9, 0, 0, 0);

        public AccountList__c obj {get;set;}

        public String sortkey { get;set; }
        public String order { get;set; }

        public SearchCondition() {
            this.obj = new AccountList__c();

            sortkey = 'LastModifiedDate';
            order = 'DESC';

        public boolean validate(){
            boolean isError = false;

            return isError;

        public String getSoqlQuery(){
            List<String> param = new String[]{ getFieldList(), getWhere(), getOrder() };
            return String.format('SELECT {0} FROM AccountList__c {1} {2} LIMIT 500', param);

        private String getFieldList(){
            return String.join(TARGET_FIELDS, ',');

        private String getWhere(){
            List<String> param = new String[]{ };

            if( !String.isBlank(this.obj.ServerName__c) ){
                param.add('ServerName__c LIKE \'%' + obj.ServerName__c + '%\'');

                return '';
            return 'WHERE ' + String.join(param, ' AND ');

        private String getOrder(){
            List<String> param = new String[]{ sortkey, order };
            return String.format('ORDER BY {0} {1}', param);

        private DateTime adjustJSTtoGMS(DateTime day){
            JST_AM0 = Time.newInstance(15, 0, 0, 0);
            return Datetime.newInstance(day.date(), JST_AM0);

        public String sortOrderToString(){
            if(this.order == 'DESC'){
                return '▼';
            return '▲';

        public void setOrderReverse(){
            if(this.order == 'DESC'){
                this.order = 'ASC';
            else {
                this.order = 'DESC';


<apex:page controller="AccountListCon" action="{!init}" sidebar="false" Id="AccountRequestList" >

<script type="text/javascript">
    beenFocused = true;
<apex:form id="form1">
    <apex:pageBlock title="検索">
        <apex:pageMessages id="messagearea" showDetail="false"/>
        <apex:pageblockSection id="conditionSection" title="検索" columns="1">
            <apex:outputpanel id="searchcondition">
                <ul id="conditionTable">

                    <span class="label"><apex:outputLabel value="サーバ名" for="ServerName" styleClass="labelCol" /></span>
                    <span><apex:inputField id="ServerName" value="{!condition.obj.ServerName__c}" /></span>

        <apex:pageBlockButtons id="buttonSection" location="bottom" >
            <apex:commandLink value="検索" action="{!search}" reRender="searchresult,messagearea" />

            <apex:commandLink value="クリア" action="{!clear}"   reRender="searchcondition,searchresult,messagearea"/>

<apex:outputpanel id="searchresult">
    <apex:pageBlock title="検索結果:" rendered="{!(results.size == 0)}">

    <apex:form id="resultForm">
        <apex:pageBlock id="resultBlock" title="一覧" rendered="{!(results.size > 0)}">
            <apex:outputtext style="width:110px" value="結果 : {!results.size}件"/>

            <apex:pageblockTable id="resultTable" value="{!results}" var="o" frame="box">

                <apex:column style="width:80px">
                    <apex:facet name="header">
                        <apex:commandLink action="{!sort}" value="ID{!IF(sortKey == 'Name', sortOrder, ' ')}">
                            <apex:param value="Name" name="String" assignTo="{!sortingField}" />
                    <apex:outputlink value="/{!o.Id}"><apex:outputField style="width:80px" value="{!o.Name}"/></apex:outputlink>

                <apex:column style="width:80px">
                    <apex:facet name="header">
                        <apex:commandLink action="{!sort}" value="サーバー名{!IF(sortKey == 'ServerName__c', sortOrder, ' ')}">
                            <apex:param value="ServerName__c" name="String" assignTo="{!sortingField}" />
                    <apex:outputField style="width:150px" value="{!o.ServerName__c}"/>



It was possible to here.
But how do I get pagination?

  • July 23, 2019
  • Like
  • 0
Hi All,

I have made a visualforce page and I want to render it as pdf and store in one field. I have created the apex class and using future callout for the generation of PDF. When I tried from the backend then the PDF is generating correctly but at the same time when I am trying from the site guest user then the content is not rendering on PDF. It is generating only the blank PDF. 

Please help me with this. How to resolve this issue.

I don't know how to write code in Salesforce but after a lot of digging and searching, I found a possible way of adding the Case Creator as a Case Team Member every time a new Case was created. Thus, I copied and paste one in my Sandbox and made the adjustments necessary to make it work for my ORG.
It is working fine in Sandbox, but while trying to deploy it from my sandbox using Change Sets. The trigger is failing with the following error:

"The following triggers have 0% code coverage. Each trigger must have at least 1% code coverage."

As I don't do coding I don't know what I can do in order to be able to move this successfully to my production environment. Any help is really appreciated. 

Thank you,
Hi All,
I want to get grand total of formula field.My report is meant to give the movement of work in progress value from month to month. For the same I have created two formula fields and every thing is working fine. Now what I want is to get grand total of one of the formula field. It is a matrix report. Please help me with this.

Thanks in advance.User-added image
I created a process builder recently. As it was no longer in use I deleted it from my org. Now, while making any changes in the records I am still receiving the mail with error message regarding process builder failure. 
Error element myRule_1_A1 (FlowRecordUpdate).
The flow tried to update these records: 0034100000TxUl2AAF. This error occurred: ALL_OR_NONE_OPERATION_ROLLED_BACK: Record rolled back because not all records were valid and the request was using AllOrNone header.

It would be helpful of you if you can solve my problem.
I am trying to create dashboard using Sales Analytics app. It seems that lot has been changed in Winter'18 release. While creating new app I am getting following ERROR: 33 User Dataflow Instructions executed, 41 failed.Please let me know how to resolve it. Thanks 
Hi All, 
I am new to Pardot. My requirement is to send email alert to user and an additional email whenever a Prospect is created in Pardot. I want to send the same email which is generated by default to assigned user only. I tried creating engagement studio and one-to-one email but was not able to find the solution. Please help me solve my issue
Hi All,
While setting up developer console for my Enterprise edition I don't know why it is not showing up in lightning inspite of the fact that lightning is enabled for the org.​ Can anyone help me with it?​
User-added image

Hi there, I'm not sure what's wrong with my logic here:

AND ( ISPICKVAL(A_la_carte__c, "")
OR (
ISPICKVAL( Opportunity_Type__c, "Video Ad Server"),  
ISPICKVAL( Opportunity_Type__c, "VAD Renewal"),
ISPICKVAL( Opportunity_Type__c, "Amendment"),
) )

I'm trying to say, if the opportunity type selected is any of the above, and a value is not selected in the drop down 'A_la_carte__c' then show validation rule. I'm getting the synax error "Extra OR." Thanks in advance for your help.

I hit the First error: [null] AsyncApexExecutions Limit exceeded and now I can't start batches on the full sandbox because of It. I read that this is 24h limit so I waited for a day (week atm). Unfortunately, It didn't help. Is there a way to fix the sandbox?
trigger Count_Of_JobApp on job_application__c (after insert,after delete) 
    if((Trigger.isInsert && Trigger.isAfter) || (Trigger.isDelete && Trigger.isAfter))
        Set<Id> parentIdsSet = new Set<Id>();
        List<Position__c> positionList = new List<Position__c>();
            for(job_application__c jobObj : Trigger.new){
        }else if(Trigger.isDelete)  {
            for(job_application__c jobObj : Trigger.old){
        if(parentIdsSet.size() > 0){
            positionList = [SELECT Id,
                            (SELECT Name
                             FROM job_applications__r)
                            FROM Position__c
                            WHERE Id IN : parentIdsSet];
        if(positionList.size() > 0){
            for(Position__c postionObj : positionList){
                postionObj.Count_Of_Job_App__c = postionObj.job_applications__r.size();//Error on this line.
            update positionList;
I recently started completing the 'Build Lightning Web Components' trail on Trailhead and as much as it is informational and pretty cool I am getting more and more confused about terminology. 

They refer to 'Lightning Web Components'... are these different from 'Lightning Components'? If so, how?

'Lightning Components' is just another term for 'Aura Components', right?

Finally, how do 'VisualForce Components' tie into all of this?
  List<Lead> numberOfLeads = [select Id from Lead];

I need number of Leads but above my code is returning 0 always, please help me. thanks in advance
Custom roll-up – Keep relation between Position and Job application as lookup. Create a number field on Position object. This field should contain count of its child job applications. Do this using a trigger.
Hello all

i am new to the vf, i am trying to populate the field values in a table format for the custom object, (i have not used Custom controllers)
how do i populate the field values in 2 columns like shown in the snapshot

below is my code

<apex:page standardController="Apartment__c" showHeader="false" renderAs="pdf" DocType="html">
<apex:form >
   <apex:pageBlock title="Appartment Details">
           <apex:pageBlockSection >
         <table style="width:100%">   
          <td> <apex:outputField value="{! Apartment__c.Name }" /> </td>
          <td> <apex:outputField value="{! Apartment__c.Floor_No__c }"/> </td>
          <td> <apex:outputField value="{! Apartment__c.Phase__c }" /> </td>
         <td> <apex:outputField value="{! Apartment__c.Property_No__c }"/> </td>
         <td> <apex:outputField value="{! Apartment__c.Facing__c }" /> </td>
          <td> <apex:outputField value="{! Apartment__c.Terrace_Area_Cost__c }"/> </td>

it should show something like this
Hi all,
I have created a batch class but still i am getting error "First error: Too many Email Invocations: 11" .

Can anyone solve this issue.
Below is my batch class.
global class batchexpense implements Database.Batchable<sObject> {
    global Database.QueryLocator start(Database.BatchableContext BC){
       String query = 'Select Name_of_Employee__c from Expense_Management__c where CreatedDate = LAST_N_DAYS:15';
       return Database.getQueryLocator(query);
	global void execute(Database.BatchableContext BC, List<Expense_Management__c> scope){
   		Set<String> myset = new Set<String>();
		for(Expense_Management__c aa : scope)
   		 for(Expense_Management__c cc : [select id,Name_of_Employee__r.email,Name_of_Employee__c from Expense_Management__c WHERE Name_of_Employee__c =: myset ])
            list<Messaging.SingleEmailMessage> mails =  new List<Messaging.SingleEmailMessage>();  
            Messaging.SingleEmailMessage semail = new Messaging.SingleEmailMessage();
			Messaging.EmailFileAttachment attach = new Messaging.EmailFileAttachment();
            PageReference pref = page.ExpenseReport;
            pref.getParameters().put('Id',cc.Name_of_Employee__c );
             Blob b;
             if(Test.isRunningTest()) { 
                b = blob.valueOf('Unit.Test');
            } else {
                b = pref.getContent();
            semail.setSubject('Expense details');
            semail.setSenderDisplayName('salesforce User');
            List<String> sendTo = new List<String>();//to string
            String emailBody =' <html><body><p> Dear  ,<br><br> Please find the attached Expense details. <br><br>    Regards, <br> IT Team <br>  Sayaji Groups.</p></body></html>';
            semail.setFileAttachments(new Messaging.EmailFileAttachment[]{attach});
            Messaging.sendEmail(new Messaging.SingleEmailMessage[]{semail});
    	global void finish(Database.BatchableContext BC){

Thanks in advance
Hi folks,

I've been trying to look for a solution with no luck.
Simply, I'm trying to write an apex trigger to check whether a date/time field is empty while a status field is set to a specific value at the creation or the update of a record...

Any help much appreciated. Thanks
i have this below result from apex 
result =

          "Test__c":"India; Africa; Mombasa",
          "Test1__c":"AFR; TFR; GFR"

i am able to generate csv as below -
"0012v00002InPVmAAN","India; Africa; Mombasa","AFR; TFR; GFR"

i am want to create a csv file out of the above data, basically splitting semicolon separated values into multiple rows with other data

JS - 
downloadCSVFile() {
        let rowEnd = '\n';
        let csvString = '';
        // this set elminates the duplicates if have any duplicate keys
        let rowData = new Set();
        // getting keys from data
        this.data.forEach(function (record) {
            Object.keys(record).forEach(function (key) {
        // Array.from() method returns an Array object from any object with a length property or an iterable object.
        rowData = Array.from(rowData);
        // splitting using ','
        csvString += rowData.join(',');
        csvString += rowEnd;
        // main for loop to get the data based on key value
        for (let i = 0; i < this.data.length; i++) {
            let colValue = 0;

            // validating keys in data
            for (let key in rowData) {
                if (rowData.hasOwnProperty(key)) {
                    // Key value 
                    // Ex: Id, Name
                    let rowKey = rowData[key];
                    // add , after every value except the first.
                    if (colValue > 0) {
                        csvString += ',';
                    // If the column is undefined, it as blank in the CSV file.
                    let value = this.data[i][rowKey] === undefined ? '' : this.data[i][rowKey];
                    csvString += '"' + value + '"';
            csvString += rowEnd;

Hey guys , I am beginner to salesforce, My requirement is to write the Apex trigger,
-- Suppose I have 1 account Name X and It has 2 contacts, so for the same account X , the email of the Contacts should not be same , if same It should show error. Suppose 1 contact email is abc@g.com and 2 contact email is xyz @g.com , this should be accepted. if both contact has same email address then it should not be accepted.

But  if have another account Name Y and it has 2 contact, and if email of 1 of the contact is abc@g.com  which is the email of  contact of account  X then it should be accepted, 

So please suggest me the apex trigger for the above requirement.
Note- Please dont share any link for this,, if possible give me explanation with example 

Thank you
I have a visualforce page and the standard object is the Account. I'm trying to map a field from the related child record to the account visualforce page.

I'm not sure how to map the field {!Account.Bids_Sent__c.Test__c} on the visualforce page. 

 I am getting the following error.

Error: Invalid field Bids_Sent__c for SObject Account
I use the follwing query to find the median account revenue
List<AggregateResult> totalOppsClosedWon365 = [select AccountId, sum(Amount__c) Revenue, Account.Stage__c
 from Opportunity
where CloseDate = LAST_N_DAYS:365 and StageName = 'Closed Won' 
group by AccountId, Account.Stage__c
order by sum(Amount__c) asc];
but how do I access the Revenue value at the specific index which marks the center of the list? For example the Revenue at index 100 because this is the center of the list. 

I apprechiate any help! 
Hi Team,

I need help on testclass for below lightning componnet apex class.
Can anyone help me on this .

public class LightningTabComponentController {
/* Method to fetch the parameters used for framing the URL*/ 
    public static OpptyRelatedData getCustomsettingValue()
       OpptyRelatedData returnrelateddata = new  OpptyRelatedData ();
       string cusseturl= SMX_URL__c.getInstance().SMX_URL__c;
       returnrelateddata.SMX = cusseturl;
       string cusseturl1 = SFDC_URL__c.getInstance().SFDC_URL__c;
       returnrelateddata.SFDCURL = cusseturl1;
       String username = UserInfo.getUsername();
       String sessionId = UserInfo.getsessionId();
       String npxaccview = SFDC_URL__c.getInstance().NPX_Account_View_Embed__c;
        String npxconview = SFDC_URL__c.getInstance().NPX_Contact_View_Embed__c;
         string urler = URL.getSalesforceBaseUrl().toExternalForm();
       return returnrelateddata;
    public class OpptyRelatedData{
        Public string SMX{get;set;}
        public string SFDCURL{get;set;}
        public string username{get;set;}
        public string sessionId{get;set;}
        public string npxaccview{get;set;}
        public string npxconview{get;set;}
        public string urler{get;set;}

I parent Object and child object 

Parent: state
Parent Field: Status(picklist Field): values are:(IN,OUT)
Child :city
Child Field: Yes(Check Box)

Need help in writing a trigger : 

Scenerio:When ever picklist values are changed ex: IN to OUt  or OUT to IN The trigger need to Check the YES filed and immediately Uncheck.

  • August 02, 2019
  • Like
  • 0