• veer soni
  • PRO
  • 2882 Points
  • Member since 2020
  • Developer
  • ACS


  • Chatter
    Feed
  • 93
    Best Answers
  • 0
    Likes Received
  • 4
    Likes Given
  • 0
    Questions
  • 431
    Replies
Hi All, i have a Custom field and the field name's character goes up to 80 characters so is there any way we can type out the Full name as of now the Char is Stopping at 40th character.
Hi Experts,
Today, I stuck in an issue. Actually I have a user xyz on that user's public group  Edit or Delete button is not showing. I want to add some more user in that group but edit button is not showing.
Could anyone help me that which permission I am missing.
Thanks In Advance
why I got this message?

Unknown property 'mensajeController.mensajeContenido'

this the vf page

<apex:page controller="mensajeController"  >
<apex:form >
 <apex:pageBlock >
 <apex:pageBlockButtons >
   <apex:commandButton value="Process Selected" action="{!processSelected}" rerender="test"/>
  </apex:pageBlockButtons>
  <apex:pageBlockTable value="{!contacts}" var="c" >
   <apex:column >
    <apex:inputCheckbox value="{!c.selected}"/>
   </apex:column>
    <apex:column value="{!c.con.Name}" />
    <apex:column value="{!c.con.Email}" />
    <apex:column value="{!c.con.Phone}" />
  </apex:pageBlockTable>
 </apex:pageBlock>
    <apex:pageBlock>
        <p>Current description: {!mensajeContenido}</p>
        <p>Change description to:</p> 
        <apex:inputTextarea id="newDesc" value="{!mensajeContenido}"/><p/>
        <apex:commandButton value="Save" action="{!save}"/>
    </apex:pageBlock>
 <apex:pageBlock id="test">
  Total No of Selected Records :<apex:outputText value="{!value }"/>
  <apex:pageBlockTable value="{!SelectedContacts}" var="c" >
    <apex:column value="{!c.Name}" />
    <apex:column value="{!c.Email}" />
    <apex:column value="{!c.Phone}" />
  </apex:pageBlockTable>
 </apex:pageBlock>
 </apex:form>
</apex:page>

this is the controller

public class mensajeController {
    public List<cContact> contactList {get; set;}
    public List<Contact> selectedContacts{get;set;}
    public Integer value {get;set;}
    public List<cContact> getContacts() {
        if(contactList == null) {
            contactList = new List<cContact>();
            for(Contact c : [select Id, Name, Email, Phone from Contact]) {
            contactList.add(new cContact(c));
            }
        }
    return contactList;
}
public PageReference processSelected() {
    selectedContacts = new List<Contact>();
    for(cContact cCon : getContacts()) {
        if(cCon.selected == true) {
        selectedContacts.add(cCon.con);
        }
    }
    value = selectedContacts.size();
    System.debug('printingtcontc'+selectedContacts.size());
    return null;
}
public List<Contact> getSelectedContacts(){
    System.debug('printingtcontc inside get'+selectedContacts.size());
    if(selectedContacts.size()>0)
       return selectedContacts;
    else return null;
}
public class cContact {
    public Contact con {get; set;}
    public Boolean selected {get; set;}
    public cContact(Contact c) {
    con = c;
    selected = false;
    }
}
    public class messageDescription {
        public string mensajeContenido {get; set;}
    }
}
 
Hi Peers,
I have a requirement. I want to fetch records from flow to lwc. we can do it by using apex but my manager was saying we can't use apex. we have to achieve it by flow.
Is there any way which we can achieve it?
You can refer any link or example.
Thanks In Advance
Hello Peers,
can someone help me to resolve this issue.I am not able to understand how to fix it.
Thanks In Advance
I get the following error when I try to save the code 
"Failed to save campingListItem.cmp: Invalid <aura:attribute> type: Camping_Item__c: Source"
<aura:component>
    <aura:attribute name="item" type="Camping_Item__c" required="true" />
    
    <p>Name:
        <ui:outputText value="{!v.item.Name}"/>
    </p>
    
    <p>Price:
        <lightning:formattedNumber value="{!v.item.Price__c}" style="currency"/>
    </p>
    
    <p>Quantity:
        <lightning:formattedNumber value="{!v.item.Quantity__c}" style="number"/>
    </p>

        
    <p>
        <lightning:input type="toggle"                            
                         label="Packed?"                           
                         name="Packed"                         
                         checked="{!v.item.Packed__c}" />
     </p> 
    
