• Karthik j
  • NEWBIE
  • 45 Points
  • Member since 2021
  • Salesforce developer

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 23
    Questions
  • 10
    Replies
I have a use case like in first column I need to dispaly some valuein first column which is a text value , according to that i need to make next column as dynamic which is picklist field  and according to the second column the third column need to be dynamic which is picklist field. For Example,
Column A (Text)Column B (Picklist)Column c (Picklist)
AB
C
D (If user select D)
B
C
BA
C
D (If user select A)
C
D
CA
B
D(If user select B)
A
D
DA
B
C(If user select C)
A
B


Is this possible to do in lwc datatable. If yes can anyone help me how to acheive this. Thanks in advance.

Hey I am trying to brush my aura skills after a long gap.

I am stuck with one weird error which says "A Component Error has occured! Error: Failed to initialize a component [Cannot read properties of undefined (reading '$getDescriptor$')]" I am getting at the time of component intialization. Any help would be appriciated. Thanks in adcvance.

Here is my code: 

HTML
<aura:component controller="RevisionController" implements="flexiPage:availableForAllPageTypes" access="global">
<aura:attribute name="conList" type="Contact[]"/>
<aura:attribute name="columns" type="List"/>
<aura:handler name="doInit" value="{!this}" action="{!c.doInit}"/>
<lightning:card title="Contact Details">
<!--<lightning:datatable keyField="Id" data="{!v.conList}" columns="{!v.columns}" />-->
</lightning:card>
</aura:component>

JS
({
doInit : function(component, event, helper) {
console.log('here');
/*component.set("v.columns" , [
{label:'LastName',value:'Lastname',type:'text'},
{label:'AccountName',value:'Account.Name',type:'url'},
{label:'Phone',value:'phone',type:'phone'}
]);
var conDetails = component.get("c.getContactList");
conDetails.setCallback(this, function(result){
if(result.getState() == 'SUCCESS'){
component.set("v.conList" , result.getReturnValue());
console.log('data>>>>.'+JSON.stringify(conList));
}
else{
console.log('Error>>>'+result.getReturnValue());
}
});
$A.enqueueAction(conList);*/
}
});


 

Hi all,

I am trying to access the recordtype name inside the if condition which is written in before insert context of lead record, but whenever I am creating a lead I am getting recordtypeId as null. 

Will recordtypeId is not set in before insert context?


 
Hi All,

I have a requirement to navigate to the related list of the custom object in lwc. I am sharing my code below.

handleClick(){
console.log('recordId>'+this.recordId);
this[ NavigationMixin.Navigate ]( {
type: 'standard__recordRelationshipPage',
attributes: {
recordId: this.recordId,
objectApiName: 'FreshDesk_Ticket__c',
relationshipApiName: 'SRF_SPR__r',
actionName: 'view'
}
} );
}

The above code is taking me to the below page instead of related list.
User-added image

If the child object is standard one you can write object name by adding extra 's' at the end, but how to do it with custom object?

Any help would be appreciated.
Hi All

I have used one utility icon for the icon-name attribute of lightning-card.

<lightning-card title="Account GMV" icon-name="utility:table"></lightning-card>

By default the utility icon will be displayed with no colour. Now I want to give a colour to it.

I tried add a CSS class inside the tag and write css code to give colur. That didn't work.
<lightning-card title="Account GMV" class ="greenClour" icon-name="utility:table"></lightning-card>

.THIS.greenClour svg{
      fill: #7FFF00;
}


It didn't work. Can anyone please help me to achieve this?
Hi all,

I am trying to query all the tasks which are last modified today.
List<Task> taskList= [Select Id,status,LastModifiedDate from Task where LastModifiedDate=TODAY];

the above query is returning the result, but my problem is when I tried to use the variable as shown below instead of TODAY I am not getting any result.
Date todayDate = date.today();
List<Task> taskList= [Select Id,status,LastModifiedDate from Task where LastModifiedDate=:todayDate];

