• Som_11
  • NEWBIE
  • 40 Points
  • Member since 2020
  • Devloper

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 22
    Questions
  • 11
    Replies
How to load more that 255 caharacters data in Text Area field as seperate line through Workbench or Mule Soft.
Hi All, I passed PD-2 certification, But later realized that need to complete Advanced Apex specialist super badge. I passed the exam, So to complete the Superbadge is there any time limit or whenevr I complete Superbadge at that time I will get the cert?
Can anyone give the anser pls.
  • September 28, 2021
  • Like
  • 0
Hi all, I want to call an imperative method in connectedCallback() because at the time of loading I want to prepopulate some data into lwc.

I am returning wrapper class data from the apex. Trying the below snippet of code but in error also not able to get anything. Can anyone help me through this?

APEX : @AuraEnabled public static personDataWrapper
      getPersonTimeZone(Id loanReqId) {
    Loan_Request__c lr =
        [ select Id, Name, Leads__c, Account__c, Account__r.Name, Leads__r.Timezone__c, Leads__r.FirstName,
          Leads__r.LastName,
          Status__c from Loan_Request__c where Id =:loanReqId ];

    personDataWrapper pdw = new personDataWrapper();
    
    if(lr.Leads__c != NULL){
      pdw.personName = lr.Leads__r.FirstName + ' ' + lr.Leads__r.LastName;
    }else{
      pdw.personName = lr.Account__r.Name;
    }
    pdw.timezoneValue = lr.Leads__r.Timezone__c;
    pdw.loanRequestName = lr.Name;
    pdw.currentDt = system.now().adddays(1);
    if (lr.Status__c.contains('Closed')) {
      pdw.isLRClosed = true;
    } else {
      pdw.isLRClosed = false;
    }
    return pdw;
  }
public
  class personDataWrapper {
    @AuraEnabled public String personName {
      get;
      set;
    }
    @AuraEnabled public String timezoneValue {
      get;
      set;
    }
    @AuraEnabled public String loanRequestName {
      get;
      set;
    }
    @AuraEnabled public Boolean isLRClosed {
      get;
      set;
    }
    @AuraEnabled public DateTime currentDt {
      get;
      set;
    }
  }

LWC :   connectedCallback() {
    console.log('In connected call back function....');
    getPersonZone({loanReqId: this.recordId})
        .then(result => {
          console.log(result.records[0].personName);
          /* console.log('In connected call back result....');
           this.loanrequestdata = result;
           console.log('The loanrequestdata ' + this.loanrequestdata);
           console.log(
               '==result.Leads__r.FirstName===' + loanrequestdata.personName);
           this.timeZone = this.loanrequestdata.timezoneValue;
           if (this.loanrequestdata.personName != null &&
               this.loanrequestdata.personName != '') {
             this.title =
                 'Callback for Loan Inquiry ' + this.loanrequestdata.personName;
           }
           this.dateTimeFieldValue = this.loanrequestdata.currentDt;*/
        })
        .catch(error => {
          console.log('In connected call back error....');
          this.error = error;
          console.log('Error is ' + this.error);
        });
}

Template :     <lightning-input type="String"  onchange={handleTitleChange} label='Title' value={title} required>
    </lightning-input>
    <lightning-textarea name="input1" onchange={handleNotesChange} label="Notes"></lightning-textarea>
    <lightning-input type="String"  label='Timezone' value={value} readonly>
    </lightning-input>
Hi All, I am new to LWC.

I want to achieve, creating a Lightining Datatable which will take data and columns as input in LWC.

Will request to help in this.
Hi All,
Using below method :
  public static datetime convertTimeZone(datetime dt, String timezone){
     String formatedDtTime = dt.format('yyyy-MM-dd HH:mm:ss', 
                         CDLLoanRequestUtil.TIME_ZONE_MAPPING.get(timezone));
     Datetime converteddt = Datetime.valueOf(formatedDtTime); 
     return converteddt;
                 
     } 

Datetime newdt = CDLLoanRequestUtil.convertTimeZone(callBackDtTime,'America/Los_Angeles');

Expected to enter with above datetime but after creating record it getting changed. And in debug its comming correct value. Can anyone help with this please.
Hi All,

