• SFDC New learner
  • NEWBIE
  • 105 Points
  • Member since 2017

  • Chatter
    Feed
  • 1
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 50
    Questions
  • 55
    Replies
When you click 'View All' on Related List, you get a list view of all the records. How can you customize that page?
I want to remove the 'New' action button on that page
Hi All,

I have created the field of type number and trying to update the field with leading zeros if the number of digits is less than 10. I am updating the field using flow, but getting the following error.
"The formula expression is invalid: Formula result is data type (Text), incompatible with expected data type (Number)."

LPAD( TEXT({!$Record.Individual_Number__c}) ,10,'0')
I don't see the above error if I give VALUE() function. But it didn't work as I expected.
Please Suggest.
Thanks,
Hi All,

What is the best way to write the code to retrieve the record type?
Below are the two ways 
1. ID rtId = [SELECT Id FROM RecordType WHERE sObjectType='Opportunity' AND Name='RT1'].Id;
2. Id rtId = Schema.SObjectType.Opportunity.getRecordTypeInfosByDeveloperName().get('RT1').getRecordTypeId();

Thanks!
Hi Everyone,

I have created an profile by cloning existing profile(Sales Administer) and assigned record types,page layouts, object permissions and field level permissions to Account object.
But when I try to deploy the profile and include only the Account Object and specific fields in the package. It is deploying all the objects which are having access to the profile though I have not given in the package level. Can we control the access level in the package level while deploying the profile so that it will avoid removing unnecessory objects and fields manually?
User-added image
Please Suggest. 
Thanks
Hi All,


I have created a quick action on account and added this page layout in the opportunity page layout. While deploying from our DEV org to QA org this quick action is showing up, but when I deployed the same from QA org to UAT org, it's not showing up. Would like to know the reason and cause of this issue.
Below the code used in the package to deploy the code 

<types>
    <name>FlexiPage</name>
    <members>Opportunity_Record_Page</members>
  </types>
<types>
    <name>QuickAction</name>
    <members>Account.Broker_Information</members>
   </types>

Can someone please suggest? Appreciate your help.
Thank You!


 
Hello Everyone,

I have a requirement where I need to show the opportunity sales path only 4 and stages picklist should have additional values. Is it possible to show the values. 
For example: Sales Path - In Progress,Quoted,Verbal and Closed 
Stage - Business Developement,Finialist etc..
How do I implement this functionality. Can anyone help me.
Thanks,
Sirisha
Hi All,

I have a requirement where we need to send email to users. Created a send email quick action button and with the action type as send email.
When I tested this functionality and send the test email. It is showing in the activity list but won't receive the email. I enabled the deliverability to 'All email' . How do the users or I  will receive the email.
Please suggest. 

Thanks,
Sirisha 
Hi Everyone,

Greetings!!

We have a requirementt o integrating with multiple systems using Mulesoft. Here, Mulesoft will use the REST API  integrate with other systems and builds the interface to send the data to salesforce. How do we consume this interface in Salesforce. I did some research and learned that there is a Salesforce Connector which will help to get the data from Mulesoft. I just want to know more about this. Appreciate it If someone can share any additional details that will help me.
Thanks!!
Hello Everyone,

I have a requirement where I need to extract the data model to excel. I am having challenge to do it manually as our org has lot of fields and nearly 700 objects. I tried to install appexchange but it is not allowing me to install in our org. Appreciate if anyone help me on this.
Thanks
Hi All,

I have a requirement where account's user updated related contact's user should be populated with the same value. I have written a trigger which will get execute and passes the accountid to batchclass and updates the contact field.
Now, when I write the batchclass and call it from Test.starttest () and Test.stoptest(), it is not executing execute method of batch class.

