• Naveen KN
  • SMARTIE
  • 1124 Points
  • Member since 2017
  • Salesforce Consultant
  • codekiat.com


  • Chatter
    Feed
  • 35
    Best Answers
  • 0
    Likes Received
  • 18
    Likes Given
  • 1
    Questions
  • 474
    Replies
Is there a way, without creating a new record type, to hide a picklist value (not entire field) if another picklist value is selected?
  • June 02, 2023
  • Like
  • 0
Hi,

We have a LWC component built by an outside developer that needs to be edited. How do you edit an existing compenent?
Hi,
I can't create a quick action to run a flow from an Individual
Is this standard or am I missing something:
Flow mission from picklist

Beating my head against the wall and hoping someone can point out what I'm missing. I have a basic Lightning component with a drop-down. When that drop-down changes, I'd like the controller to make a second field visible through an aura if. But I can't even get the selection onchange to trigger. 

 

Component is basically:

<aura:attribute name="rType" type="string"/>  
<lightning:select name="rType" label="Record Type" value="{!v.rType}" required="true" onchange="{!c.syncSelection}">

With controller:

syncSelection: function (component, event, helper) {
        console.log("this worked");

 

Hi!
How can I delete definite contact from table by id?

Apex:
  @AuraEnabled
    public static void deleteContact(Id contactId) {        
        List<Contact> deleteContact = 
            [SELECT Id
            FROM Contact 
            WHERE Id = :contactId 
        ];
        delete deleteContact;        
   }

Js:
    handleDelete() {
        console.log("launch");        
        deleteContact()
            .then(result => {
                console.log(result, 'end')
                this.contacts = result;
            })
            .catch(error => {
                console.log(error, "err")
                this.error = error;                
            });
    } 
In screen flows, I have two fields in account like reading 1 and reading 2, The requirement is that they can enter either reading 1 or reading 2 but not both Value and must be greater than zero “0” . I want vaidation on the screen flow. Plase help me to sort this
Hey folks,

I would like to create a custom report type for Approval History(ProcessInstanceStep).

My first approach was creating a trigger or record-triggered flow on the ProcessInstanceStep object.
But for some reason, Salesforce doesn't allow me to create a trigger on the object.

Background information,
There are more than 2,000 submitted approvals daily based.
The client wants to maximize declarative tools' usability.(Not Programatical solution)

How should I resolve this issue?

Much obliged, in advance.
Liam
Hi everyone ,i have tried below trigger ,Account should have only one active oppotunity ,but it is not working as expected ,not hitting error.help me..
trigger:
trigger onlyonechildactive on Opportunity (before insert,before update) {
set<Id>accountId=new set<Id>();
    for(opportunity o:trigger.new){
        if(o.AccountId!=null){
            accountId.add(o.id);
        }
    }
    List<Account>acclist=[select id,name,(select id,stageName,closeDate,name,Active__c from opportunities where Active__c=true)from Account where Id=:accountId];
    map<id,boolean> bb=new map<id,boolean>();
    //for each account
    for(Account a:acclist){
        bb.put(a.id,a.opportunities.size()>0  );
            
        }
    for(opportunity op:trigger.new){
        if(bb.get(op.AccountId)==true && op.Active__c==true){
           op.addError('there is already a Active opp'); 
        }
    }
    }
Thanks in Advance
  • December 30, 2022
  • Like
  • 0
I have this trigger in which, when a new quote record is inserted, I am updating couple records, which works fine in the after insert serction.

But when an approval process updates a record, I want some records to be updated in the after update section, which is causing the recurssive error: 

QuoteTrigger: execution of AfterUpdate caused by: System.DmlException: Update failed. First exception on row 0 with id 0Q05D0000007jBySAI; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, QuoteTrigger: maximum trigger depth exceeded Quote trigger event AfterUpdate Quote trigger event 

How can I get around this error and implement my logic? Trigger code is below. Error occours on update qtList; line. I am trying to implement in the // If the quote is approved unmark - section.

 
trigger QuoteTrigger on Quote (after insert,after update) {
    
    Set<String> oppIds = new Set<String>();
    for(Quote q : Trigger.New){
        oppIds.add(q.opportunityId);  
    }
    
    public static Boolean preventRecursive = true;
    if(preventRecursive){
        preventRecursive = false;
        
        // To mark the newly inserted quote as latest and unmark the previous quote if there is any
        if(Trigger.isInsert && Trigger.isAfter){
            List<Quote> quoteList = [select id,opportunityId,Latest_quote__c from quote where opportunityId IN :oppIds ORDER BY CreatedDate DESC LIMIT 2];
            if(quoteList.size() == 1){
                quoteList[0].Latest_quote__c = true;
                update quoteList;
            } else if (quoteList.size() > 1) {
            quoteList[0].Latest_quote__c = true;
                quoteList[1].Latest_quote__c = false;
                update quoteList;
            }
        }
        
        if(Trigger.isAfter && Trigger.isUpdate){
            if(trigger.new != null){
                for(quote qt:trigger.new){
                    if(Trigger.new[0].Status== 'Approved' && qt.Quote_Link__c == Null && qt.Proposal_PDF__c == Null && qt.Site_Services_PDF__c == Null){                
                       // Quote_Lcs.sendemailtemplate(qt.id);
                    } 
                } 
                
                // If the quote is approved unmark all as latest and mark last updated (approved) quote as latest
                if(Trigger.new[0].Status== 'Approved'){ 
                    System.debug('Approved');
                    List<Quote> qtList = [select id,opportunityId,Latest_quote__c from quote where opportunityId IN :oppIds  ORDER BY LastModifiedDate DESC];
                    if (qtList.size() > 1) {
                        for(Integer i = 0; i < qtList.size(); i++){ // uncheck all from being latest
                            qtList[i].Latest_quote__c = false;
                        }
                    }
                    qtList[0].Latest_quote__c = true; // mark only the last updated/approved quote as latest
                    update qtList;
                }
            }
        }
    }
}

 
We had a vendor create a Aura component to insert an iFrame into one of our community pages to allow an end user to upload attachments.  This is not working because we need to be using ".secure.fore.com" in the URL.  It is getting the URL like this:  "cmp.get('c.getFileUploadSiteURL');  But in the cmp file I do not see "getFileUploadSiteUrl", so I am trying to understand where this field is coming from???
Hi Everyone,

I have JSON data. I wish to store this JSON data in my custom object field.
Is this possible in salesforce? Any idea?
Thanks in Advance.
how to send list<strings> from parent component  to child component  using aura attribute in lightning
 (note : I dont want aura methods or events ) 
I have an issue with lightning bottom menu item's that is within a data table whereby the menu items are not visible if the menu item appears as the last record of the data table (see the 2nd image) or if the data table consists of only 1 record (see the last image). Below is the sample code of the data table with the lightning button menu

Sample Code
<div class="slds-table--header-fixed_container" style="height: 100%">
        <div class="slds-card__body slds-card__body_inner slds-scrollable--y" style="height: 100%">
    
            <table class="slds-table slds-table--bordered slds-table--header-fixed">
                <thead>
                <tr class="slds-text-title--caps">
                    <aura:iteration items="{!v.columns}" var="col">
                        <th scope="col">
                            <div onclick="{!c.updateColumnSorting}"
                                 class="slds-truncate slds-cell-fixed"
                                 title="{! col.fieldName}" data-field="{! col.fieldName}">
                                {! col.label }
                                <span>
                                    <aura:if isTrue="{!v.sortedBy == col.fieldName}">
                                            {! v.sortAsc ? '&#8593;' : '&#8595;'}
                                    </aura:if>
                                </span>
                            </div>
                        </th>
                    </aura:iteration>
                    <th scope="col"></th>
                </tr>
                </thead>
                <tbody>
                <aura:iteration items="{!v.data}"
                                var="record" indexVar="indexVar">
                    <tr>
                        <th data-label="Title" class="{! 'popover_'+record.Id +' cell-solution-title-width'}">
                            <div class="slds-truncate cell-solution-title-width" title="{!record.Solution_Title__c}"
                                 data-recordid="{!record.Id}" data-record="{! record}">
                                {!record.Solution_Title__c}
                            </div>
                        </th>
                        <th data-label="Category" class="{! 'popover_'+record.Id +' cell-solution-number-width'}">
                            <div class="slds-truncate cell-solution-number-width" title="{! record.Solution_Sub_Category__c}"
                                 data-recordid="{!record.Id}" data-record="{! record.Solution_Sub_Category__c}">
                                {! record.Solution_Sub_Category__c}
                            </div>
                        </th>
                        <th data-label="Status" class="{! 'popover_'+record.Id}">
                            <div class="slds-truncate" title="{!record.Status__c}"
                                 data-recordid="{!record.Id}" data-record="{! record}">
                                {!record.Status__c}
                            </div>
                        </th>
                        <th data-label="Author" class="{! 'popover_'+record.Id}">
                            <div class="slds-truncate" title="{!record.CreatedBy.Name}"
                                 data-recordid="{!record.Id}" data-record="{! record}">
                                {!record.CreatedBy.Name}
                            </div>
                        </th>
                        <th>
                            <lightning:buttonMenu aura:id="menu" onselect="{! c.handleSelect }"
                                                  alternativeText="Menu" value="{!record.Id}" menuAlignment="right">
                                <lightning:menuItem value="{! 'E,'+record.Id +','+indexVar}" label="Edit"/>
                                <lightning:menuItem value="{! 'A,'+record.Id +','+indexVar}" label="Approve"/>
                            </lightning:buttonMenu>
                        </th>
                    </tr>
                </aura:iteration>
                </tbody>
            </table>
    
        </div>
    </div>

User-added image
User-added imageUser-added image
Hi 
Greetings of the day...

I am designing a Lightning component using Developer console and on adding it to Lightning App Builder, I am not finding any custom tab to add my component to the Lightning page.


User-added image


Plz. help us to add a lightning component in the custom section.
Hi, 

I'm a green Salesforce Admin.

I'm trying to close this Booking (Opportunity) by changing the stage fom 'Closed Won' to 'Closed', but gettign the error: 

Object (id = 0060I00000dElwv) is currently in trigger OpportunityTrigger, therefore it cannot recursively update itself

I can see the Apex Trigger in the Object Manager, but I don't have any experience with development, so I can;t tell why this error is occuring. 

 
Hi Team,

In my project i have the urgent requirement.

At the lookup Field we have an option to create New Record in Lightning View.  
Creating the New Record at Look-Up Field is a Standard Salesforce Out of the box functionality.
1)How can i restrict the user while trying to create the Record at Look-Up in lightning View ?

