• AJAY
  • NEWBIE
  • 10 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 17
    Questions
  • 13
    Replies
I have a scenario where i have LWC component A and in its html it uses LWC component b (In this LWC component i have built the picklist dependency + record type). So that in component A in HTML i pass like this.

<c-component-b
recordtypevariableinComponentB={getRecordTypeId}>
</c-component-b>

In component A in JS , i am passing the record Id and trying to get the recordTypeId(using this.case.data.fields.recordTypeId.value).

However after getting the recordtypeId and when i am trying to pass it to the variable 'recordtypevariableinComponentB' and refer it in getPicklistValues method it is not showing the picklist values.

This is somewhat similar issue like this -

LWC RecordType Issue (https://salesforce.stackexchange.com/questions/273168/get-picklist-values-on-record-typenot-a-default-without-hard-coding-of-record)

Where i did not find any solution. Can someone please help.
  • December 18, 2020
  • Like
  • 0

I want a screenflow inside which i should have a quick action(of type (update a record)). 

 

so that when a user is being navigated using the screen flow they can simply fill the fields in the quick action and click save.

FlowChart:

 

User -->clicks on Screenflow button-->it opens the flow-->inside it quick action(quick action is of type update a record) with fields say A,B,C(all picklist fields) should be present-->user fills details , clicks save button on the quick action. 

 

 

Is it possible?.  Or any alternatives please??..

  • December 07, 2020
  • Like
  • 0
I have a LWC component (parent) where there is a variable like
firstfieldAPIname , secondField API name in the LWC and this LWC components picks all the values of picklist fields using data.picklistfieldValues. and passes into some variables which are like  optionValuesFirstSet = {controlling:[], dependent:[]}; to store the controlling field values , dependent values of the fields basing on record type.

I have another LWC Component(Child) - which uses the parent LWC component LWC and some picklist fields are being passed into the child HTML.

Something like this:
<c-parent-lwc
  first-picklist-field-api-name ="Type"
  second-picklist-field-api-name = "Area"
  third-picklist-field-api-name = "SubArea"
> <c-parent-lwc/>


Now i get the values on the component, please see screenshot. 

I even got the current values of the fields Type,Area and sub Area on the record in the child JS, however - how do i show on the UI. 

User-added image




User-added image




 
  • November 29, 2020
  • Like
  • 0

Hello,

I have certain cases that have been approved/waiting for approval. I want them to be shown on the home page. For that i have create a LWC Component and if the status is pending for approval a clock kind of icon has to be shown beside the case number and if it is approved a approved icon has to be shown. 

I was trying to check the status value of the case using the '.then(result => '  from JS and update two booleans one for pending for approval and another boolean for approved basing on the status.  but it says undefined.  Below is the code.

 .then(result => {
            this.pageSize = 0;
            this.pageCurrent = 0;
            if (result.length > 0) {
                this.allCases = result;
               // console.log('the sub status',result);
            var data = result;
            console.log('the data is',data);
            if(data.length > 0){
                var length = data.length;
                console.log('the length is ',length);
                var substatusvalue = data.Sub_Status__c;
                console.log('the sub status value is ',substatusvalue);
                if(substatusvalue === 'Pending - Int Approval')
                    pendingApproval = true;
                if(substatusvalue === 'Approved')
                    Approved = true;
            
            }
                console.log('it is coming here?');

The console log are coming clearly for everything. But for  this log,  the value is coming up as undefined.  If i can get this value i can use for the boolean check, i can update the boolean and pass to if true in the Template in HTML and can show the icons.

 console.log('the sub status value is ',substatusvalue);

 

Can Anyone help please?. Or is My approach wrong?

 

Thanks,
Ajay.

 

 

 

  • May 16, 2020
  • Like
  • 0
I have a object A and object B. B object has a field which is a lookup to object A.


Now as they are related, under records of object A i have object b records as related list.

Now what i want to achieve is i want to create a quick action on record A. I kept a quick action which is a lightning component with LWC embedded into it.

Now upon clicking quick action, i want to show the details of the record of object A + LWC(record details of object B).

Imagine. Object A is account and object B is custom object x__c and has fields example1, example2

It should look Like below: account information + input fields of object x__c.
Account info:
Account name: abc
Account address: xyz
Account phone: 123
X__c info:
example1(to be input):
​​​​​​​​​​​​​​example2(to be input):
​​​​​​


Is it possible ?
  • March 07, 2020
  • Like
  • 0
I was trying to create a LWC component and keep it in lightning record page and see the details of the record. But the component is not showing the data.

Can anyone help me with this?

Below are all the details:

Apex Controller:
public with sharing class caseDetailsContollerLWC {
    @AuraEnabled(cacheable=true)
    public static list<case> caseDetails(Id recordId){
        return [select id,casenumber,status,priority,subject,description from case where Id=:recordId];
        //return c;
    }
    }

LWC JS:
import { LightningElement,api,wire } from 'lwc';
import SUBJECT from '@salesforce/schema/Case.subject';
import DESCRIPTION from '@salesforce/schema/Case.description';
import CASENUMBER from '@salesforce/schema/Case.casenumber';
import STATUS from '@salesforce/schema/Case.status';
import PRIORITY from '@salesforce/schema/Case.priority';
const fields=['subject','description','casenumber','status','priority'];
import caseDetails from  '@salesforce/apex/caseDetailsContollerLWC.caseDetails'
export default class caseDetailsLWC extends LightningElement {
@api recordId;
@wire(caseDetails,{recordId:'$recordId',fields})
caseDetails({ error, data }) {
    if (data) {
        this.data  = data;
        this.error = undefined;
    } else if (error) {
        this.error = error;
        this.data  = undefined;
    }
}
}

LWC HTML:
<!--
@File Name          : caseDetailsLWC.html
@Description        : 
@Author             : ChangeMeIn@UserSettingsUnder.SFDoc
@Group              : 
@Last Modified By   : ChangeMeIn@UserSettingsUnder.SFDoc
@Last Modified On   : 3/2/2020, 10:52:24 PM
@Modification Log   : 
Ver       Date            Author                Modification
1.0    3/2/2020   ChangeMeIn@UserSettingsUnder.SFDoc     Initial Version
-->
<template>
    <div class="slds-m-around_medium">
        <template if:true={caseDetails.data}>
            <template for:each={caseDetails.data} for:item="content">
                <p key={content.Id}>{content.Id}</p>
                <p key={content.subject}>{content.subject}</p>
                <p key={content.description}>{content.description}</p>
                <p key={content.priority}>{content.priority}</p>
                <p key={content.casenumber}>{content.casenumber}</p>
               
            </template>
        </template>
        <template if:true={caseDetails.error}>
            No data
        </template>
    </div>
    
    </template>

LWC Meta XML:
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="customSearch">
    <apiVersion>46.0</apiVersion>
    <isExposed>true</isExposed>
     <targets>
        <target>lightning__AppPage</target>
        <target>lightning__RecordPage</target>
        <target>lightning__HomePage</target>
    </targets>
</LightningComponentBundle>
 
  • March 04, 2020
  • Like
  • 0

Not able to deploy LWC Code to my org.

Here is the code :

JS:
import { LightningElement,track } from 'lwc';
export default class HelloExpression extends LightningElement {
    @track greeting="Hello";
    changeHandler(event){
        this.greeting=event.target.value;
    }
}

HTML:
<template>
    <lightning-card title="HelloWorld" icon-name="custom:custom14">
        <div class="slds-m-around_medium">
            <p>Hello, {greeting}!</p>
            <lightning-input label="Name" value={greeting} onchange={changeHandler}></lightning-input>
        </div>
    </lightning-card>
</template>

MetaHTML:
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="helloWorld">
  <apiVersion>45.0</apiVersion>
  <isExposed>true</isExposed>
  <targets>
    <target>lightning__AppPage</target>
    <target>lightning__RecordPage</target>
    <target>lightning__HomePage</target>
  </targets>
</LightningComponentBundle>

 

The JS is being saved, HTML is being saved in VS code however the MetaHTML is not being saved and it throws the below error:

Error parsing file: LWC Metadata Xml Parser: ParseError at [row,col]:[1,7]
Message: The processing instruction target matching "[xX][mM][lL]" is not allowed.

Any help? Please.?

  • February 29, 2020
  • Like
  • 0
I have seen the notification delivery settings under notification builder and the email notification settings under chatter under user settings.

Apart from this does anyone know  where the settings for chatter notifications and all are handled in salesforce.?
  • November 08, 2019
  • Like
  • 0
Hi I am going through a requirement where i have to render a visual force as PDF and on the first two pages of the PDF the page numbers should not be visible and it should start from the third page onwards (3 of 30)  like that. Right now i am displaying it on all the pages. But no idea on how to hide it from the first two pages. I tried if conditions in css and used javascript not getting it. Help is much appreciated.


Thanks,
Ajay.
  • September 21, 2017
  • Like
  • 0
Hi, i have a scenario  like this----  In account object whenever i create/update any field in the account object then a case (for creating/update) will be created and after closing the case the account becomes active. Now i have a problem suppose if i enter the phone number say 123456789,account billing state as say Washington and click save on account then even after closing the case(account update case) which is produced due to account update the details that i updated are not showing.This is because the billing state 'Washington' is having the same code 'WA' same as western Australia which even as WA. These codes are provided by salesforce and i cannot change them through customization. Is there any way we can achieve this? Please help
  • September 21, 2017
  • Like
  • 0
I want to display a button (back) all vf pages(rendered as pdf )so that it will take to me to the page where the account names are displayed in alphabetical order. Suppose if i have a 14 page pdf (visual force rendered)  the first page is logo and second page is account names are displayed in alphabetical order .Now all the remaining 12 pages should have back button where it will take me to second page(account names in alphabetical order). Is this possible any way ? Like keeping a image on all pages and putting to link to redirect to the second page or any other solution?. Help is much appreciated. Need solution at a high priority.

 
  • July 28, 2017
  • Like
  • 0
I am trying to finish the creation of a formula field in the trail head module,but was facing with this error.

<--Challenge Not yet complete... here's what's wrong: 
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [types__c, model__c]: [types__c, model__c]--> 

here comes the screen shot of the work i did.
User-added image

I created formula field on the case object-fields-custom fields,the field accessibility is given to all the profiles out there.
can anyone help me out where i have made the mistake..

i can reckon i have gone somehere silly.. 
help appreciated..

thanks
  • February 07, 2017
  • Like
  • 0
Challenge Not yet complete... here's what's wrong: 
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [types__c, model__c]: [types__c, model__c]


This is the error i am getting when trying to solve the task in custom controllers,but i am able to perform the task in my friend's org.Can anyone find out the problem out there?

These are the codes i used for apex class and visual force pages.

VF PAGE:

<apex:page controller="NewCaseListController">
    <apex:pageBlock title="new Case List" id="cases_list">
        <li>
            <apex:repeat var="case" value="{!newCases}" rendered="true" id="rCases">
                <p><apex:outputLink value="/{!case.ID}">{!case.CaseNumber}</apex:outputLink></p>
            </apex:repeat>
        </li>
    </apex:pageBlock>
</apex:page>




APEX CLASS:

public class NewCaseListController {
    public List<Case> getNewCases() {
    
        List<Case> results = [SELECT CaseNumber FROM Case WHERE status='New'];
            return results;
    }
}

 
  • August 24, 2016
  • Like
  • 2
Challenge Not yet complete... here's what's wrong: 
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [types__c, model__c]: [types__c, model__c]


This is the error i am getting when trying to solve the task in custom controllers,but i am able to perform the task in my friend's org.Can anyone find out the problem out there?

These are the codes i used for apex class and visual force pages.

VF PAGE:

<apex:page controller="NewCaseListController">
    <apex:pageBlock title="new Case List" id="cases_list">
        <li>
            <apex:repeat var="case" value="{!newCases}" rendered="true" id="rCases">
                <p><apex:outputLink value="/{!case.ID}">{!case.CaseNumber}</apex:outputLink></p>
            </apex:repeat>
        </li>
    </apex:pageBlock>
</apex:page>




APEX CLASS:

public class NewCaseListController {
    public List<Case> getNewCases() {
    
        List<Case> results = [SELECT CaseNumber FROM Case WHERE status='New'];
            return results;
    }
}

 
  • August 24, 2016
  • Like
  • 2

Hello,

I have certain cases that have been approved/waiting for approval. I want them to be shown on the home page. For that i have create a LWC Component and if the status is pending for approval a clock kind of icon has to be shown beside the case number and if it is approved a approved icon has to be shown. 

I was trying to check the status value of the case using the '.then(result => '  from JS and update two booleans one for pending for approval and another boolean for approved basing on the status.  but it says undefined.  Below is the code.

 .then(result => {
            this.pageSize = 0;
            this.pageCurrent = 0;
            if (result.length > 0) {
                this.allCases = result;
               // console.log('the sub status',result);
            var data = result;
            console.log('the data is',data);
            if(data.length > 0){
                var length = data.length;
                console.log('the length is ',length);
                var substatusvalue = data.Sub_Status__c;
                console.log('the sub status value is ',substatusvalue);
                if(substatusvalue === 'Pending - Int Approval')
                    pendingApproval = true;
                if(substatusvalue === 'Approved')
                    Approved = true;
            
            }
                console.log('it is coming here?');

The console log are coming clearly for everything. But for  this log,  the value is coming up as undefined.  If i can get this value i can use for the boolean check, i can update the boolean and pass to if true in the Template in HTML and can show the icons.

 console.log('the sub status value is ',substatusvalue);

 

Can Anyone help please?. Or is My approach wrong?

 

Thanks,
Ajay.

 

 

 

  • May 16, 2020
  • Like
  • 0
I was trying to create a LWC component and keep it in lightning record page and see the details of the record. But the component is not showing the data.

Can anyone help me with this?

Below are all the details:

Apex Controller:
public with sharing class caseDetailsContollerLWC {
    @AuraEnabled(cacheable=true)
    public static list<case> caseDetails(Id recordId){
        return [select id,casenumber,status,priority,subject,description from case where Id=:recordId];
        //return c;
    }
    }

LWC JS:
import { LightningElement,api,wire } from 'lwc';
import SUBJECT from '@salesforce/schema/Case.subject';
import DESCRIPTION from '@salesforce/schema/Case.description';
import CASENUMBER from '@salesforce/schema/Case.casenumber';
import STATUS from '@salesforce/schema/Case.status';
import PRIORITY from '@salesforce/schema/Case.priority';
const fields=['subject','description','casenumber','status','priority'];
import caseDetails from  '@salesforce/apex/caseDetailsContollerLWC.caseDetails'
export default class caseDetailsLWC extends LightningElement {
@api recordId;
@wire(caseDetails,{recordId:'$recordId',fields})
caseDetails({ error, data }) {
    if (data) {
        this.data  = data;
        this.error = undefined;
    } else if (error) {
        this.error = error;
        this.data  = undefined;
    }
}
}

LWC HTML:
<!--
@File Name          : caseDetailsLWC.html
@Description        : 
@Author             : ChangeMeIn@UserSettingsUnder.SFDoc
@Group              : 
@Last Modified By   : ChangeMeIn@UserSettingsUnder.SFDoc
@Last Modified On   : 3/2/2020, 10:52:24 PM
@Modification Log   : 
Ver       Date            Author                Modification
1.0    3/2/2020   ChangeMeIn@UserSettingsUnder.SFDoc     Initial Version
-->
<template>
    <div class="slds-m-around_medium">
        <template if:true={caseDetails.data}>
            <template for:each={caseDetails.data} for:item="content">
                <p key={content.Id}>{content.Id}</p>
                <p key={content.subject}>{content.subject}</p>
                <p key={content.description}>{content.description}</p>
                <p key={content.priority}>{content.priority}</p>
                <p key={content.casenumber}>{content.casenumber}</p>
               
            </template>
        </template>
        <template if:true={caseDetails.error}>
            No data
        </template>
    </div>
    
    </template>

LWC Meta XML:
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="customSearch">
    <apiVersion>46.0</apiVersion>
    <isExposed>true</isExposed>
     <targets>
        <target>lightning__AppPage</target>
        <target>lightning__RecordPage</target>
        <target>lightning__HomePage</target>
    </targets>
</LightningComponentBundle>
 
  • March 04, 2020
  • Like
  • 0

Not able to deploy LWC Code to my org.

Here is the code :

JS:
import { LightningElement,track } from 'lwc';
export default class HelloExpression extends LightningElement {
    @track greeting="Hello";
    changeHandler(event){
        this.greeting=event.target.value;
    }
}

HTML:
<template>
    <lightning-card title="HelloWorld" icon-name="custom:custom14">
        <div class="slds-m-around_medium">
            <p>Hello, {greeting}!</p>
            <lightning-input label="Name" value={greeting} onchange={changeHandler}></lightning-input>
        </div>
    </lightning-card>
</template>

MetaHTML:
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="helloWorld">
  <apiVersion>45.0</apiVersion>
  <isExposed>true</isExposed>
  <targets>
    <target>lightning__AppPage</target>
    <target>lightning__RecordPage</target>
    <target>lightning__HomePage</target>
  </targets>
</LightningComponentBundle>

 

The JS is being saved, HTML is being saved in VS code however the MetaHTML is not being saved and it throws the below error:

Error parsing file: LWC Metadata Xml Parser: ParseError at [row,col]:[1,7]
Message: The processing instruction target matching "[xX][mM][lL]" is not allowed.

Any help? Please.?

  • February 29, 2020
  • Like
  • 0
I am trying to finish the creation of a formula field in the trail head module,but was facing with this error.

<--Challenge Not yet complete... here's what's wrong: 
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [types__c, model__c]: [types__c, model__c]--> 

here comes the screen shot of the work i did.
User-added image

I created formula field on the case object-fields-custom fields,the field accessibility is given to all the profiles out there.
can anyone help me out where i have made the mistake..

i can reckon i have gone somehere silly.. 
help appreciated..

thanks
  • February 07, 2017
  • Like
  • 0
Hi,

I have executed "Run all test" to get code coverage of all apex classes. Is there way to get all apex classes code coverage with percentage copy to excel sheet. I am able to see all classes with percentage in Developer console. But not able to copy all those. Please provide some suggestion.