Below is the sample code:
Trigger accountupdate on Account(before update){
Map<Id,Account> accmap = new Map<Id,Account>();
for(Account a : trigger.new) {
if(a.userid!=null && a.parentId!=null && trigger.oldmap.get(a.id).userid != trigger.newmap.get(a.id).userid)){
accmap.put(a.id,a);
}}
database.executeBatch(new AccountUpdateBatch(accmap));
------------------------------------------
Batch Class
global class AccountUpdateBatch implements Database.Batachable<sObject>{
Map<Id, Account> acctmap = new Map<Id,Account>();
 global  AccountUpdateBatch(Map<Id,Account> accmap){
acctmap = accmap;
}
global Database.getQuerylocator start(Database.BatachableContext bc){
return Database.getquerylocator([select id,name,userid,accountid from contact where accountid in:acctmap.keyset()];

global void execute(Database.BatchableContext bc, list<contact> scope){

List<Contact> updateconlist = new List<contact>();
for(contact con:scope){
if(con.AccountId!=null)
{
if(acctmap.get(con.AccountId).userid!=null)
con.userid = acctmap.get(con.accountid).userid;
updateconlist.add(con);

}
}
update updateconlist;


-----------------
Test class:
@isTest
public class TestAccountBatch{
@isTest
public static void testbatch(){
user uid = new user(lastname ='Test user');
insert u;
Account parentacc = new Account(name = 'Parent account',recordtypeid='xxxx');
insert parentacc;
List<Account> acclist = new List<Account>();
Map<ID, ACcount> acckeymap = new Map<ID,Account>();
for(Integer i=0;i<200;i++)
Account acc= new Account();
acc.name='Test'+i;
acc.recordtypeid ='XXXX';
acc.parentid=parentacc.id;
acclist.add(acc);
acckeymap.put(acc.id,acc);

}
insert acclist;

List<Account> updateuser = new List<Account>();
Map<Id,Account> updatedacctidmap = new Map<Id,Account>();
updateuser =[select id,userid from account where id in:acckeymap.keyset()];
for(Account acc:updateuser ){
 acc.userid = u.id;
updatedacctidmap.put(acc.id,acc);
}
update updateuser;
Test.starttest();
    AccountUpdateBatch obj = new AccountUpdateBatch(updatedacctidmap)
database.executeBatch(obj);
Test.stoptest();

}
}
The test class is only covering 31% code coverage. The code highlighted in bold is not covering. Appreciate it if anyone can help me to write the test class. Thanks!
Hi All,

 I have a requirement where we need to create 2 profiles.
1) Profile1:Able to run reports, edit few fields, and show data
2) Profile 2: Can log view data, edit few fields, log calls and meetings, send email but no editing ability
Appreciate it if anyone can help me how to permissions and creating profiles?

Thanks,
Sirisha
 
Hi Everyone,

I am trying to inline edit the data table.
I followed this example to update the draft values to the server.
http://simpluslabs.com/how-to-use-lightningdatatable/

<lightning:datatable aura:id="contactDatatable" columns="{! v.mycolumns }"
                                             data="{! v.dates }"
                                             keyField="id"
                                             hidecheckboxcolumn="true"
                                                onsave="{! c.saveTable }"
                                             
                                             /> 
saveTable:function (cmp,event,helper)
    {
        console.log('insavetable');
        var draftValues = event.getParam('draftValues');
        helper.onSave(cmp,draftValues);
    },
onSave:function(cmp,draftValues)
    {
        console.log('onsave');
        var tsId = cmp.get("v.timeSheetId");
        alert(tsId);
        console.log(tsId);
        var action=cmp.get("c.updateTime1");
        action.setParams({"tsId":tsId,"updatedTimeList":draftValues});
        action.setCallback(this,function(response)
                           {
                              var state=response.getState();
                               if(state='SUCCESS')
                               {
                                 //  console.log('success'+JSON.stringify(response.getReturnValue()));
                                   console.log('success');
                                   
                               }
                               else 
                               {
                                   console.log(state);
                               }
                                   
                           });
        $A.enqueueAction(action);
    },
@AuraEnabled    
    public static List < TimePeriod__c > updateTime1(String tsId, List < TimePeriod__c > updatedTimeList ) {    
          updatedTimeList=[select  Id, Date__c,IsAlreadySubmitted__c,Status__c, Volunteer_Recurrence_Schedule__c,Volunteer_Hours__r.name, Time__c, Hours_Worked__c from TimePeriod__c where time__c =:tsId];  
        
        for(TimePeriod__c tp: updatedTimeList){   
            system.debug('SignIn__c'+tp.Sign_In__c); --> null values
            system.debug('SignOut'+tp.Sign_Out__c);--> null values
            system.debug('hoursworked'+tp.Hours_Worked__c);--> null values

        }
          system.debug('updated'+updatedTimeList);
            update updatedTimeList;}
Can anyone help me to fix this issue? TIA

Thanks,
Sirisha
Hi All,

I have an object with a start date and an end date. I am trying to create insert weekly dates in one object and a list of dates between the start date and end date in another object.
Object A
start Date    End Date
10/01/2020  10/31/2020
Object B
start date      end date          Object A ID
10/01/2020     10/07/2020
10/07/2020     10/14/2020
10/14/2020     10/21/2020
10/21/2020     10/27/2020
10/27/2020       11/03/2020

Object C
Date              Object BID   Object A ID
10/01/2020
10/02/2020
10/03/2020
---
--
10/31/2020

I have created lookup from Object B to Object A and Object C to Object B and Object C to Object B.
Is it possible to map Object B and Object C. How can I populate Object B Id in Object C? Can anyone send a sample code?

Thanks,
Sirisha
Hi Everyone,

I am trying to pass the current record Id from process builder to apex and then to visual force which embeds lightning component.

public class MyInvocableVariable {
    @InvocableVariable(label='Id' required=true)
    public Id recId;

    }  

<apex:page showHeader="false" sidebar="false">
    <apex:includeLightning />
    
    <div id="lightning" />
    <script>
        $Lightning.use("c:lightningApp", function(){
            $Lightning.createComponent("c:lightningComponent",
                "recId":?, ---> need to pass the Id
                "lightning",
                function(cmp){}
            );
        }            
       );
    </script>

</apex:page>

Anyone, please help with this.

Thanks,
Sirisha
Hi Everyone,

I am getting the following error when trying to callout an external service using trigger and future method and update the object.
trigger TriggerAfterInsertUpdate on CustomObject __c(after insert, after update ) {
if(Trigger.isAfter){
         if(updation.isfutureupdate!=true)
            {
               id lst;
                for(CustomObject e :Trigger.new)
                {
                   // lst=e.Id;
                    system.debug('$$$$$$$$$$$'+e.Id);
                    handler.dofuture(e.Id);
                }
                
                
            }
public with sharing class handler {
@future(callout=true)
    public static void dofuture(Id recordId){
        CustomObject __C  cust = [SELECT Id, Name, , IsChecked,
            Day_H__c, Month_H__c, Year_H__c,  Day_G__c, Month_G__c, Year_G__c FROM CustomObject__c
            WHERE Id = :recordId];
        List<String> hDate = verifyfields(cust ,cust .Day_G__c,cust .Month_G__c,cust .Year_G__c,cust .IsChecked);
                     cust .Year_H__c = hDate[0];
                    cust .Month_H__c = hDate[1];
                    cust .Day_H__c = hDate[2];
        List<CustomObject__c> dec1 = new List<CustomObject__c>();
        dec1.add(cust );
        update dec1;
        updation.isfutureupdate = true;
    }
    public static List<string> verifyfields(SObject sobj, String dayG, String monthG, String yearG, Boolean IsChecked){
        String urlPrefix = 'urlpath'
        String retUrl = urlPrefix;
        retUrl += '&gy=' + yearGregorian;
        retUrl += '&gm=' + monthGregorian;
        retUrl += '&gd=' + dayGregorian;
        retUrl += '&gs=' + (afterSunset ? '1' : '0');
        Http h = new Http();
            
            // Instantiate a new HTTP request, specify the method (GET) as well as the endpoint 
            HttpRequest req = new HttpRequest();
            req.setEndpoint(retUrl);
            req.setMethod('GET');
            
            // Send the request, and return a response 
            HttpResponse res = h.send(req);
                                              
                                          
            if(res.getStatusCode() != 200) {
        System.debug('The status code returned was not expected: ' +
            res.getStatusCode() + ' ' + res.getStatus());
     }else {
        System.debug('********response********'+res.getBody());
     } 
       List<String> ret = new String[3];
        JSONParser parser = System.Json.createParser(res.getBody());
                                                          
        while (parser.nextToken() != null) {
            system.debug('inside while'+JSONToken.FIELD_NAME);
            if (parser.getCurrentToken() == JSONToken.FIELD_NAME) {
                if (parser.getText() == 'hy') {
                    // Get the value. 
                    parser.nextToken();
                    ret[0] = parser.getText();
                    System.debug('Year='+ret[0]);
                }
                else if (parser.getText() == 'hm') {
                    // Get the value. 
                    parser.nextToken();
                    ret[1] = parser.getText();
                    if (ret[1].equals('xxx') || ret[1].equals('yyy'))
                        ret[1] = 'yyy';
                    else if (ret[1].equals('zzz'))
                        ret[1] = 'zzz';

                    System.debug('Month='+ret[1]);
                }
                else if (parser.getText() == 'hd') {
                    // Get the value. 
                    parser.nextToken();
                    ret[2] = parser.getText();
                    System.debug('Day='+ret[2]);
                }
            }
        }
        return ret;        
     
                                          
                                      }
    
}
getting the following error:
EXCEPTION_THROWN [25]|System.DmlException: Update failed. First exception on row 0 with id a010U000006kjnSQAQ; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, TriggerAfterInsertUpdate : execution of AfterUpdate

Please can anyone help me to fix this issue?
Thanks,
Sirisha
 
Hi Everyone,

I have a requirement where I need to call the external webservice and populate the fields on insert or update of record.

Already there is a button on record built using lightning component which will pass few values to external system and in return it populates few fields based on the input fields.

the lightning button code looks like below:
Apex:

@AuraEnabled
    public static object__c updatemethod(Id objId) {
        List<Id> dlist = new List<Id>();
        List< object __c> ret;
        dlist.add(objId);
        if(dlist.size()>0){
            ret = class1.updatemethod2(getDetailsByIds(dlist));}
            return ret.get(0);
    }
Global with sharing class class1{
private static List< object __c> calculateDate(List< object __c> dList) {
                              for (object __c d : dList) {
           
            // If date is not filled in, fetch the values
            if (d.Month__c == null && d.Day__c == null &&
                d.Day_g__c != null && d.Month_g__c != null & d.Year_g__c != null) {
                    String[] hDate = getDateFromG(d.Day_g__c, d.Month_g__c,
                                                                              d.Year_g__c, d.IsChecked__c);
                    d.Year__c = hDate[0];
                    d.Month__c = hDate[1];
                    d.Day__c = hDate[2];
            }
Update dlist;
     }  

public static String[] getDateFromG (String dayg, String monthg,
                                                      String yearg, Boolean IsChecked) {
               String url = geturl(dayg, monthg, yearg, IsChecked);
                              System.debug(url);
        String json = getContent(url);

                              String[] ret = new String[3];
                              JSONParser parser = System.Json.createParser(json);
                                                          
                              while (parser.nextToken() != null) {
            system.debug('inside while');
            if (parser.getCurrentToken() == JSONToken.FIELD_NAME) {
               if (parser.getText() == 'hy') {
                               // Get the value.
                           parser.nextToken();
                       ret[0] = parser.getText();
                       System.debug('Year='+ret[0]);
               }
               …..
            }
        }
                              return ret;       
    }   
private static String getContent(String url) {
                              // Instantiate a new http object
            Http h = new Http();
           
            // Instantiate a new HTTP request, specify the method (GET) as well as the endpoint
            HttpRequest req = new HttpRequest();
            req.setEndpoint(url);
            req.setMethod('GET');
           
            // Send the request, and return a response
            HttpResponse res = h.send(req);
            return res.getBody();
    }
I added the below code when a new record is inserted or updated , it should fire the trigger and callout the url to retrieve and populate the fields in the record.
trigger TriggerInsertorupdate on object__c (after insert, after update) {

if(Trigger.isAfter){
         if(updation.isfutureupdate!=true)
            {
               id lst;
                for(Deceased__c e :Trigger.new)
                {
                    lst=e.Id;
                    system.debug('$$$$$$$$$$$'+lst);
                }
                if(lst!=null)
                UpdateController.updatemethod(lst);
            }
    }       
}
I am getting the following error. Please can anyone give some idea to achieve this .
TriggerInsertorupdate : execution of AfterInsert caused by: System.CalloutException: Callout from triggers are currently not supported. Class.class1.getContent: line 112, column 1 
Thanks in Advance,
Sirisha
Hi Everyone,

I am trying to reproduce the scenario as below link. Created a user as Salesforce Platform licence, trigger and when I logged in as Salesforce Platform User licence and created contact and updated not able to get the error.

https://www.sundoginteractive.com/blog/triggers-updating-restricted-records

Can anyone suggest me on this?

Thanks,
Sirisha
Hi everyone,

 I have a requirement where we need to display one recordtype picklist value to only one profile. We have around 100 recordtypes on an object. Each recordtype has around 10 picklist fields. Need to identify a picklist value is there in remaining recordtypes. Also there is field dependencies on these fields. Let say if we select Field1 will show the values specific in Field2 specific to that RT.

Example : Case Object -> Multiple RT's-> Multiple Picklist fields -> Values.

Is there any we can retreive the value of picklist field from recordtype using soql? or We need to write code for this instead of selecting the values manually. Any ideas?

Thanks,
Sirisha

 
Hi All,

We have a request to delete the record type in our organization. Is there any way to check the dependencies on record type and page layouts?

Any ideas or suggestions on this? Thanks!
Hi All,
We have a requirement where we need to merge two accounts. Master account has few contacts and other one has few. 

Once we merge the accounts, I think related contacts will not added to Master account. If it is not then how do we update accountid to existing contact using Dataloader / import wizard?

Please let me know.

Thanks,
Sirisha
Hi All,

We have a created a user and given all the required permissions to that user to run batch job. When we run the job manually it is running successfully, but do the same while scheduling it is failing. throwing the error as "System.LimitException: reports:Too many query rows: 50001
".
I have given all the permissions to objects, related fields Custom settings.
1. I have given "Manage custom report" permission and "View All custom setting" permission for custom settings. Do we need to give any other permission related to custom setting or metadata or report. Is there anything I am missing while granting permission.
Can anyone help me on this who have experienced the same issue.

Thanks,
Sirisha
Hi All,

I have created login form with username and passsword.I have created new custom fields in the contact object.
On click of submit button.It will validates the contact is existing or not and returns contact's FirstName,LastName,Email,Phone.

For this I created a RESTAPI which will take the username and password as a parameters and validates against the credentials and  returns the contact details for that valid user.Login form i have created in my org. using lightning.

Now my challenge is  when the user clicks on submit button it should get the contact details from the RESTAPI and maps with the contact object fields and   reload or refresh the page with contact details and displays the field values FirstName,LastName,Email and Phone.
I am trying to pass the variables or map the variables which are returned from REST API to APEX.

How can I acheive this scenario.Do I need to create another lightning component to refresh the parent component to child component and returns the login contact details.

If anyone can provide a sample code that would be a great help.

Any help would be greatly appreciated.

Thanks,
Sirisha
Hi All,

I have created the field of type number and trying to update the field with leading zeros if the number of digits is less than 10. I am updating the field using flow, but getting the following error.
"The formula expression is invalid: Formula result is data type (Text), incompatible with expected data type (Number)."

LPAD( TEXT({!$Record.Individual_Number__c}) ,10,'0')
I don't see the above error if I give VALUE() function. But it didn't work as I expected.
Please Suggest.
Thanks,
Hi All,

What is the best way to write the code to retrieve the record type?
Below are the two ways 
1. ID rtId = [SELECT Id FROM RecordType WHERE sObjectType='Opportunity' AND Name='RT1'].Id;
2. Id rtId = Schema.SObjectType.Opportunity.getRecordTypeInfosByDeveloperName().get('RT1').getRecordTypeId();

Thanks!
Hi Everyone,

I have created an profile by cloning existing profile(Sales Administer) and assigned record types,page layouts, object permissions and field level permissions to Account object.
But when I try to deploy the profile and include only the Account Object and specific fields in the package. It is deploying all the objects which are having access to the profile though I have not given in the package level. Can we control the access level in the package level while deploying the profile so that it will avoid removing unnecessory objects and fields manually?
User-added image
Please Suggest. 
Thanks
Hi All,


I have created a quick action on account and added this page layout in the opportunity page layout. While deploying from our DEV org to QA org this quick action is showing up, but when I deployed the same from QA org to UAT org, it's not showing up. Would like to know the reason and cause of this issue.
Below the code used in the package to deploy the code 

<types>
    <name>FlexiPage</name>
    <members>Opportunity_Record_Page</members>
  </types>
<types>
    <name>QuickAction</name>
    <members>Account.Broker_Information</members>
   </types>

Can someone please suggest? Appreciate your help.
Thank You!


 
Hi All,

I have a requirement where we need to send email to users. Created a send email quick action button and with the action type as send email.
When I tested this functionality and send the test email. It is showing in the activity list but won't receive the email. I enabled the deliverability to 'All email' . How do the users or I  will receive the email.
Please suggest. 

Thanks,
Sirisha 
Hi All,

I have an object with a start date and an end date. I am trying to create insert weekly dates in one object and a list of dates between the start date and end date in another object.
Object A
start Date    End Date
10/01/2020  10/31/2020
Object B
start date      end date          Object A ID
10/01/2020     10/07/2020
10/07/2020     10/14/2020
10/14/2020     10/21/2020
10/21/2020     10/27/2020
10/27/2020       11/03/2020

Object C
Date              Object BID   Object A ID
10/01/2020
10/02/2020
10/03/2020
---
--
10/31/2020

I have created lookup from Object B to Object A and Object C to Object B and Object C to Object B.
Is it possible to map Object B and Object C. How can I populate Object B Id in Object C? Can anyone send a sample code?

Thanks,
Sirisha
Hi Everyone,

I am trying to pass the current record Id from process builder to apex and then to visual force which embeds lightning component.

public class MyInvocableVariable {
    @InvocableVariable(label='Id' required=true)
    public Id recId;

    }  

<apex:page showHeader="false" sidebar="false">
    <apex:includeLightning />
    
    <div id="lightning" />
    <script>
        $Lightning.use("c:lightningApp", function(){
            $Lightning.createComponent("c:lightningComponent",
                "recId":?, ---> need to pass the Id
                "lightning",
                function(cmp){}
            );
        }            
       );
    </script>

</apex:page>

Anyone, please help with this.

Thanks,
Sirisha
Hi Everyone,

I have a requirement where I need to call the external webservice and populate the fields on insert or update of record.

Already there is a button on record built using lightning component which will pass few values to external system and in return it populates few fields based on the input fields.

the lightning button code looks like below:
Apex:

@AuraEnabled
    public static object__c updatemethod(Id objId) {
        List<Id> dlist = new List<Id>();
        List< object __c> ret;
        dlist.add(objId);
        if(dlist.size()>0){
            ret = class1.updatemethod2(getDetailsByIds(dlist));}
            return ret.get(0);
    }
Global with sharing class class1{
private static List< object __c> calculateDate(List< object __c> dList) {
                              for (object __c d : dList) {
           
            // If date is not filled in, fetch the values
            if (d.Month__c == null && d.Day__c == null &&
                d.Day_g__c != null && d.Month_g__c != null & d.Year_g__c != null) {
                    String[] hDate = getDateFromG(d.Day_g__c, d.Month_g__c,
                                                                              d.Year_g__c, d.IsChecked__c);
                    d.Year__c = hDate[0];
                    d.Month__c = hDate[1];
                    d.Day__c = hDate[2];
            }
Update dlist;
     }  

public static String[] getDateFromG (String dayg, String monthg,
                                                      String yearg, Boolean IsChecked) {
               String url = geturl(dayg, monthg, yearg, IsChecked);
                              System.debug(url);
        String json = getContent(url);

                              String[] ret = new String[3];
                              JSONParser parser = System.Json.createParser(json);
                                                          
                              while (parser.nextToken() != null) {
            system.debug('inside while');
            if (parser.getCurrentToken() == JSONToken.FIELD_NAME) {
               if (parser.getText() == 'hy') {
                               // Get the value.
                           parser.nextToken();
                       ret[0] = parser.getText();
                       System.debug('Year='+ret[0]);
               }
               …..
            }
        }
                              return ret;       
    }   
private static String getContent(String url) {
                              // Instantiate a new http object
            Http h = new Http();
           
            // Instantiate a new HTTP request, specify the method (GET) as well as the endpoint
            HttpRequest req = new HttpRequest();
            req.setEndpoint(url);
            req.setMethod('GET');
           
            // Send the request, and return a response
            HttpResponse res = h.send(req);
            return res.getBody();
    }
I added the below code when a new record is inserted or updated , it should fire the trigger and callout the url to retrieve and populate the fields in the record.
trigger TriggerInsertorupdate on object__c (after insert, after update) {

if(Trigger.isAfter){
         if(updation.isfutureupdate!=true)
            {
               id lst;
                for(Deceased__c e :Trigger.new)
                {
                    lst=e.Id;
                    system.debug('$$$$$$$$$$$'+lst);
                }
                if(lst!=null)
                UpdateController.updatemethod(lst);
            }
    }       
}
I am getting the following error. Please can anyone give some idea to achieve this .
TriggerInsertorupdate : execution of AfterInsert caused by: System.CalloutException: Callout from triggers are currently not supported. Class.class1.getContent: line 112, column 1 
Thanks in Advance,
Sirisha
Hi Everyone,

I am trying to reproduce the scenario as below link. Created a user as Salesforce Platform licence, trigger and when I logged in as Salesforce Platform User licence and created contact and updated not able to get the error.

https://www.sundoginteractive.com/blog/triggers-updating-restricted-records

Can anyone suggest me on this?

Thanks,
Sirisha
Hi All,
We have a requirement where we need to merge two accounts. Master account has few contacts and other one has few. 

Once we merge the accounts, I think related contacts will not added to Master account. If it is not then how do we update accountid to existing contact using Dataloader / import wizard?

Please let me know.

Thanks,
Sirisha
Hi All,

We have a created a user and given all the required permissions to that user to run batch job. When we run the job manually it is running successfully, but do the same while scheduling it is failing. throwing the error as "System.LimitException: reports:Too many query rows: 50001
".
I have given all the permissions to objects, related fields Custom settings.
1. I have given "Manage custom report" permission and "View All custom setting" permission for custom settings. Do we need to give any other permission related to custom setting or metadata or report. Is there anything I am missing while granting permission.
Can anyone help me on this who have experienced the same issue.

Thanks,
Sirisha
Hi All,

 Can anyone please explain to me how do you handle production issues in your project. what is the approach? 
Do you use Jira tool to raise a ticket for the case?

Say for example if we have 100 users and if one user is not receiving the email sent out of 100 users. what approach can be followed? And how can we fix the issue?

Thanks,
Sirisha
When you click 'View All' on Related List, you get a list view of all the records. How can you customize that page?
I want to remove the 'New' action button on that page
If any contact or lead have the birthday, they should receive SMS
  • July 04, 2019
  • Like
  • 0
Hi All,

I am trying to create a new contact. Once the record is saved in Salesforce, an email need to be sent along with the unique id.

I have created a formula field for the Unique ID and associated record ID to this field.

Now, when I try to send an email with Unique ID, it shows null value.

<apex:page controller="SubmitNewContactController" docType="html-5.0">
   
    <apex:form>
        <apex:slds/>
    <apex:pageMessages></apex:pageMessages>
        <div class="slds-scope slds-box">
         <apex:outputPanel >
            <div class="slds-text-align_center slds-text-heading_medium"><p>Submit New Contact </p></div>
             <div class="slds-form-element">
                    <label class="slds-form-element__label"><abbr class="slds-required"></abbr> FirstName</label>
                <div class=" slds-scope slds-form-element__control">
                    <apex:input value="{!FirstName}" styleClass="slds-input" id="FirstName" />
                </div>
                 <label class="slds-form-element__label"><abbr class="slds-required"></abbr> LastName</label>
                 <div class=" slds-scope slds-form-element__control">
                    <apex:input value="{!LastName}" styleClass="slds-input" id="LastName" />
                </div>
                 <label class="slds-form-element__label"><abbr class="slds-required"></abbr> Phone</label>
                 <div class=" slds-scope slds-form-element__control">
                    <apex:input value="{!Phone}" styleClass="slds-input" id="Phone" />
                </div>
                 <label class="slds-form-element__label"><abbr class="slds-required"></abbr> Email</label>
                 <div class=" slds-scope slds-form-element__control">
                    <apex:input value="{!Email}" styleClass="slds-input" id="Email" />
                </div>
                 <label class="slds-form-element__label"><abbr class="slds-required"></abbr> Zipcode</label>
                 <div class=" slds-scope slds-form-element__control">
                    <apex:input value="{!Zipcode}" styleClass="slds-input" id="Zipcode" />
                </div>
                 <div class=" slds-scope slds-form-element__control">
                    <apex:commandButton action="{!SubmitContact}" value="Submit"/> 
                </div>
            </div>
         </apex:outputPanel>   
        </div>
        
    
    </apex:form>
</apex:page>
public class SubmitNewContactController {
    public Contact c{get;set;}
    public String FirstName{get;set;}
    public String LastName{get;set;}
    public String phone{get;set;}
    public String Email{get;set;}
    public String Zipcode{get;set;}
    
    public SubmitNewContactController(){
        c = new Contact();
    }
    
    public PageReference SubmitContact(){
        c.FirstName = FirstName;
        c.LastName = LastName;
        c.phone = phone;
        c.Email = Email;
        c.MailingPostalCode = Zipcode;
        insert c;
        
        PageReference pr = new PageReference('/apex/ThankYouPage');
        Messaging.SingleEmailMessage semail = new Messaging.SingleEmailMessage();
        String[] sendingTo = new String[]{c.Email};
        semail.setToAddresses(sendingTo);
        semail.setSubject('Registration is completed');
        semail.setPlainTextBody('Hi'+ c.name+'Thank you for registering.This is your UniqueID'+ c.Unique_ID__c);
        Messaging.sendEmail(new Messaging.SingleEmailMessage[] {semail});
        pr.setRedirect(true);
        return pr;
        
        
        
    }
    

}

I am able to send the email but cannot capture the name and uniqueId in the email. It shows null in the email.
Can anyone please help me to fix the code?

Thanks,
Sirisha
 
Hi All,

 I am trying to pass the contact data from parent to child component on click of a button. Also, hide the parent component and show the child component using the lightning web component.
I have implemented this using lightning component.
Below is the sample code:

Parent component:
-----------------
<aura:component controller="login">
    
    <aura:attribute name="contact" type="Contact"/>
    <aura:registerEvent name="Authorizelogin" type="c:Authorizeloginevent"/>
    <div class="slds-hide" aura:id="login">
        <c:Authorizelogincontactdetails/>
    </div>
    <lightning:input name="UNAME" required="true" type="String" value="{!v.contact.LoginId__c}"/>
    <lightning:input name="PWD" required="true" type="String" value="{!v.contact.Password__c}"/>
    <lightning:button variant="brand" label="Submit" onclick="{!c.handlecontactdetails}"/>
</aura:component>

helper:
------

({
    contact : function(component,event,helper) {
        var action = component.get("c.getcontact");
        action.setParams({
            "uname":component.get("v.UNAME"),
            "pwd" : component.get("v.PWD")
        });
        action.setCallback(this,function(a){
            var response = a.getState();
            if(response==="SUCCESS"){
                var con = response.getReturnvalue();
            var myEvent = $A.get("e.c:Authorizeloginevent"); 
                myEvent.setParams({
                    "contact" : con
                });
                myEvent.fire();
            }
        });
    $A.enqueueAction(action);    
    }
})

child component:
---------------
<aura:component controller="login" >
    <aura:attribute name="FirstName" type="String"/>
    <aura:attribute name="LastName" type="String"/>
    <aura:attribute name="Email" type="String"/>
    <aura:attribute name="Phone" type="Integer"/>
    <aura:handler event="c:Authorizeloginevent" action="{!c.contactdetails}"/>
    <ui:output value="{!v.FirstName}"/>
    <ui:output value="{!v.LastName}"/>
    <ui:output value="{!v.Email}"/>
    <ui:output value="{!v.Phone}"/>
    
</aura:component>
helper:
-------
({
    contactdetails : function(component,event,helper) {
        
        var  con = event.getParam("contact");           
        
        component.find("LastName").set("v.value",con.LastName);
        component.find("FirstName").set("v.value",con.FirstName);
        component.find("Email").set("v.value",con.Email);
        component.find("Phone").set("v.value",con.Phone);
        
    }
})


I have referred to some documentation, recipes. But not able to get the idea on how to do the same in the lightning web component.
Can anyone please give me some sample code or any idea on how to do the same approach using the lightning web component.
Any help would be greatly appreciated.

Thanks
 
Hi All,

 I am trying to push the lightning web component recipes to scratch org.
I have authorized the org, Devhub and created a scratch org.User-added image

I am not able to see the recipes in the scratch org.
User-added image
Please anyone can guide me where I am doing the mistake.
Thanks,
Sirisha
 
Hello,

I have an issue executing a report from Apex. I am getting the Fatal Error "Too many query rows: 50001" when I execute the method "Reports.ReportManager.runReport(reportId, reportMetadata, includeDetails)".

The report returns 13.000 contacts, but when I execute it from apex, it only return the first 2,000 contacts. To get all the records y execute the same report adding a new filter to exclude the contacts I already got adding "Reports.ReportFilter('Contact.Id', 'greaterThan', lastContactId);"

So if the report must return 13,000 records, I will have to run the report 8 times. Every time I run the report I consult the limits and I always get 3 in "Limits.getQueryRows()", but when is executing the report for 5th time I get this exception "System.LimitException: reports:Too many query rows: 50001"

My conclusion is that as the report has 13,000 records, it adds to the limit 13,000 records to the limit everytime the report is executed, so if the report has 50,000 record I will not be able to execute the report not eve once. But if I check the limit with "Limits.getQueryRows()" I will always get 3 records, and never 50,001.

Can anyone help me with this issue? Has anyone launched a report with more than 50,000 records from apex?

Thank you