FYI:

User-added imageThanks in Advance...

Thanks,
Venkat.
I am trying to create a view to show activity information. However the below code is not displaying any information, only header is showing. Please help.
HTML Component :

<template>
    <lightning-card class="slds-text-title_bold"  title = "Activity Information">
        <div class="slds-p-around_medium lgc-bg" style="height: 300px;">
            <lightning-datatable
                    key-field="id"
                    data={data}
                    columns={columns}>
            </lightning-datatable>
        </div>
    </lightning-card>
</template>
 
JS File:

import { LightningElement,api,wire,track} from 'lwc';
import ActivitySearchController from '@salesforce/apex/ActivityLeadPage.ActivitySearchController'

const columns = [
    { label: 'Subject', fieldName: 'Subject' },
    { label: 'Due Date', fieldName: 'ActivityDate' },
    { label: 'Status', fieldName: 'Status' },
];

export default class ActivityLeadPageComponent extends LightningElement {
    @api recordId;
    @track data = [];
    @track columns = columns;
    @wire(ActivitySearchController, { currentID: '$recordID'})
    TaskList;
}
 
Controller :

public class ActivityLeadPage{
    
    @AuraEnabled(cacheable=true)
    public static List<Task> ActivitySearchController(String currentID){
        List<Task> TaskList = new List<Task>();
        Map<Id,Lead> leadMap = new Map<Id,Lead>();
        if(currentID.startsWith('00Q')){
            try{
                List <Lead> leadList = [SELECT id, Email FROM Lead WHERE ID=:currentId];
                String ldEmail       = leadList[0].Email;
                Set<String> emailIds = new Set<string>();
                if(ldEmail!=null){
                    emailIds.add(ldEmail);
                }               
                
                TaskList = getTaskList(emailIds);
                
            }           
            catch(Exception e){
                system.debug('getlinenumber-->'+ e.getMessage() +' line '+ e.getLineNumber());
            } 
        }
        return TaskList;
    }
    