</aura:component>
  • October 30, 2021
  • Like
  • 0
I have one query and when im trying to iterate over it was showing the error.
[SELECT AccountSource,Account_Status__pc,Address_Verification_Status__pc,Agency_Code__c,Agency_Display_Name__c ,(
                                    SELECT Applicant__c,Appraisal_Value__c,Area__c,Account__c FROM Case) FROM Account WHERE Id IN: caseIdList];

I have this query while im writing like this :

                for(Account cs:acclist){
                                    
                                    if(cs.Case__r.Area__c!=null){
                    
                    htmlBody += '<tr><td style="border:1px solid red">' + 'CaseNumber' + '</td><td  style="border:1px solid ">' + cs.CaseNumber + '</td></tr>';
                }
How to Change CreatedDate Of Record In Test Class
I need to send  a information toast message in Lightning Web component(LWC) as Record Page is Loaded 
without any button click or change event

Below link has code but i dont need onclick ,it should show message by default
<lightning-button label="Show Info" onclick={showInfoToast}></lightning-button>

LWC recipes (https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.use_toast)

How to get this default Toast message in LWC?

Thanks for your help
Fiona
I Have QuickAction Button In Quick Action I'm using LWC Component
The Requirement Is it Showing On Record Detail Page in Lightning Experience But Not Showing On Community Site 
I am trying to create two identical contacts upon account creation. so far i have written below :
trigger IdenticalContacts on Account (after insert) {
    for (Account acc : Trigger.new){
    
        Contact con = new Contact();
        con.LastName = 'Monkey D';
        con.FirstName = 'Luffy';
        con.email = 'goldroger@gmail.com';
        con.AccountId = acc.id;
            
     }                           
}
I also wrote test class below but getting 0% code coverage:
@isTest
public class TestIndenticalContacts {
    
    @isTest static void createAccount(){
        Account acc = new Account();
        acc.Name = 'Salesforce';
        insert acc;
    }
}
Is the problem due to 'After Insert'?
 
Hi eveyone.
I need to display row number as seperate column with Row number as label in Custom LWC datatable. For every record should display serial number as seperate column with header. 
NOTE: I am not asking about show-row-number= true.
I should display row number as seperate field/column in table.

<c-custom-type-component
                            class="POdataTable slds-table_header-fixed_container slds-scrollable_x slds-border_top" 
                            key-field="Id" 
                            data={POrecords}
                            columns={columns} 
                            selected-rows={preSelectedRows} 
                            onrowaction={getPopUpInfo}
                            onpicklistchanged={tablePicklistChanged} 
                            onchangeofreturnqty={handelReturnQty}   
                            onselectedrow={handelSelectedRow}   
                            hide-checkbox-column                     
                        ></c-custom-type-component>

@track columns = [
{
            label: 'Row Number', cell: (row, index) => index + 1 
        }
]
If I am wrong PLEASE let me know. Thanks. 
Hi Experts,

I have a requirement, if a user clicks on a button it needs to open the record create form and a user can create a related object record on save. can anyone help me on this?
I want to show in <lightning output field> default values when there is no value in record field
I have an Account with Name "ATALANTE".
When I do a SOSL Query with filter "ATALANTA", the account is still returned.
It looks like SOSL does not search only exact matches.
User-added image

Can someone explain this?
I cannot find any article or documentation that explains this behavior, and I need to provide official explanation to my client.

Thank you
Hi, I'm new to VSCode. Today I opened an existing project from my pc and tried to authorize the org, but couldn't find the option from the command palette. I've installed CLI ad Salesforce pack extensions. Please help. Thanks.Screenshot
Hi..,
Whenever i uploaded a new file doc related to Case record, i want to create new Task which needs to be assigned to Case Owner.
so, suggest me any ideas to fulfill this requirement.
Thanks.
Hi Folks,
I have stucked in an requirement.  I have a autolunched flow that update  Opportunity Type From Aura Component.
In Aura Component, I have a input field in which I put Opportunity Type Value and the moment I press the button my Aura component call to flow and update Opportunity Value.
Everything is working fine but problam is after flow finish, flow header and Finish Message show on screen Like Below.
User-added imageMy Requirment is that When I call to flow at that time the flow header and finish message should not show on screen. It will seem like Hide flow. I have found out on google but Didn't get any right way.can someone help me to solve it.

Here is my Lightning Code.
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,
                            force:hasRecordId,lightning:availableForFlowScreens"
                access="global" >
    
    <aura:attribute name="oppType" type="boolean" /> 
    
    
    <lightning:flow aura:id="flowData" onstatuschange="{!c.statusChange}"/>
    
    
    <div>
                <lightning:input type="text" name="text" label="Opportunity Type" value="{!v.oppType}"/>
                <lightning:button label="Submit" name="next" variant="brand" onclick="{!c.handleNextStage}"/>
     </div>
    
    
</aura:component>
 
({
	handleNextStage : function(component, event, helper) {
       var flow = component.find("flowData");
         var inputVariables = [
             {
                name : "recordId",  
                type : "String",
                value : component.get('v.recordId')
             },
             
             {
                name : "OpportunityType",  
                type : "String",
                value :  component.get('v.oppType')
             },
             
              
           ];
            
            flow.startFlow("update_Opportunity_Type",inputVariables);
             component.set('v.oppType','');
            },
            
     
             
      statusChange : function (component, event) {
              
        if (event.getParam('status') === "FINISHED_SCREEN") {
             $A.get("e.force:refreshView").fire();
              
         }
    }
})

Your help will be appreciated.
Thanks In Advance
 
Hi, I have tried the below code, but for me, it returns only the Same application name even though I tried executing from a different application. Can someone help with this?


UserAppInfo userAppInfo = [SELECT Id, AppDefinitionId FROM UserAppInfo WHERE UserId = :UserInfo.getUserId() LIMIT 1]; 
AppDefinition appDefinition = [SELECT DurableId, Label FROM AppDefinition Where DurableId = :userAppInfo.AppDefinitionId LIMIT 1]; 
return appDefinition.Label;
 

Hi Experts,

I have requirment 
1. I need to fetch all the inactive users (IsActive==False),
2. if the inactive users having ownership for records on object Acocunt, Contact,Opportunity, we have to change record ownership to its imidiate manager assigned to that users.
3. for this we required batch class and sechudular which runs daily basis, covering all 3 objects iterative maner so no Apex cpu limit error occure

Kindly help me out.

 

 

Hi All, i have a Custom field and the field name's character goes up to 80 characters so is there any way we can type out the Full name as of now the Char is Stopping at 40th character.
I want to create a validation rule in the account object.
I have two text data type fields. I have tried with workflow it is working fine but need a validation rule for this.

When field "Location" is changed, I want "Status" field equal to "Moved".

Please guide me on this. Thanks for help.
Hi Experts,
Today, I stuck in an issue. Actually I have a user xyz on that user's public group  Edit or Delete button is not showing. I want to add some more user in that group but edit button is not showing.
Could anyone help me that which permission I am missing.
Thanks In Advance
why I got this message?

Unknown property 'mensajeController.mensajeContenido'

this the vf page

<apex:page controller="mensajeController"  >
<apex:form >
 <apex:pageBlock >
 <apex:pageBlockButtons >
   <apex:commandButton value="Process Selected" action="{!processSelected}" rerender="test"/>
  </apex:pageBlockButtons>
  <apex:pageBlockTable value="{!contacts}" var="c" >
   <apex:column >
    <apex:inputCheckbox value="{!c.selected}"/>
   </apex:column>
    <apex:column value="{!c.con.Name}" />
    <apex:column value="{!c.con.Email}" />
    <apex:column value="{!c.con.Phone}" />
  </apex:pageBlockTable>
 </apex:pageBlock>
    <apex:pageBlock>
        <p>Current description: {!mensajeContenido}</p>
        <p>Change description to:</p> 
        <apex:inputTextarea id="newDesc" value="{!mensajeContenido}"/><p/>
        <apex:commandButton value="Save" action="{!save}"/>
    </apex:pageBlock>
 <apex:pageBlock id="test">
  Total No of Selected Records :<apex:outputText value="{!value }"/>
  <apex:pageBlockTable value="{!SelectedContacts}" var="c" >
    <apex:column value="{!c.Name}" />
    <apex:column value="{!c.Email}" />
    <apex:column value="{!c.Phone}" />
  </apex:pageBlockTable>
 </apex:pageBlock>
 </apex:form>
</apex:page>

this is the controller

public class mensajeController {
    public List<cContact> contactList {get; set;}
    public List<Contact> selectedContacts{get;set;}
    public Integer value {get;set;}
    public List<cContact> getContacts() {
        if(contactList == null) {
            contactList = new List<cContact>();
            for(Contact c : [select Id, Name, Email, Phone from Contact]) {
            contactList.add(new cContact(c));
            }
        }
    return contactList;
}
public PageReference processSelected() {
    selectedContacts = new List<Contact>();
    for(cContact cCon : getContacts()) {
        if(cCon.selected == true) {
        selectedContacts.add(cCon.con);
        }
    }
    value = selectedContacts.size();
    System.debug('printingtcontc'+selectedContacts.size());
    return null;
}
public List<Contact> getSelectedContacts(){
    System.debug('printingtcontc inside get'+selectedContacts.size());
    if(selectedContacts.size()>0)
       return selectedContacts;
    else return null;
}
public class cContact {
    public Contact con {get; set;}
    public Boolean selected {get; set;}
    public cContact(Contact c) {
    con = c;
    selected = false;
    }
}
    public class messageDescription {
        public string mensajeContenido {get; set;}
    }
}
 
Hello, I want to get the Who.Name in a datatable, but I struggle with it due to the value not displaying in my datatable component.
I'm quite confident that my query in my apex class is working:
@AuraEnabled
public static List<Task> loadTasks2(Id recordId){
    string userId = UserInfo.getUserId();
    return[SELECT Subject, Who.Name, ActivityDate, Status FROM Task WHERE ActivityDate = TODAY AND OwnerId=:userId AND Status !='Completed'];
}

I think I made a mistake in the Datatable Controller. Could you look in it and tell me what to change, so the Who.Name is shown?

Controller:
component.set('v.mycolumns2', [
            {label: 'Thema', fieldName: 'Subject', type: 'url',
            typeAttributes: {label: { fieldName: 'Subject' }, target: '_blank'}},             
            {label: 'Name', fieldName: 'WhoName', type: 'lookup',
            typeAttributes: {label: { fieldName: 'Who.Name' }, target: '_blank'}},
        ]);
        var action = component.get("c.loadTasks2");
        
        
        
        var whatId = component.get("v.recordId");
        action.setParams({
            "recordId":whatId
        });
          
            action.setCallback(this, function(response){
            var state = response.getState();
            if (state === "SUCCESS") {
                var records =response.getReturnValue();
                records.forEach(function(record){
                   
                    record.SubjectName = '/'+record.Id;
                    
                });
                component.set("v.tasks2", records);
            }
        });
        $A.enqueueAction(action);

 

public Class PenClassDemonstration {
        public static void ApplyDiscountPen(list<Pen__c> VarPenListNew) {
            for(Pen__c VarP : VarPenListNew){
           if(VarP.Price__c >= 100){
               VarP.Price__c = VarP.Price__c-20;
               }
              }
             }
             }
Date myOldDate = Date.newInstance(2021, 1, 1);
Date myTodayDate = date.today();
List<Student__c>studentList = new List <Student__c>();
studentList = [SELECT Student_Id__c, Name, Joining_Date__c FROM Student__c
              WHERE Joining_Date__c >: myOldDate AND Joining_Date__c :<= myTodayDate];
In this above code i had getting this below error
Error Message
The error is appeared at in "studentList =" on here at in equalto symbol. Please resolve my problem. Thank you !
Hi guys, so I am trying to check this traihead but for some reason the challengue check is not working. Error messageI have already tried to delete the custom field and create it again, tried creating a new playground for the challenge but i am getting the same error over and over. I have the same code that the video shows in the trailhead so that should not be  the problem either. Has someone encounter this issue? 

User-added image
Here's my formula need.

IF(Field A > (Field B * 1.1)), "ERROR", 

AND/OR

IF((Field C * 12 / Field A) < Field D, "Error",

Otherwise it should calulate and post

(Field C * 12) / Field A

How would I represent this? I've tried several methods. Also, tried doing a validation but the field itself isn't showing up in the validation field options when I create it.
Hello Developers,

I have created Field dependencies, Status picklist field is controlling and sub status picklist field is dependent. I have a requirement of showing path of both Status and Sub status picklist fields on the record page. I did that by Aura component but dependent picklist(sub status) is showing all the values on the path.

On path dependent picklist(sub status) should only show the values related to what user selects in controlling field (Status) means dependent picklist path should change and only show values on behalf of what we select in the controlling field.

Here is what I implemented: -

<aura:component implements="flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId" > <aura:attribute name="variant" type="String" default="non-linear"/> <aura:attribute name="hideUpdateButton" type="Boolean" default="true"/> <lightning:picklistPath aura:id="picklistPath" recordId="{!v.recordId}" variant="non-linear" picklistFieldApiName="Sub_Finance__c" onselect="{!c.handleSelect}"> </lightning:picklistPath> </aura:component>

({ handleSelect : function (component, event, helper) { var stepName = event.getParam("detail").value; var toastEvent = $A.get("e.force:showToast"); toastEvent.setParams({ "title": "Success!", "message": "Toast from " + stepName }); toastEvent.fire(); } }) 

Does anyone knows solution for this requirement?
I have a custom tab that displays a lighning component which on a click event allows a user to edit a record.
I am trying to listen for a save success on the e.force:editRecord and after much searching I found no solution as apparently there is no standard callback for the editRecord
https://trailblazer.salesforce.com/ideaView?id=0873A000000CQQiQAO
As per a few other suggestions I have added an handler for the force:showToast
This is working, albeit a hack, but the problem is as this is an application event it is constantly being listened for even if the custom tab isn't open.
Does anyone have any ideas how I can remedy this
<aura:handler event="force:showToast" action="{!c.handleToastEvent}"/>



handleToastEvent: function(component, event, helper){
        var toastMessageParams = event.getParams();
        var message = toastMessageParams.message;
        if(message.includes('Resource Placeholder') && message.includes('was saved')){
            var calendar = component.get('v._Calendar');
            var calendarEvent = event.getParam("calendarEvent")
            helper.fetchCalendarEvents(component, calendar, calendarEvent);
        }
    }

Many thanks,
Hi,
I have lightning components that displays images from ContentVersion as thumbnails and also links, when I click on the image its directly downloading the image but I would like it to open as preivew or open the image in a new tab/window. please advice.
below is the current line that displays image thumbnails with link to open big
<aura:iteration items="{!v.items}" var="content">
	       <a href="/sfc/servlet.shepherd/version/download/'+{!content.id}" target="_blank"> <img src="/sfc/servlet.shepherd/version/download/'+{!content.id}" width="100" height="100"/> </a>
	    </aura:iteration>

 
There is a weird scenario I'm facing while I try to bind the markup UI tags with lighting aura:attribute as type sObject (fields). I'm trying to bind data to sobject's fields for different lightning:input tags, For one sObject attribute the binding works perfect, but in the same way for another sObject the data is not getting bound. For Ex:
<aura:attribute name="student" type="JN_Student__c" access="global" default="{'sobjectType' : 'JN_Student__c'}" /> <lightning:input aura:id="requiredVal" name="lastName" label="Legal Last Name"value="{!v.student.JN_Last_Name__c}" maxlength="20" required="true"/>
above works perfectly and the data persists as I show/hide this section. WHEREAS for,

<aura:attribute name="insuranceInstance" type="JN_Insurance__c" access="global" default="{'sobjectType' : 'JN_Insurance__c'}" /> <lightning:input aura:id="requiredVal" name="lastName" label="Legal Last Name" value="{!v.insuranceInstance.Name}" maxlength="20" required="true"/>

the 'v.insuranceInstance.Name' doesn't persists its value.
Please reply if anyone knows/encounted the same.