• Raksha Narayan
  • NEWBIE
  • 20 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 24
    Questions
  • 18
    Replies
Is it possible to display field names in column instead of row using datatables in lightning Web Component in Salesforce as shown below?

User-added image
Below is the code snippet:
list<case> clist=[select id,recordtypeId,recordtype.developername from case limit 2];
for(case cs:clist){
    newcase__c bInstance = new newcase__c(); 
    Map<String,newcase_Config__mdt> Mapmetadata = newcase_Config__mdt.getAll();
 for(String mdtMap : Mapmetadata.keySet()){
        String fromField = Mapmetadata.get(mdtMap).From__c; //assume the value is recordtype.developername
        String toField = Mapmetadata.get(mdtMap).to__c; //assume the value is recordtype.developername
        system.debug('@@'+cs.recordtype.developername);
        bInstance.put(toField,cs.get(fromField));    
 system.debug('binstance'+binstance);        
    }
}
Here, from__c is holding the recordtype.developername on the case object and to__c is holding the recordtype.developername on the newcase__c object. In line 9, the fetched recordtype value has to get assigned to newcase__c's recordtype.developername. But I am getting an error as 'Invalid field recordtype.developername for Case'. Is there any way to achieve this?   
I want to query all fields in the start method of the batch class. Below is my code which is giving error(also giving error on type casting). Can you please suggest if there is any way to achieve this?
global class BatchClass implements Database.Batchable<sObject> {
    global Database.QueryLocator start(Database.BatchableContext BC) { 
    Map<String, Schema.SObjectField> CaseMap = Case.sObjectType.getDescribe().fields.getMap();        
    Set<String> setFieldNames = CaseMap.keySet();
    list<String> lstFieldNames = new List<String>(setFieldNames);                
    String query = Database.query('SELECT ' + String.join(lstFieldNames, ',') + ' FROM Case limit 2');
    return Database.getQueryLocator(query);
    }
}
 
I want to get the 'Enter the message...' in JS. Below is my LWC code:
<template>
    <lightning-card title="Raksha: Mock Email to Case Automation">
        <lightning-card if:true={showAutoResponseRuleModal}>
            <div class="slds-container_small">
                <template for:each={xmldata} for:item="mapKey">
                    <lightning-layout-item key={mapKey.booleanFilter} size="12">
                        <a></a>
                        <p data-id="test"> Enter the message... </p>
                    </lightning-layout-item>
                </template>
            </div>
        </lightning-card>
    </lightning-card>
</template>