    public static List<Task> getTaskList (Set<String> emailIds) {  
        Map<Id,Lead> leadMap = new Map<Id,Lead>();      
        leadMap = new Map<Id,Lead>([SELECT id, Email FROM Lead Where Email IN:emailIds]);       
        
        Set<Id> leadID = new Set<Id>(); 
        for(Lead lE : leadMap.values()){
            leadID.add(lE.id);            
        }  
        
        List<Task> TaskList = [Select id, Subject, Description, who.Type, What.Type, Priority, Status, ActivityDate,CreatedDate, LastModifiedDate FROM Task 
                               WHERE whoId IN:leadID ORDER BY createddate DESC LIMIT 20];
        
        if(TaskList.size() == 0){
            Apexpages.addMessage(new ApexPages.Message(ApexPages.Severity.INFO,''+'No Tasks to Display'));
        }
        
        return TaskList;
    }   
}
What should i do with this error? Does not let me send quotes by email from the PDF page of the quote...
 
Hi All,

I have created a lightning component to display a public site from which we can get customers sigup.
I have created the Lightning component for this and able to view the page but, I am unable to fire the toast messages in this.
And also my Save button is not getting disabled after clicking on it. 
This is my code. Any help to solve this is appreciated. Thanks in advance.
Lightning component:
<aura:component controller="CreateContactrecordController" 
implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:lightningQuickAction,
            flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,lightning:isUrlAddressable,
            lightning:actionOverride,force:hasRecordId"
             access="global" >
    <!-- Include Static Resource-->
    <ltng:require styles="/resource/bootstrap/css/bootstrap.min.css" 