Can anyone help me with validating if the DateTime field value is within the next 5 minutes in the salesforce formula field?
DateTime is a custom field.
Hi Guys, I want to know that Is there any limitation like how many number of activities we can create for a record in salesforce?
If anyone know help me out.
In LWC for each loop for each row I want to add button and on button click I want to call apex method passing id. Can anyone give me examples to pass if for button click with specific for each item id. And I am not able to button also properly.

My Template code
          <div> <h2><b> These are the Incentives you can avail</b></h2>
            <template if:true={incentives.data}>
              
                <template for:each={incentives.data} for:item="inctv">
                  <div key={inctv.Id} class="slds-box"> 
                    <p key={inctv.Id}>{inctv.Name}  for Target : </p> <p key={inctv.Id}>{inctv.icxdmsv1__Target__r.Name}</p>
                    <lightning-button key={inctv.Id}>{inctv.Name} variant="brand" label="Avail" onclick={handleGetIncentive} class="slds-button slds-button_brand slds-button_stretch"></lightning-button>
                  </div>
                  </template>
                
            </template>
            </div>

Lightining button not showing up properly
  • April 01, 2021
  • Like
  • 0
Not able to add new forecast type, Getting below error: Opprtunity revenuw by defalut coming whrn trying to add Opportunity Quantity getting below error. I am using developer edition. Can anyone help me with this.User-added image
  • January 25, 2021
  • Like
  • 0
Hi all, we want to enable digital engagement in sfdc. Is that possible in local languages?

Can anyone post some useful links or help me with that.
  • December 29, 2021
  • Like
  • 0
Hi All,
For custom sales profile user When I add products for Order it's not getting added but for System Admin profile its working fine.

Can anyone help with this Please.
  • December 24, 2020
  • Like
  • 0
Hi All,
I have added Activity history in page layout where Email and Log a Call tabs are there. I am able to see it in Internal Org but for Community Portal, the Email tab is not coming.
Can Anyone help meHere I can see Email tabHere I cant see email tab with this?
  • December 23, 2020
  • Like
  • 0
Hi all, 
While creating comunity if we choose build our own template, Did we get option to add Navigation menu. I cant see any option, Can anyone help on this.
If we select Partner Central Template by default we will get Navigation Menu,
Likewise can we add in our Own template.
  • October 12, 2020
  • Like
  • 0
Hi all,

Can we upload an app exchange product, If we are an Consulting partner to Salesforce.
  • October 01, 2020
  • Like
  • 0
Hi all,

I am trying to create new page for approval notification in partner community, But not able to find a way.
My scenario is, the approval notification will come to partner user and once he clicks on notification it will navigate to approval page there I want to add new page or Customize it. But in builder I am not able to find Or add/Modify the page for Aprroval.

User-added image
Can anyone suggest me.
  • September 23, 2020
  • Like
  • 0
Hi all, I getting Constructor not defined: [CreditMeterGraphic].<Constructor>() error for below controller class.  Can anyone help on this.

Controller class is : 
public with sharing class CreditMeterGraphic {
    public String currentRecordId {get;set;}
    public Account acc{get;set;}
    public CreditMeterGraphic(ApexPages.StandardController controller){
        currentRecordId  = ApexPages.CurrentPage().getparameters().get('id');
        if (Schema.sObjectType.Account.fields.Credit_Limit__c.isAccessible()) {
        acc = [Select Credit_Limit__c From Account Where Id =: currentRecordId];
        }
    }
    public List<gaugeData> getData(){
        double npsscore = 0;
        Account creditusage = [Select Id, Name, Credit_Usage__c, Credit_Limit__c From Account Where Id =: currentRecordId];
        Account creditlimit = [Select Id, Name, Credit_Limit__c From Account LIMIT 1];
       
        List<gaugeData> data = new List<gaugeData>();
        data.add(new gaugeData('Credit', creditusage.Credit_Usage__c));
        data.add(new gaugeData('Credit', creditusage.Credit_Limit__c));
       return data;   
    }
    public class GaugeData{
        public String name{get; set;}
        public decimal credit{get; set;}
        public gaugeData(String name, decimal npsScore){
            this.name = name;
            this.credit = npsScore;
        }
    }
}