you might say todayDate is the variable with date type and the last modified date is the DateTime field.  so it will not return any result, but why does it work in the first place with TODAY?
Hi Everyone

I am getting result as returned data from the apex method in js.
here result is the array of objects, I am iterating result over a for loop and trying to add a single object as a value and string as a key to the map ExistingRuleDataMap. but in the logs ExistingRuleDataMap is printing as empty. what I am missing here please help me.
Here is my JS code.

getExistingFilterData({
            clusterName: singleCluster
       })
       .then(result=>{
        console.log('RESULT>>'+JSON.stringify(result));
        for(let data of result){
            console.log('DATA>>'+JSON.stringify(data));
            this.ExistingRuleDataMap.set(data.Cluster__c,data);
        }
        console.log('EXISTING COLLECTION RULE DATA MAP>>'+JSON.stringify(this.ExistingRuleDataMap));
       })
       .catch(error=>{
           console.log('ERROR>>'+error);
       })


Thanks in advanse
I am making an inbound callout to my salesforce org by adding Id as a parameter to the endpoint and below is my apex code.

@RestResource(urlMapping='/Product/')
global class IntegrationProductsApi {
    
    @httpget
    global static List<Product2> getProducts(){
        Map<String,string> reqParams =  RestContext.request.params;
        string prodId = reqParams.get('Id');
        system.debug('prodId>'+prodId);
        List<Product2> productList=[select Id,ProductCode,Name from             Product2 where Id=:prodId];
        system.debug('productList>'+productList);
        if(productList.size()>0){
            return productList;
        }
        return null;
    }
}
Id which I am passing with endpoint is already there in salesforce DB, but still in the above debug statement I am getting productList as null.

I am new to integration and any help would be appreciated.
In LWC Onclick of a button, I have written a code to open docker composer but it does not stay on the page.User-added image This is my code.

<template if:true={showRatingPage}>
        <div class="slds-docked_container">
          <section class="slds-docked-composer slds-grid  slds-grid_vertical slds-is-open slds-has-focus" role="dialog" aria-labelledby="dialog-heading-id-1" aria-describedby="dialog-content-id-1">
            <header class="slds-docked-composer__header slds-grid slds-shrink-none" aria-live="assertive">
              <div class="slds-media slds-media_center slds-no-space">
                <div class="slds-media__figure slds-m-right_x-small">
                    <span class="slds-icon_container">
                      <svg class="slds-icon slds-icon_small slds-icon-text-default" aria-hidden="true">
                        <use xlink:href="/_slds/icons/standard-sprite/svg/symbols.svg#note"></use>
                      </svg>
                    </span>
                  </div>
               <div class="slds-media__body">
                  <h2 class="slds-truncate" id="dialog-heading-id-1" title="Header"><b>Customer Rating Service</b></h2>
                </div>
              </div>
              <div class="slds-col_bump-left slds-size_1-of-4 slds-shrink-none">
                <button class="slds-button slds-button_icon slds-button_icon" title="Minimize window">
                  <svg class="slds-button__icon" aria-hidden="true">
                    <use xlink:href="/assets/icons/utility-sprite/svg/symbols.svg#minimize_window"></use>
                  </svg>
                  <span class="slds-assistive-text">Minimize Composer Panel</span>
                </button>
                <button class="slds-button slds-button_icon slds-button_icon" title="Expand Composer">
                  <svg class="slds-button__icon" aria-hidden="true">
                    <use xlink:href="/assets/icons/utility-sprite/svg/symbols.svg#expand_alt"></use>
                  </svg>
                  <span class="slds-assistive-text">Expand Composer Panel</span>
                </button>
                <button class="slds-button slds-button_icon slds-button_icon" title="Close">
                  <svg class="slds-button__icon" aria-hidden="true">
                    <use xlink:href="/assets/icons/utility-sprite/svg/symbols.svg#close"></use>
                  </svg>
                  <span class="slds-assistive-text">Close Composer Panel</span>
                </button>
              </div>
            </header>
            <div class="slds-docked-composer__body" id="dialog-content-id-1">
              <div class="slds-m-top_small slds-m-bottom__small">
                <div class="slds-p-vertical_medium lgc-bg">
                  <br>
                <lightning-card>
                <lightning-tile label="Customer" type="media">
                    <lightning-avatar slot="media" variant="circle" size="small" src={CX_Image} fallback-icon-name="standard:person_account"
                    alternative-text="Customer"></lightning-avatar>
                    <div class="rate">
                        <input type="radio" id="star5" value="5" onchange={handleRating} />
                        <label for="star5" title="text">5 stars</label>
                        <input type="radio" id="star4"  value="4" onchange={handleRating} />
                        <label for="star4" title="text">4 stars</label>
                        <input type="radio" id="star3"  value="3" onchange={handleRating} />
                        <label for="star3" title="text">3 stars</label>
                        <input type="radio" id="star2" value="2" onchange={handleRating} />
                        <label for="star2" title="text">2 stars</label>
                        <input type="radio" id="star1"  value="1" onchange={handleRating} />
                        <label for="star1" title="text">1 star</label>
                  </div>
               </lightning-tile>
              </lightning-card>
                </div>
            </div>
            </div>
           </section>
        </div>
      </template>