scripts="/resource/bootstrap/js/jquery.js,/resource/bootstrap/js/bootstrap.min.js"/>
    <!--aura:attribute name="isSpinner" type="boolean" default="false"/-->
    <aura:attribute name="FirstName" type="String" default="" />
    <aura:attribute name="LastName" type="String" default="" />
    <aura:attribute name="Mobile" type="String" default="" />
    <aura:attribute name="Email" type="String" default="" /> 
    <aura:attribute name="Store" type="String" />
    <aura:attribute name="LanguageList" type="List" />
    <aura:attribute name="SelectedLanguage" type="String" />
    <aura:attribute name="isHide" type="Boolean" default="false" />
    
     <aura:handler name="onSaveSuccess" event="force:recordSaveSuccess" action="{!c.handleSaveSuccess}"/>
 <force:recordEdit aura:id="edit" recordId=""/>
 <ui:button label="Save" press="{!c.save}"/>
    
    <div class="slds-page-header">
        <div class="slds-align_absolute-center">
            <div class="slds-text-heading_large">
                <div class="slds-m-top_xx-large">
                    Customer Subscription Form
                </div>
            </div>
        </div>
    </div>
    <br/>
    <aura:handler name="init" action="{!c.doinIt}" value="{!this}"/> 
    <div class="slds-form-element__control">
         <lightning:input label="First Name" name="firstname" type="text" required="true" value="{!v.FirstName}" />
        <br/>
        <lightning:input label="Last Name" name="lastname" type="text" required="true" value="{!v.LastName}" />
        <br/>
        <lightning:input label="Mobile" type="tel" value="{!v.Mobile}"/>
        <br/>
        <lightning:input label="Email" name="email" type="email" required="true" value="{!v.Email}" />
        <br/> 
        <lightning:input label="Store" type="Text" name="Store" value="{!v.Store}" />
        <br/> 
        <lightning:select label="Language" name="Language" value="{!v.SelectedLanguage}">
            <aura:iteration items="{!v.LanguageList}" var="Language">
                <option value="{!Language}" text="{!Language}"></option>
            </aura:iteration>
        </lightning:select>
        <br/>
   <lightning:button variant="brand" disabled="{!v.isHide}" label="{!v.isHide == true ? 'Save' : 'Save'}" onclick="{!c.savecustomerForm}" /> 
    <!--lightning:button variant="brand" disabled="{!v.isSpinner}" label="{!v.isSpinner == true ? 'Saving...' : 'Save'}" onclick="{!c.savecustomerForm}" /--> 

    </div>       
</aura:component>

Controller.js:

({
    doinIt: function(component, event, helper){ 
        var action = component.get('c.getPickListValuesIntoList');          
         // method name i.e. getEntity should be same as defined in apex class         
         // params name i.e. entityType should be same as defined in getEntity method        
        //action.setParams({ "entityType" : component.get('v.componentString') });         
            action.setCallback(this, function(a){             
            var state = a.getState(); // get the response state             
            if(state == 'SUCCESS') {
               component.set('v.LanguageList',a.getReturnValue()); 
            }        
            });         
            $A.enqueueAction(action); 
    },
     savecustomerForm: function(component, event, helper) {
        console.log('Create record');
         var action = component.get("c.save");
        //Setting the Apex Parameter
         action.setParams({"FirstName":component.get("v.FirstName"), "LastName":component.get("v.LastName"),
                           "Email":component.get("v.Email"), "Mobile":component.get("v.Mobile"), 
                           "Store":component.get("v.Store"), "Language":component.get("v.Language")
            });
        //Setting the Callback
        action.setCallback(this,function(a){
            //get the response state
            var state = a.getState();
            var isContactexists = a.getReturnValue();
            //check if result is successfull
           
            if(state == "SUCCESS"){
                //Reset Form
                var newContact = {'sobjectType': 'Contact','FirstName': '','LastName': '','Email': '',
                                  'Mobile': '', 'Store__C': '','Language__c' : ''};
                //resetting the Values in the form
                component.set("v.Contact",newContact);
                if(isContactexists===true){
              //alert('Record Created Successfully');
                    component.find("edit").get("e.recordSave").fireeSuccess : function(cmp, event) {
                     // Display the save status
                     var toastEvent = $A.get("e.force:showToast");
                     toastEvent.setParams({
                     "title": "true!",
                     "message": "My Custom Record Saved Successfully"
 });
 toastEvent.fire();
                    }
                    
                component.set('v.isHide', true);  
                }
                else { 
                   alert('Record already exists'); 
                   
                }
            }
            else if(state == "ERROR"){
            alert('Error in calling server side action');
           
            }
            
        });
                
         $A.enqueueAction(action);}

})

Apex controller:

public class CreateContactrecordController {
@AuraEnabled
     public static List<String> getPickListValuesIntoList()
     {
       List<String> pickListValuesList= new List<String>();
        Schema.DescribeFieldResult fieldResult = Contact.Language__C.getDescribe();
        List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues();
        for( Schema.PicklistEntry pickListVal : ple){
            pickListValuesList.add(pickListVal.getLabel());
        }    
        return pickListValuesList;
    }
 @AuraEnabled   
    public static Boolean save(String FirstName, String LastName, String Email, String Mobile, String Store, String Language )
    {
        List<Contact> Contact = [SELECT Id, Email From Contact WHERE Email=:Email];
         if(contact.size() > 0){
             return false;
        }else{
            Contact con=new Contact(); 
            con.FirstName = FirstName;
            con.LastName = LastName;
            con.Email = Email;
            con.MobilePhone = Mobile;
            con.Store__c = Store;
            con.Language__c = Language;
            insert con;
            return true;
        }
    }
    }
 