Test Class is : 
@isTest
public class TestCreditMeterGraphic {

    @isTest Public static void creditMeterGraphicMethod(){
         
        //Getting Dealer Account
        Account dealerAccnt = TestDataFactory.createDealerAccount();
        
       Test.StartTest(); 
            ApexPages.currentPage().getParameters().put('id', String.valueOf(dealerAccnt.Id));
            CreditMeterGraphic  testCreditMeterGraphic = new CreditMeterGraphic();
            testCreditMeterGraphic.getData();
        Test.StopTest();        
    }    
}
  • September 17, 2020
  • Like
  • 0
Hi all,
When I am hard coding the record type value its working fine. But I am trying like in below picture then its not working.
Like : <aura:attribute name="PriceBookId" type="String" default="$CustomMetadata.Pricebook_Setting__mdt.RetailerPBRT.PBRecordTypeId__c" access="global"/>

How to get the value from metadata over here.User-added image
  • September 15, 2020
  • Like
  • 0
What is the best practice to write test classes where we need to add product for OrderItem. Should we create an New product as part of test data as we are creating account.
  • September 07, 2020
  • Like
  • 0
Hi all,
Getting an error for flexipage while pushing the code to scratch Org. Can anyone help.User-added image Error is : Account_Record_Page.flexipage-meta.xml  Component [flexipage:visualforcePage] attribute [pageName]: Visualforce page [CreditMeterGraphicVF] not available for use on mobile devices. The Error Screen shot is attached.
 
  • September 03, 2020
  • Like
  • 0
Hi all, I am getting an error Id and Pricebook2Id not found. Can anyone help please.
I am doing devlopment in Scratch Org. Below is the code and Error snippet.
User-added image
  • September 03, 2020
  • Like
  • 0
In LWC for each loop for each row I want to add button and on button click I want to call apex method passing id. Can anyone give me examples to pass if for button click with specific for each item id. And I am not able to button also properly.

My Template code
          <div> <h2><b> These are the Incentives you can avail</b></h2>
            <template if:true={incentives.data}>
              
                <template for:each={incentives.data} for:item="inctv">
                  <div key={inctv.Id} class="slds-box"> 
                    <p key={inctv.Id}>{inctv.Name}  for Target : </p> <p key={inctv.Id}>{inctv.icxdmsv1__Target__r.Name}</p>
                    <lightning-button key={inctv.Id}>{inctv.Name} variant="brand" label="Avail" onclick={handleGetIncentive} class="slds-button slds-button_brand slds-button_stretch"></lightning-button>
                  </div>
                  </template>
                
            </template>
            </div>

Lightining button not showing up properly
  • April 01, 2021
  • Like
  • 0
Hi All,
For custom sales profile user When I add products for Order it's not getting added but for System Admin profile its working fine.

Can anyone help with this Please.
  • December 24, 2020
  • Like
  • 0
Hi All,
I have added Activity history in page layout where Email and Log a Call tabs are there. I am able to see it in Internal Org but for Community Portal, the Email tab is not coming.
Can Anyone help meHere I can see Email tabHere I cant see email tab with this?
  • December 23, 2020
  • Like
  • 0
Hi all, I getting Constructor not defined: [CreditMeterGraphic].<Constructor>() error for below controller class.  Can anyone help on this.

Controller class is : 
public with sharing class CreditMeterGraphic {
    public String currentRecordId {get;set;}
    public Account acc{get;set;}
    public CreditMeterGraphic(ApexPages.StandardController controller){
        currentRecordId  = ApexPages.CurrentPage().getparameters().get('id');
        if (Schema.sObjectType.Account.fields.Credit_Limit__c.isAccessible()) {
        acc = [Select Credit_Limit__c From Account Where Id =: currentRecordId];
        }
    }
    public List<gaugeData> getData(){
        double npsscore = 0;
        Account creditusage = [Select Id, Name, Credit_Usage__c, Credit_Limit__c From Account Where Id =: currentRecordId];
        Account creditlimit = [Select Id, Name, Credit_Limit__c From Account LIMIT 1];
       
        List<gaugeData> data = new List<gaugeData>();
        data.add(new gaugeData('Credit', creditusage.Credit_Usage__c));
        data.add(new gaugeData('Credit', creditusage.Credit_Limit__c));
       return data;   
    }
    public class GaugeData{
        public String name{get; set;}
        public decimal credit{get; set;}
        public gaugeData(String name, decimal npsScore){
            this.name = name;
            this.credit = npsScore;
        }
    }
}