Please help me, Thanks.
Hi All

I am working on one requirement where I am having 2 LWC. one is placed on the record page another one in the utility icon. Now I want to navigate to the LWC in utility whenever I clicked on a button in another LWC from the record page.

I am not able to achieve this by importing lightning/navigation. Can anyone Please help me?
Hi
I am trying to query some fields of Account in query editor. 
select id,Alternate_Number_1__c,
            Alternate_Number_2__c,
            Alternate_Number_3__c,
            Phone,Student_Phone_Number__c
            from 
            Account 
I cross checked  in object manager and all these fields are there in account object. but I am getting this error.
select id,Alternate_Number_1__c,
          ^
ERROR at Row:1:Column:11
No such column 'Alternate_Number_1__c' on entity 'Account'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.

FYI  all these fields are there in Person Account records.
Hi all

User-added imageI have to write a button logic in js(LWC) for '+' button in such a way that whenever I click on it. it should populate all the fields from the first line to the next line. 

Can anyone please help me.
Hi all

I am having a scenario where I want to give edit access for ownerId field of task object to one profile using apex code. Can anyone please help me out here.

Thanks.
Hi all
I wrote a LWC that displays all the fields of the payment object and I placed this component on the Case page. But I want to display some particular fields of payment on this component. Can anyone please help me. I am a newbie to LWC.
Here is my code

HTML:

<template>
    <lightning-card title="Contact Information">
            <div class="slds-m-around-small">
                <lightning-record-form record-id = {recordId1}
                object-api-name = "Payment__c"
                mode= "readonly"
                layout-type= "Full"
                columns ="2"
                >
                </lightning-record-form>
            </div>
    </lightning-card>
</template>

JS:

import { LightningElement, track, wire, api } from 'lwc';
import getPaymentContactInfo from 
'@salesforce/apex/ContactsOnCaseController.getPaymentContactInfo';
export default class auditreport extends LightningElement {
   @api recordId;
   @api recordId1;
    
    @wire(getPaymentContactInfo, {PayId: '$recordId'}) 
    WireContactRecords({error, data}){
        if(data){
            this.recordId1 = data;
            this.error = undefined;
            
        }else{
            this.error = error;
            this.recordId1 = undefined;
        }
        console.log(this.recordId1);
     }
}

Apex:

public with sharing class ContactsOnCaseController {
    @AuraEnabled
    public static Id getPaymentContactInfo(string PayId){
     // return [select Contact_No_1__c,Contact_No_2__c,Contact_No_3__c,Contact_No_4__c from Payment__c where id in (select Payment__c from case where id=:PayId)];
     List<Payment__c>Paydetails= [select id from Payment__c where id in (select Payment__c from case where id=:PayId)];    
    return Paydetails[0].id;
    }
}
 