There is a requirement where we need to group the business field by rows and group status field by column, In this process, we get a matrix report with business as rows and different status as columns

shown below in the screenshot 
User-added image
this is the exported report from salesforce. 

Now we have a requirement to display pending column after Due column in the above-shown screenshot and the value of the pending column is calculated by the subtraction of Due and delivered columns. how to achieve this?

Appreciate your inputs on this. 

- Naveen K N
Hi

Is there any predefined sequence order for standard button placement on Salesforce page layouts?

User-added image

Thanks and Regards,
Lakshya
Is there a way, without creating a new record type, to hide a picklist value (not entire field) if another picklist value is selected?
  • June 02, 2023
  • Like
  • 0
I have a requirement i need to add couple of columns in Recently viewed cases list view.i'm unable to edit

Please help me 
I want to show an image which is stored in rich text area field of an object using LWC on community page for guest users.
i have an 1000 users out of which i want to restrict the access to 400 users to an object how can i do it.
Hi,
How we pass record collection variable from LWC to Flow Collection Variable?
I have array of collection defined in LWC.
[{"Qty":"1","Id":"01u0P00000kjd8vQAA","Level":4},{"Qty":"4","Id":"01u520000090pFoAAI","Level":4}]
 
Need to pass this collection to Flow variable.
I added this in xml
        <property name="editableproductstoflow
" type="{T[]}" label="Passing Records to Flow" role="outputOnly" />
Js File

I am trying to write an Apex test Class for a Trigger that I want to deploy. However, when I receive the 'duplicate value found' error:

@isTest
private class ProphixFieldsTest {
    static testMethod void testProphixFields() {
        // Create test data
        Opportunity opp = new Opportunity(Name='Test Opp', StageName='Prospecting', CloseDate=System.today().addDays(30), ForecastCategoryName='Pipeline');
        insert opp;
        Product2 prod = new Product2(Name='Test Product', ProductCode='123', Budget_Code__c='327 - RPD');
        insert prod;
        OpportunityLineItem oli = new OpportunityLineItem(OpportunityId=opp.Id, Product2Id=prod.Id, UnitPrice=100, Start_Date__c=System.today(), End_Date__c=System.today().addDays(30), Fiscal_Months__c=12);
        insert oli;

        // Test insert trigger
        opp = [SELECT Products_opp1__c, Product_Codes__c, Budget_Code__c, Amount, Current_Fiscal_Revenue__c, QuoteBeginDate__c, QuoteEndDate__c FROM Opportunity WHERE Id=:opp.Id];
        System.assertEquals(prod.Name, opp.Products_opp1__c);
        System.assertEquals(oli.ProductCode, opp.Product_Codes__c);
        System.assertEquals(oli.Budget_Code__c, opp.Budget_Code__c);
        System.assertEquals(oli.UnitPrice, opp.Amount);
        System.assertEquals(oli.Fiscal_Revenue__c, opp.Current_Fiscal_Revenue__c);
        System.assertEquals(oli.Start_Date__c, opp.QuoteBeginDate__c);
        System.assertEquals(oli.End_Date__c, opp.QuoteEndDate__c);

        // Test update trigger
        prod.Name = 'Test Product Updated';
        update prod;
        opp = [SELECT Products_opp1__c FROM Opportunity WHERE Id=:opp.Id];
        System.assertEquals(prod.Name, opp.Products_opp1__c);

        // Test delete trigger
        delete oli;
        opp = [SELECT Products_opp1__c FROM Opportunity WHERE Id=:opp.Id];
        System.assertEquals(null, opp.Products_opp1__c);
    }
}

User-added image

I have a record triggered flow ,which send emails to 3 fields (x,y,z )that are lookup fields to account to User object when Account.Verified= true.

Decision element code: 
Verified__c==True &&(NOT(ISBLANK({!$Record.Account__r.Vat__c.Id})) && NOT(ISBLANK({!$Record.Account__r.y__r.Id})) && NOT(ISBLANK({!$Record.Account__r.z_Owner__r.Id})))


Mailing i am using send action and i am calling all email values data in Recipient Email Addresses (comma-separated) as {!$Record.Account__r.x__r.Email},{!$Record.Account__r.y__r.Email},{!$Record.Account__r.z__r.Email}

criteria 1: 
if record has both x,y,z lookups available : I have no problem as all emails are present so emails are flowing.

criteria 2: if record has only x lookup and rest yand z have no values then null will be passed from y,z lookup to Recipient Email Addresses (comma-separated) to send email action  which cause the flow to fail

can you tell me how to send emails with out any issue if there is 1 email or 2 emails please 
One of the team is getting a component error.  I am still a new virgin SF admin.  I encloised a screen shot of the message and the component error.  Any help would be appreciated.