Test Class is : 
@isTest
public class TestCreditMeterGraphic {

    @isTest Public static void creditMeterGraphicMethod(){
         
        //Getting Dealer Account
        Account dealerAccnt = TestDataFactory.createDealerAccount();
        
       Test.StartTest(); 
            ApexPages.currentPage().getParameters().put('id', String.valueOf(dealerAccnt.Id));
            CreditMeterGraphic  testCreditMeterGraphic = new CreditMeterGraphic();
            testCreditMeterGraphic.getData();
        Test.StopTest();        
    }    
}
  • September 17, 2020
  • Like
  • 0
Hi all,
Getting an error for flexipage while pushing the code to scratch Org. Can anyone help.User-added image Error is : Account_Record_Page.flexipage-meta.xml  Component [flexipage:visualforcePage] attribute [pageName]: Visualforce page [CreditMeterGraphicVF] not available for use on mobile devices. The Error Screen shot is attached.
 
  • September 03, 2020
  • Like
  • 0
Hi all, I am getting an error Id and Pricebook2Id not found. Can anyone help please.
I am doing devlopment in Scratch Org. Below is the code and Error snippet.
User-added image
  • September 03, 2020
  • Like
  • 0
Hi all, For my test class getting this error..
My test class is

@isTest(seeAllData = true)
public class Test_ApplyOrderLineOffers {
    @isTest Public static void lineOffers(){
        //Distributor Account Insertion
        RecordType AccDistRecId = [SELECT Id FROM RecordType WHERE sObjectType = 'Account' AND Name = 'Distributor'];
        Account DistAcc=new Account(Name='DistrbAccnt',recordTypeId=AccDistRecId.id,icxdms__Credit_Limit__c=20000);
        insert DistAcc;
        //Retailer Account Insertion
        RecordType AccRTRetailer = [SELECT Id FROM RecordType WHERE sObjectType = 'Account' AND Name = 'Retailer'];
        Account RetAcc=new Account(Name='RetailerAccnt',ParentId=DistAcc.Id,recordTypeId=AccRTRetailer.id);
        insert RetAcc;
        
        // Adding Products
        Product2 p1=new Product2(Name='Fruitnik 50ml',Family='Beverages',IsActive=true,productCode='BEV');
        insert p1;
        
        Product2 p2=new Product2(Name='Fruitnik 200ml',Family='Beverages',IsActive=true,productCode='BEV');
        insert p2;
   
        Pricebook2  standardPb = [select id, name, isActive from Pricebook2 where IsStandard = true limit 1];
        
        PricebookEntry standardPrice = new PricebookEntry();
        standardPrice.Pricebook2Id = standardPb.Id;
        standardPrice.Product2Id = p2.Id;
        standardPrice.UnitPrice = 100;
        standardPrice.IsActive = true;
        standardPrice.UseStandardPrice = false;
        insert standardPrice ;
        

        RecordType OrderRTRetlr = [SELECT Id FROM RecordType WHERE sObjectType = 'Order' AND Name = 'Retailer'];
        Order Retailerorder=new Order(AccountId=RetAcc.Id,recordTypeId=OrderRTRetlr.Id,Status='Draft',EffectiveDate=system.today()-5,Pricebook2Id =standardPb.Id);//dist order
        insert Retailerorder;
        
        OrderItem i=new OrderItem(Product2Id=p2.Id,Quantity=100,OrderId=Retailerorder.Id,UnitPrice=100,PricebookEntryId=standardPrice.id);
        insert i;
        

    }
}
  • August 20, 2020
  • Like
  • 0
I have reached Salesforce Community limits with 10 custom objects. For the 11th custom object If i remove permissions to the user on the profile level and query the custom object  in without sharing Apex class and show the data to the user will it still count as 11th custom object.