Hi, I am trying to assign a queue as a task owner. I enabled task object for this queue but still, I  am getting this error. Can anyone please help me?

thanks in advance.
Hi
I want write a soql query on the Task object to get a custom field on its parent. whatid is the relationship field between Taskand its parent. I wrote this query but it throwing error.

select id,what.Program_Name__c from Task

How I can achieve this.

Thanks in advance
Hi
I have a requirement like, whenever a user creates a task and it is closed by another user, then I have to send a chatter notification to the user who created the task, I have written this code.

public static void postFeed(Set<Id>caseIdset){
        List<FeedItem> postlist = new List<FeedItem>();
        for(Id caseId:caseIdset){
        FeedItem post=new FeedItem();
        post.ParentId = caseId;
        post.Body ='task is closed';
        postlist.add(post);
        }
        if(postlist.size()>0){
            insert postlist;
        }

This one is sending chatter notifications to everyone when a task is closed, how I can make it send notifications to the user who created it.
Please help me in this.
Hii 
I am trying to deploy my code from git to sandbox, In the middle of this process I am getting this error.
OLHandler_test  afterInsert  System.NullPointerException: Attempt to de-reference a null object  External entry point.

Can anyone please help in solving this?
Component Code
<lightning:fileUpload label="Upload Multiple files" 
                               multiple="false" 
                              accept=".pdf, .png, .jpg"
                              recordId="{!v.recordId}"
                              aura:id="multipleUpload"
                             onuploadfinished="{!c.handleUploadFinished}" />

JScontroller
handleUploadFinished : function(component, event, helper) {        
   
        var uploadedFiles = event.getParam('files'); 
        //set action to call updatePicturePath method from Server-side controller
        var action = component.get('c.updatePicturePath');
        //set parametrs
        console.log('Id>>'+component.get('v.recordIdforFile'));
        var recordId=component.get('v.recordId);
        alert(recordId);
        action.setParams({
            recId : recordId
        }); 
        action.setCallback(this, function(response){
            var state = response.getState();
            alert(state);
            if(state === 'SUCCESS' || state === 'DRAFT') {
                var resultToast = $A.get("e.force:showTest");
                resultToast.setParams({
                    "title" : "Success!",
                    "message" : uploadedFiles.length + "file uploadedsuccessfully!"
                });
                resultToast.fire();;
            }
        });
        $A.enqueueAction(action);
    }

I am getting undefined for recordId and I need it to send as a parameter to updatePicturePath APEX method.
 
I am displaying multiple records and checkboxes for each record using aura iteration, Now i am  selecting  one record's checkbox and clicking on edit button to edit it. But i am not able to pass the id of checked record. Can anyone please help me.
I have a use case like in first column I need to dispaly some valuein first column which is a text value , according to that i need to make next column as dynamic which is picklist field  and according to the second column the third column need to be dynamic which is picklist field. For Example,
Column A (Text)Column B (Picklist)Column c (Picklist)
AB
C
D (If user select D)
B
C
BA
C
D (If user select A)
C
D
CA
B
D(If user select B)
A
D
DA
B
C(If user select C)
A
B


Is this possible to do in lwc datatable. If yes can anyone help me how to acheive this. Thanks in advance.

Hey I am trying to brush my aura skills after a long gap.

I am stuck with one weird error which says "A Component Error has occured! Error: Failed to initialize a component [Cannot read properties of undefined (reading '$getDescriptor$')]" I am getting at the time of component intialization. Any help would be appriciated. Thanks in adcvance.

Here is my code: 

HTML
<aura:component controller="RevisionController" implements="flexiPage:availableForAllPageTypes" access="global">
<aura:attribute name="conList" type="Contact[]"/>
<aura:attribute name="columns" type="List"/>
<aura:handler name="doInit" value="{!this}" action="{!c.doInit}"/>
<lightning:card title="Contact Details">
<!--<lightning:datatable keyField="Id" data="{!v.conList}" columns="{!v.columns}" />-->
</lightning:card>
</aura:component>

JS
({
doInit : function(component, event, helper) {
console.log('here');
/*component.set("v.columns" , [
{label:'LastName',value:'Lastname',type:'text'},
{label:'AccountName',value:'Account.Name',type:'url'},
{label:'Phone',value:'phone',type:'phone'}
]);
var conDetails = component.get("c.getContactList");
conDetails.setCallback(this, function(result){
if(result.getState() == 'SUCCESS'){
component.set("v.conList" , result.getReturnValue());
console.log('data>>>>.'+JSON.stringify(conList));
}
else{
console.log('Error>>>'+result.getReturnValue());
}
});
$A.enqueueAction(conList);*/
}
});


 

Hi All,

I have a requirement to navigate to the related list of the custom object in lwc. I am sharing my code below.

handleClick(){
console.log('recordId>'+this.recordId);
this[ NavigationMixin.Navigate ]( {
type: 'standard__recordRelationshipPage',
attributes: {
recordId: this.recordId,
objectApiName: 'FreshDesk_Ticket__c',
relationshipApiName: 'SRF_SPR__r',
actionName: 'view'
}
} );
}

The above code is taking me to the below page instead of related list.
User-added image

If the child object is standard one you can write object name by adding extra 's' at the end, but how to do it with custom object?

Any help would be appreciated.
I am making an inbound callout to my salesforce org by adding Id as a parameter to the endpoint and below is my apex code.

@RestResource(urlMapping='/Product/')
global class IntegrationProductsApi {
    
    @httpget
    global static List<Product2> getProducts(){
        Map<String,string> reqParams =  RestContext.request.params;
        string prodId = reqParams.get('Id');
        system.debug('prodId>'+prodId);
        List<Product2> productList=[select Id,ProductCode,Name from             Product2 where Id=:prodId];
        system.debug('productList>'+productList);
        if(productList.size()>0){
            return productList;
        }
        return null;
    }
}
Id which I am passing with endpoint is already there in salesforce DB, but still in the above debug statement I am getting productList as null.

I am new to integration and any help would be appreciated.
I am displaying multiple records and checkboxes for each record using aura iteration, Now i am  selecting  one record's checkbox and clicking on edit button to edit it. But i am not able to pass the id of checked record. Can anyone please help me.
I want to create the custom field on a standard object using apex from the user interface i.e. Visualforce.
My requirement is this custom field(city,country,state and zipcode) on standard object contact.
I am having total leaves, applied leaves and remaining leaves as fields in my Leave custom object and remaining leaves is a formula field. I am trying to get remaining leaves every time applied leaves changes i want remaining leaves field to be updated.
i used this formula but  i am getting syntax error. If anyone having any idea how to resolve it please help me.​​​​​​​User-added image
Hi!

I wrote a trigger on Lead to create a task for the Lead owner and notify him about the task creation. Here is the code,

List<task> lNewTasks =new List<task>();
Database.DMLOptions dmlo = new Database.DMLOptions();
dmlo.EmailHeader.triggerUserEmail = true;
Task tsk = new Task(Subject = 'Follow Up Lead test',Ownerid = Lead.Owner.ID ,whoid =Lead.ID,ActivityDate=date.today().adddays(1), Type='Phone' );
database.insert(tsk, dmlo);

But facing following issues:
1) Sometimes email not sent out. I'm just not getting what is the logic for sending/not sending the email notification on task creation. An email should go out each time task is created with this logic.
2) In email body Lead Name is null. See:
New Task

To: Peter Carmasino

Shruti Gujarathi has assigned you the following new task:

Subject: Follow Up Lead
Lead: null
Due Date: 10/21/2014
Priority: Normal

For more details, click the following link:

https://ap1.salesforce.com/<Task.ID>

Can anyone help me into this? Why Lead is null in the email sent after task is created? We can not handle this email, so I don't know what else do I need to do in apex to have the Lead name in email?

Thanks in advance!!!