User-added image
for example we created email record  named as user123@gmail.com.
the same email record user123@gmail.com is typed for anotheer record it should not beeen saved the error message want to be displayed.
Ran into this last night in working a flow. I wonder if anyone else has run into it, or if it is a bug with Winter 2022.

A record triggered flow is triggered by a change in a bolean field named "Start Automated Process" to TRUE. Triggers whenever the record is updated and that field's value is TRUE.  The record triggered flow has two elements in it, first, sets bolean Start... field back to False, and then calls a subflow. The subflow's job is to set another field on the task object to a specific value based on computation within the flow (exact function not as important - it has been debugged and is working correctly) - this is done based on passing the $record.id variable to an input variable in the subflow.

When testing by changing the Start Automated Process field on the task object, upon save, the Start Automated Process field goes back to FALSE (as expected) meaning that the record triggered flow is being triggered, but the expected update on the task object does NOT occur.

So I attempted to debug the record triggered field, and this could be crucial, I received an error message saying "Object Task is not supported in UI API."

User-added image
Figuring that this was just for debugging, I was still puzzled that the subflow did NOT appear to be running at all and setting the other value.

To further debug, I set an element in the record triggered flow that will write the value for $Record.Id into an un-used text field on the task record. When I then triggered the flow by setting the Start Automated Process field to TRUE, the SAP field sets to FALSE as expected, but the $Record.id field does NOT set to the value of the record ID.

My conclusion at this point is that the $record.id field is NOT accessible in a record triggered flow. I attempted to assign the $Record.Id field to another declared variable, and had the same result.

I used Process builder to then set the SAP field on Task to false, using the same triggers that I used on the record triggered flow, and to then run the subflow.I set the SAP field on task to TRUE. Process builder launches correctly, setting the SAP field to false, and updated the other field correclty with the subflow called. Clearly, it was able to pass through the Task ID.

I attempted some more debuggiing using the field on task $Record.CallType - and using the record triggered flow, the record triggered flow does not appear to have access to that field either.

Curious if anyone else has run into this?
i have an 1000 users out of which i want to restrict the access to 400 users to an object how can i do it.
Hi,
How we pass record collection variable from LWC to Flow Collection Variable?
I have array of collection defined in LWC.
[{"Qty":"1","Id":"01u0P00000kjd8vQAA","Level":4},{"Qty":"4","Id":"01u520000090pFoAAI","Level":4}]
 
Need to pass this collection to Flow variable.
I added this in xml
        <property name="editableproductstoflow
" type="{T[]}" label="Passing Records to Flow" role="outputOnly" />
Js File

We would like to make the Attach Article button available for our engineers/analysts to click a single time. OOTB, the Knowledge component on the Case page hides the Attach Article button within a dropdown and it is not immediately obvious:

The Knowledge component is shown with the dropdown expanded and the Attach Article button highlighted with an arrow pointing to the desired location.


Hi,

I have created an LWC component to create a new Quote. Created an Aura Application and called a component from the Visualforce page. I have created a List button and called the visualforce page.
The issue is when clicking on the list button lightning record edit form is showing but the Save & Cancel buttons are not working. If I use lwc alone it is working but within the VF page, it is not working.
Any idea what I missed here?
I have two fields on the Account -
Account Name and Account Alias

I have a list of Account names and their Aliases that I would like to be able to store in salesforce somewhere to reference.

I want a formula field check box that checks these values against the list.

I want the formula to find the Account Name Field in the Account Name keys from the list and check if the value = the Alias field and if so return true.
Hi,
I can't create a quick action to run a flow from an Individual
Is this standard or am I missing something:
Flow mission from picklist
Hello, so I try to create a datatable component that displays tasks and events of a contact in a single table. 
task1   ActivityDate
task2   ActivityDate
event1   ActivityDate
task3   ActivityDate
event2   ActivityDate
event3   ActivityDate

For now I created a code that shows both tasks and events but in two seperated areas, but I really do not know what approach I should take to combine the results of these two. Maybe you could help me with this topic. So my Controller now is like that:
 
public class ApexActivityWrapper {

 @AuraEnabled
	public static wrapper method1 (){
        
        string userId = UserInfo.getUserId();
        
    List<Task> getTask = [SELECT Subject, ActivityDate FROM Task WHERE OwnerId=:userId ORDER BY ActivityDate];
    List<Event> getEvent =	[SELECT Subject, ActivityDate FROM Event WHERE OwnerId=:userId ORDER BY ActivityDate];
                             
           wrapper wrp = new wrapper();
    	wrp.taskList = new List<Task>(getTask);
    	wrp.eventList = new List<Event>(getEvent);
    return wrp;
}

	public class wrapper{
    
   	 	@AuraEnabled
    		public List<Task> taskList ;
    	@AuraEnabled
    		public List <Event> eventList;
	}
}

 

Beating my head against the wall and hoping someone can point out what I'm missing. I have a basic Lightning component with a drop-down. When that drop-down changes, I'd like the controller to make a second field visible through an aura if. But I can't even get the selection onchange to trigger. 

 

Component is basically:

<aura:attribute name="rType" type="string"/>  
<lightning:select name="rType" label="Record Type" value="{!v.rType}" required="true" onchange="{!c.syncSelection}">

With controller:

syncSelection: function (component, event, helper) {
        console.log("this worked");

 

Hey folks,

I would like to create a custom report type for Approval History(ProcessInstanceStep).

My first approach was creating a trigger or record-triggered flow on the ProcessInstanceStep object.
But for some reason, Salesforce doesn't allow me to create a trigger on the object.

Background information,
There are more than 2,000 submitted approvals daily based.
The client wants to maximize declarative tools' usability.(Not Programatical solution)

How should I resolve this issue?

Much obliged, in advance.
Liam
I have installed Dropbox for Salesforce using a Business Standard account. Apparently it is working correctly and as we expected but strange Apex exceptions are occurring in one of the managed triggers. We were getting that error every 60 seconds and we can't confirm if there are issues behind the scenes because of this.

It would help us to know what this exception is about and what we can do to avoid it. Thank you in advance.

Failed to process Queueable job for class Dropbox_for_SF.HandleConvertQueue for job ID 7073f00000F75nl.

caused by: Dropbox_for_SF.DropboxClient.UserNotConnectedException: Script-thrown exception

Class.Dropbox_for_SF.DropboxClient.createHttpRequest: line 74, column 1
Class.Dropbox_for_SF.DropboxClient.httpCallout: line 99, column 1
Class.Dropbox_for_SF.DropboxClient.httpCallout: line 96, column 1
Class.Dropbox_for_SF.DropboxClient.httpCallout: line 93, column 1
Class.Dropbox_for_SF.DropboxClient: line 327, column 1
Class.Dropbox_for_SF.RootFinder.findRecordRoot: line 247, column 1
Class.Dropbox_for_SF.RootFinder.findRecordRoot: line 214, column 1
Class.Dropbox_for_SF.RootFinder.findRecordRoot: line 199, column 1
Class.Dropbox_for_SF.HandleConvertQueue.moveFiles: line 32, column 1
Class.Dropbox_for_SF.HandleConvertQueue.execute: line 13, column 1
Component: 

 <lightning:datatable style="width: 50%" data="{! v.ContactList }"
                             aura:id="accountDataTable"
                             columns="{! v.mycolumns }"

                             onrowselection="{!c.handleSelectedRow}"
                             keyField="Id"  onsave ="{!c.onSave}" hideCheckboxColumn="false" onrowaction="{!c.viewRecord }"
<lightning:button variant="Brand" label="Delete Selected Contacts" title="Success" onclick="{! c.handleSelectedRowdelete }"/> 

JS Controller :

handleSelectedRow: function(component, event, helper){
        var abc = event.getParam('selectedRows'); 
        
        var setRows =[];
        for(var i = 0;i<abc.length;i++ ) {
            alert('abc[i].id'+abc[i]);
            setRows.push(abc[i].id);
        } 
        
        component.set("v.selectedRows",setRows);
    },
    handleSelectedRowdelete: function(component, event, helper){
         var conList=component.get("v.selectedRows");
        alert(conList);
        var conIds =[];
        for(var i = 0;i<conList.length;i++ ) {
            
            conIds.push(conList[i].id);

        }
        alert("****Id****",conIds);
        
        var action = component.get("c.DeleteContactlist");
        action.setParams({
            'listcon' : conIds
        });
        action.setCallback(this,function(response) {
            var state = response.getState();
            if (state === "SUCCESS") {
                //if update is successful
                component.set("v.showdelete",'True');
                component.set("v.ContactList",'');
                location.reload();
            }
        });
        $A.enqueueAction(action);


I want on click of Delete Selected Contacts , all selected contact should deleted. I have use onselected attribute of datatable and on selestion, I am updating selectedRows. On button click I am using SelectedRows and trying to get the id but getting error. 



Error:   Action failed: c:getContactComp$controller$handleSelectedRowdelete [Cannot read property 'id' of undefined]
Hi,
I had written code for 3 fileds (FirstName,LastName,PhysicalAttributes) for inserting record in Contact Object.It was successfully Saving Record.
But when i am trying to insert Record using FirstName and LastName i am getting error like

Error creating record
Upsert failed. First exception on row 0; first error: INVALID_TYPE_ON_FIELD_IN_RECORD, Physical Attributes: value not of required type: : [Physical_Attributes__c]
Close


Because while Inserting Records we can skip some Fields(i.e;Non-Mandatory)Fields.Can any one Plz suggest me.

Here is my code:

<template>
    <lightning-card title="Insert Contact" icon-name="standard:contact">
            <div class="slds-p-around_x-small">
                <lightning-input label="FirstName" value={rec.FirstName} onchange={handleFirstNameChange}></lightning-input>
                <lightning-input label="LastName" value={rec.LastName} onchange={handleLastNameChange}></lightning-input>
                <lightning-input type="text" label="PhysicalAttributes" value={rec.Physical_Attributes__c} onchange={handlePhysicalAttributesChange}></lightning-input><br/>
                <lightning-button label="Save" onclick={handleClick}></lightning-button>
            </div>
        </lightning-card>
</template>

import { LightningElement,track } from 'lwc';
import createContact from '@salesforce/apex/insertContactApexWeb.saveContactRecord';
import {ShowToastEvent} from 'lightning/platformShowToastEvent';
import FIRSTNAME_FIELD from '@salesforce/schema/Contact.FirstName__c';
import LASTNAME_FIELD from '@salesforce/schema/Contact.LastName__c';
import PHYSICALATTRIBUTES_FIELD from '@salesforce/schema/Contact.Physical_Attributes__c';
export default class InsertContact extends LightningElement {
    @track firstname = FIRSTNAME_FIELD;
    @track lastname = LASTNAME_FIELD;
    @track physicalattributes = PHYSICALATTRIBUTES_FIELD;
   @track  rec = {
        FirstName : this.firstname,
        LastName : this.lastname,
        Physical_Attributes__c: this.physicalattributes
    }
    handleFirstNameChange(event) {
        this.rec.FirstName = event.target.value;
    }
    
    handleLastNameChange(event) {
        this.rec.LastName = event.target.value;
    }
    
    handlePhysicalAttributesChange(event) {
        this.rec.Physical_Attributes__c= event.target.value;
    }
    handleClick() {
        createContact({ con : this.rec })
       .then(result => {
            // Clear the user enter values
            this.rec = {};
            window.console.log('result ===> '+result);
            // Show success messsage
            this.dispatchEvent(new ShowToastEvent({
                title: 'Success!!',
                message: 'Contact Created Successfully!!',
                variant: 'success'
            }),);
        })
        .catch(error => {            
            this.error = error.message;
            window.console.log('error body--'+error.body.message);
            this.dispatchEvent(
                new ShowToastEvent({
                    title: 'Error creating record',
                    message: error.body.message,
                    variant: 'error',
                }),
            );
            window.console.log("error", JSON.stringify(this.error));
        });

    }
    
}


Apex Class:
public with sharing class insertContactApexWeb {
   
    @AuraEnabled
    public static void saveContactRecord(Contact con){
        System.debug('acc--'+con);
        try{
            insert con;
        }
        catch(Exception ex) {
            throw new AuraHandledException(ex.getMessage());
        }
    }
}
I have an active user that has a customer community license.  That user is able to own contact records, but I can't seem to change ownership of an account to that user.

In the documentation, I found this statement: "Community Users can't own community-enabled accounts".  Is that my issue?  What does it mean for an account to be "community-enabled"?  Is there a work-around?  My goal here is to have a community licensed user that can own accounts that are outdated/inactive.

Thanks,

- Randy Trigg
  • September 17, 2019
  • Like
  • 1
Context

I have a custom Lightning Web Component that allows modification of multiple records inside of modal. Once a record is updated, I reload that same record-id, but the old data shows up instead of the new data. After thorough research, I have concluded that the Lightning Data Service is at fault here. It is caching the data in the built-in ViewState most likely. The only way to get a data refresh is by refreshing the entire web page. I found multiple articles that explain how to turn off Secure and Persistent Browser Caching, but this is an unacceptable solution, as the entire Organization will take a performance hit, to support my little Lightning Web Component. Also salesforce insists that you don't do it production:

https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/debug_disable_caching.htm

Question

How do I invalidate or send a ChangeNotify Event to the Lightning Data Service (in the context of Lightning Web Components), so my lightning-record-edit-form shows the updated data, instead of the old data (without refreshing the entire web page of course)?
Just wanted to share a problem we had that I haven't seen elsewhere.

We built a Flow Definition with the Process Builder and Added it to our Managed Package

Then we decided to Deactivate the Flow before uploading the Package as some orgs that we support may not use it.

When we tried to install our Managed Package, it failed, saying that the Flow had been Deleted.

It clearly had NOT been deleted, so we were stumped.  Salesforce Support couldn't help us and escalated the Case.

I began studying the Setup Audit Trail and noticed strange entries that happened at the same time I Activated and Deactivated the Flow:

When my Flow was "Activated",  the system was creating a 'Flow Trigger" and a "Workflow Rule" behind the scenes with the same name as my flow, though adding a long id number at the end.

The PROBLEM is that when I deactivated the Flow, the system didn't just deactivate the "backend" Workflow Rule, but THEN it DELETED both the 'Flow Trigger' and the "backend" Workflow Rule!  I don't understand why it was actually deleted? THIS deleted hidden Trigger and Workflow is what caused the package install to fail.

On a hunch I decided to Activate the Flow and build a new package again.  Sure enough, the package uploaded and installed perfectly.

Salesforce needs to put some documentation around this, or at least have a warning popup when you try to Deactivate a Flow that is already in a package.

How are we supposed to know that deactivation is deleting components that we didn't even know were there in the first place?

Hope this saves someone else some time.