JS:
const result = this.template.querySelector('test');
I am not able to get the message in JS. Can anyone please let me know what I am missing?
Is it possible to create Auto Response Rule from Apex? Please let me know
Is it possible to create multiple filter criteria in a list view dynamically in the apex class by importing the values from CSV file. If yes, please explain with example.
Is it possible to insert routing address information in email to case via tooling api/apex etc without manual insertion(as there are multiple email id's)?? please suggest
I have a button which is a quick action and I am calling a LWC and the logic is handled in the invoke method. Below is the LWC structure.

@wire(getRecord)
.
.
@wire(getRelatedListRecords)
.
.
@api invoke(){
..
}

I want to call @wire(getRelatedListRecords) in the invoke method or I want to reload the LWC component on clicking the button. 
Is this possible? 
 
List1<account>: ({Name=Acc1, type__c=Marketing,Agree__c=no},{Name=Acc2, type__c=Sales,Agree__c=yes})
List2<account>: ({Name=Acc1, Sla__c=new},{Name=Acc2, Sla__c=pending})
I need to compare list1's name == list2's name and then concatenate/merge two lists into 1 record.
List3<account>: ({Name=Acc1, type__c=Marketing,Agree__c=no,Sla__c=new},{Name=Acc2, type__c=Sales,Agree__c=yes,Sla__c=pending})
Please let me know if it is possible.
Hi,
On Account record I have a text field that contains value as 'Click here' where 'here' is a hyperlink to www.google.com. On querying the field using SOQL, I am getting the value as 'Click <a href="www.google.com"> here</a>'
But I want to get the value as 'Click here' instead of href. Is it possible? Please suggest if it can be achieved by any other method.
How to use merge fields in messaging template? I am getting blank value when I send a text to my phone through messaging channel.
Also, can we hyperlink a text in messaging template? 
Please suggest
I have a list of strings displayed as a dropdown. Consider the below code where TypePicklist contains the values: Normal, High and Low. I want to change the color of the text "High" dynamically. Can someone help me on this?
<lightning:select label="Type">
    <aura:iteration items="{!v.TypePicklist}" var="val">
        <option value="{!val}"> {!val}</option>
    </aura:iteration>
</lightning:select>
Is it possible to pass language on Schema.DescribeFieldResult so that I can get the field labels translated in multiple languages?
Account is a parent to Object B and Object C. Object B and Object C does not have any relationship. From Object B I want to find Object C's fields(like name etc.,) using Account in a single SOQL query. Can this be achieved?
I have my list<Sobject> and i have converted it to map<string,object> using getPopulatedFieldsAsMap() and the output from the debug logs is as follows:mymap:
{Account=Account:{Name=Test Account, Parent__c=false, Region__c='India', Zone__c=A-CH, Id=0010c00001teI2IQQQ}, AccountId=0010c00001teI2IZXE, Id=01M2f000001CZkaAQW}. 
Is it possible to convert mymap.value to another map so that Name is key and Test Account is value, Parent__c is key and false is its value and so on?
I have a dynamic query which contains the following query:
SELECT Id,Name,AccountId,Account.Name,StageName from opportunity id='XXXXXXXXXXXXXXX'
The outcome of the dynamic query is stored in a list<sobject>as below:
queryresult :(Opportunity:{Id=0060c00001USHd3AAH, Name=Test1, AccountId=0010c000025aqcnAAA, StageName=win}, Opportunity:{Id=006a000001ObaQkAAJ, Name="Test2, AccountId=001a000001OsvEGAAZ, StageName=win})
 
Queryresult is a list<sobject> and it is holding 2 records. But the queryresult is not storing Account.Name field which is a lookup field(except id).
I need the lookup field to be stored somewhere as I need them for some comparison purpose.
Could you please tell me how it can be done?
 
I have a string in apex controller stored as follows: String qtr={"Forecast_Category__c":["Unqualified","Not addressable"],"StageName":["1. Understand Customer","2. Discover Needs"]}. 
is it possible to store the following in the below format?
{Forecast_Category__c:[Unqualified,Not addressable] StageName:[1. Understand Customer,2. Discover Needs]}. 
I have a list<sobject> called SobjList storing the result as follows:
 SobjList=(Case:{Id=5002f0000043zxWAAQ, Subject=New case, CaseNumber=00678068, Category__c=Billing}, Event:{Id=00U2f0000018Ly0EAE, Subject=Test event, Type=Email, Status__c=Completed}.
The list<sobject> returns the values from Case and Event object.
But i want to store the field names and its values separately for both case and event in the form of map.
for example map1 should contain key as id, subject,casenumber and value should be new case, 00678068,Billing.
Is it possible?
I have a map<string,list<string>> storing list of objects and its fields. fir example: {{opportunity= name,stageName},{account=name,city__c},{case=name,casenumber}}and so on.. From the list<string> i want to find out the datatype of each field. Is that possible?
I tried iterating on the map value as follows:
for(List<String> m: mapfil.values()){      
            Schema.DisplayType fielddataType = m.getDescribe().getType();        }
But it throws error message saying:  "Method does not exist or incorrect signature: void getDescribe() from the type List<String>".
Please help
I have a map, map<string,list<sobject>> mapdata= new map<string,list<sobject>>(); storing the data. the list<sobject> is returning values in JSON format. How to deserialize it?
 
Hi,
On Account record I have a text field that contains value as 'Click here' where 'here' is a hyperlink to www.google.com. On querying the field using SOQL, I am getting the value as 'Click <a href="www.google.com"> here</a>'
But I want to get the value as 'Click here' instead of href. Is it possible? Please suggest if it can be achieved by any other method.
Below is the code snippet:
list<case> clist=[select id,recordtypeId,recordtype.developername from case limit 2];
for(case cs:clist){
    newcase__c bInstance = new newcase__c(); 
    Map<String,newcase_Config__mdt> Mapmetadata = newcase_Config__mdt.getAll();
 for(String mdtMap : Mapmetadata.keySet()){
        String fromField = Mapmetadata.get(mdtMap).From__c; //assume the value is recordtype.developername
        String toField = Mapmetadata.get(mdtMap).to__c; //assume the value is recordtype.developername
        system.debug('@@'+cs.recordtype.developername);
        bInstance.put(toField,cs.get(fromField));    
 system.debug('binstance'+binstance);        
    }
}
Here, from__c is holding the recordtype.developername on the case object and to__c is holding the recordtype.developername on the newcase__c object. In line 9, the fetched recordtype value has to get assigned to newcase__c's recordtype.developername. But I am getting an error as 'Invalid field recordtype.developername for Case'. Is there any way to achieve this?   
I want to get the 'Enter the message...' in JS. Below is my LWC code:
<template>
    <lightning-card title="Raksha: Mock Email to Case Automation">
        <lightning-card if:true={showAutoResponseRuleModal}>
            <div class="slds-container_small">
                <template for:each={xmldata} for:item="mapKey">
                    <lightning-layout-item key={mapKey.booleanFilter} size="12">
                        <a></a>
                        <p data-id="test"> Enter the message... </p>
                    </lightning-layout-item>
                </template>
            </div>
        </lightning-card>
    </lightning-card>
</template>

JS:
const result = this.template.querySelector('test');
I am not able to get the message in JS. Can anyone please let me know what I am missing?
Is it possible to create Auto Response Rule from Apex? Please let me know
Is it possible to create multiple filter criteria in a list view dynamically in the apex class by importing the values from CSV file. If yes, please explain with example.
I have a button which is a quick action and I am calling a LWC and the logic is handled in the invoke method. Below is the LWC structure.

@wire(getRecord)
.
.
@wire(getRelatedListRecords)
.
.
@api invoke(){
..
}

I want to call @wire(getRelatedListRecords) in the invoke method or I want to reload the LWC component on clicking the button. 
Is this possible? 
 
Hi,
On Account record I have a text field that contains value as 'Click here' where 'here' is a hyperlink to www.google.com. On querying the field using SOQL, I am getting the value as 'Click <a href="www.google.com"> here</a>'
But I want to get the value as 'Click here' instead of href. Is it possible? Please suggest if it can be achieved by any other method.
How to use merge fields in messaging template? I am getting blank value when I send a text to my phone through messaging channel.
Also, can we hyperlink a text in messaging template? 
Please suggest
Account is a parent to Object B and Object C. Object B and Object C does not have any relationship. From Object B I want to find Object C's fields(like name etc.,) using Account in a single SOQL query. Can this be achieved?
I have a dynamic query which contains the following query:
SELECT Id,Name,AccountId,Account.Name,StageName from opportunity id='XXXXXXXXXXXXXXX'
The outcome of the dynamic query is stored in a list<sobject>as below:
queryresult :(Opportunity:{Id=0060c00001USHd3AAH, Name=Test1, AccountId=0010c000025aqcnAAA, StageName=win}, Opportunity:{Id=006a000001ObaQkAAJ, Name="Test2, AccountId=001a000001OsvEGAAZ, StageName=win})
 
Queryresult is a list<sobject> and it is holding 2 records. But the queryresult is not storing Account.Name field which is a lookup field(except id).
I need the lookup field to be stored somewhere as I need them for some comparison purpose.
Could you please tell me how it can be done?
 
I have a list<sobject> called SobjList storing the result as follows:
 SobjList=(Case:{Id=5002f0000043zxWAAQ, Subject=New case, CaseNumber=00678068, Category__c=Billing}, Event:{Id=00U2f0000018Ly0EAE, Subject=Test event, Type=Email, Status__c=Completed}.
The list<sobject> returns the values from Case and Event object.
But i want to store the field names and its values separately for both case and event in the form of map.
for example map1 should contain key as id, subject,casenumber and value should be new case, 00678068,Billing.
Is it possible?
I have a map<string,list<string>> storing list of objects and its fields. fir example: {{opportunity= name,stageName},{account=name,city__c},{case=name,casenumber}}and so on.. From the list<string> i want to find out the datatype of each field. Is that possible?
I tried iterating on the map value as follows:
for(List<String> m: mapfil.values()){      
            Schema.DisplayType fielddataType = m.getDescribe().getType();        }
But it throws error message saying:  "Method does not exist or incorrect signature: void getDescribe() from the type List<String>".
Please help
I have a map, map<string,list<sobject>> mapdata= new map<string,list<sobject>>(); storing the data. the list<sobject> is returning values in JSON format. How to deserialize it?
 
I have created a LWC in order to print the sobject data in a table. for that I have created a map<String,list<SObject>>. From the debug logs, i found that the map holds the data in the below format: 
mymap{Case=(Case:{Id=5002f0000043zxWAAQ, ContactId=0030c00002kebMSAAY, CaseNumber=00678068}), Event=(Event:{Id=00U2f0000018Ly0EAE, WhoId=0030c00002kebMSAAY, Subject=Test event, Type=Email})}.
Now i need to iterate over the List<Sobject> value to print the values in a table as below.
for case:
 
idcontactidcase number
5002f0000043zxWAAQ0030c00002kebMSAAY678068
for event:
idsubjecttype
00U2f0000018Ly0EAETest eventEmail
The row and column should be printed in the table dynamically by picking the data from the list<sobject> (no hardcoding of the values in datatable or in html).
Please let me know how this can be achieved