• MagulanDuraipandian
  • PRO
  • 2345 Points
  • Member since 2012


  • Chatter
    Feed
  • 72
    Best Answers
  • 0
    Likes Received
  • 2
    Likes Given
  • 11
    Questions
  • 835
    Replies
Hi. I have this trigger:
trigger preventAccountCreateOrUpdate on Account (before insert, before update) {
            for (Account a : Trigger.new) {
            if (a.type=='Prospect') {
              a.addError('You can not create or update this record.');
            }
          }
        }
How can I change the code to handler trigger that I have Account Trigger Handler Class and Account Trigger?
 
My lightning component all the picklist values from the related object 

User-added imageUser-added image

Aura Component
<div class="four wide column">
                        <label for="category-dropdown"><b>Select Category</b></label>
                        <select id="category-dropdown" label="Category" class="ui small fluid selection dropdown">
                            <option value="{!v.defaultCategory}">--None--</option>
                            <aura:iteration items="{!v.categoryOptions}" var="category">
                                <option value="{!category}">{!category}</option>
                            </aura:iteration>
                        </select>
                    </div>


Aura Hepler
({
    enableCategoryValues: function(component){
        
        let action = component.get('c.getCategoryValues');
        action.setParams({
          'recordId': component.get('v.recordId')
        });
        
        action.setCallback(this, function(response){
            
            let state = response.getState();
            
            if(state === 'SUCCESS') {
                
                component.set('v.categoryOptions', response.getReturnValue());
                component.set('v.catgoryFilterEnabled', true);
                
            }else{
                console.error(JSON.stringify(response.getError()))
            }
            
        })
        $A.enqueueAction(action)
    },
   })


Aura Controller
   
@AuraEnabled
    public static List<String> getCategoryValues(String recordId) {
        
        List<String> catregories = new List<String>();
        
        Schema.DescribeFieldResult fieldResult = SVMXC__Service_Order__c.Category__c.getDescribe();
        List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues();
        for( Schema.PicklistEntry pickListVal : ple){
            catregories.add(pickListVal.getValue());
        }     
        //catregories.sort();
        system.debug('catregories : '+catregories);
        
        List<String> hasValueCategory = new List<string>();
        
        Set<String> categorySet = new Set<String>();
        
        List<sharinpix__SharinPixImage__c> sharinPixImageList = [select
                                                                 Id,
                                                                 sharinpix__AlbumID__c,
                                                                 sharinpix__ImagePublicId__c,
                                                                 Landscape_Portrait__c,
                                                                 sharinpix__FileName__c,
                                                                 sharinpix__ImageURLOriginal__c,
                                                                 Image_Thumbnail_F__c,
                                                                 sharinpix__ImageURLFull__c ,
                                                                 CreatedDate,
                                                                 sharinpix__Tags__c,
                                                                 Work_Order__c,
                                                                 Work_Order__r.IP_Templates_Type__c,
                                                                 Work_Order__r.SVMXC__Component__c,
                                                                 Work_Order__r.Name,
                                                                 Work_Order__r.Start_Date_Time__c,
                                                                 sharinpix__Width__c,
                                                                 sharinpix__Height__c,sharinpix__Title__c,
                                                                 Image_Name__c,
                                                                 Work_Order__r.Category__c
                                                                 from
                                                                 sharinpix__SharinPixImage__c
                                                                 where
                                                                 sharinpix__AlbumID__c != null 
                                                                 AND
                                                                 (NOT sharinpix__Tags__c LIKE '%After%')
                                                                 AND
                                                                 (NOT sharinpix__Tags__c LIKE '%Before%')
                                                                  AND
                                                                 (NOT sharinpix__Tags__c LIKE '%Time-Hrs%')
                                                                
                                                                 AND
                                                                 Work_Order__r.SVMXC__Component__c =: recordId 
                                                                 AND Work_Order__r.Category__c =: catregories 
                                                                 ORDER BY Work_Order__r.Start_Date_Time__c, sharinpix__FileName__c, sharinpix__SortPosition__c];
        
        if(sharinPixImageList != null){
           
            for(sharinpix__SharinPixImage__c pix : sharinPixImageList){
                if(pix.Work_Order__r.Category__c != null){
                    categorySet.add(pix.Work_Order__r.Category__c);
                }
            }
            
        }
        
        hasValueCategory.addAll(categorySet);
        
        return hasValueCategory;        
    }

please check and help me with the issue

thanks in advance 
Himanshu
i need subject (Subject - PickList) with standart value "Call". Why i can't to select this field with PickList? not string  User-added image
Hi all, i have craeted a MAster deatil relation ship field and by default it is giving write access to every profile but i want to change it to Read only for certain profiles.  but it is not giving option to enable.
can any one please guide
Hi there,
I have created an Aura Lightning Component which is button that opens an hyperlink.
I want to get the URL from current record of "Lead" via a custom field in called "URL__c". I have tried to use "force:hasRecordId" but I am not able to get the value.
Here is my implementation of my lightning component:
<aura:component implements="lightning:availableForFlowScreens" access="global">
	<center><ui:button label="Open Opportunity" press="{!c.openActionWindow}"/></center>
</aura:component>
({
	openActionWindow : function(component, event, helper) {
        window.open("{!v.URL__c}");
	}
})
Hello All, I'm trying to create a parent component that uses wire service to grab task records and then sorts them into two maps(?) to be consumed by child components. I need them sorted by Status = Completed or Status != Completed.

I'm having trouble figuring out how to iterate over the returned records.

Any help would be greatly appreciated!

Controller
public with sharing class ATLController {
    @AuraEnabled(Cacheable=true)
    public static List<Task> getTasks(String recordId) {
        return [SELECT Id, Subject, TaskSubtype, ActivityDate FROM Task WHERE WhatId = :recordId];
    }
}
JS
import { LightningElement, api, wire } from 'lwc';

export default class AtlBase extends LightningElement {
    @api recordId;

    completedTaskList = [];
    upcomingTaskList = [];

    @wire(getTasks, {recordId:'$recordId'}) 
        tasks; 

        for(let task in tasks){
            if(task.Status === 'Completed'){
                completedTaskList.push(task);
            } else if(task.Status != 'Completed'){
                upcomingTaskList.push(task);
            }
        }
}


 

Hello All,    

I wanted to create a overlay popover using lwc and not using aura lightning overlay component. How can i do this ?

Thanks in advance !

  • March 23, 2020
  • Like
  • 0
Hi, I have an apex trigger which displays total tasks related to opportunity, but my trigger is not working even it doesn't have any errors. Can someone help me with this trigger?

//Apex Trigger

trigger OpportunityTaskCount on Task (after insert, after update, after delete, after undelete) {
    Set<Id> oppList = new Set<Id>();
    Set<Id> tskList = new Set<Id>();
    List<Opportunity> updateList = new List<Opportunity>();
    if(trigger.isInsert) {
        for(Task tsk : trigger.new) {
            if(tsk.WhatId != NULL) {
                oppList.add(tsk.Id);
                tskList.add(tsk.WhatId);
            }
        }
        system.debug('Opportunities'+oppList);
    }
    if(trigger.isDelete || trigger.isUpdate ) {
        for(Task tsk : trigger.old) {
            if(tsk.WhatId != NULL) {
                oppList.add(tsk.Id);
                tskList.add(tsk.WhatId);
            }
        }
    }
    if(trigger.isUndelete) {
        for(Task tsk : trigger.new) {
            if(tsk.WhatId != NULL) {
                tskList.add(tsk.WhatId);
            }
        }
    }
    for (Opportunity opp : [SELECT Id, Name, Total_Tasks__c ,(SELECT Id, Status FROM Tasks) 
                           FROM Opportunity 
                           WHERE Id in : oppList]) {
                               opp.Total_Tasks__c = opp.Tasks.size();
                               updateList.add(opp);
                           }
    update updateList;
}
  • March 15, 2020
  • Like
  • 0
I've been tinkering with a query as an exercise/proof of concept that would return an account, its associated contacts, opportunitires and cases, with some details of each related record.  And for the most part it works great. The part that breaks is when I try to pull in the contact name (first and alst) form the contact related to each Case -- as opposed to the contacts across the entire account.  If it comes ot it, I'll probably have ot manipulate the results in Apex anyway, so I can do the cleanup there, but I'm trying to work out if this is even possible, and so far coming up with only pat of an answer. (For the time being I'm just running these form the Qeury Editor in Developer Console.)

The part that works looks like this:
SELECT Id, Name,
 (SELECT FirstName, LastName, Title, Email, Phone FROM Contacts),
 (SELECT Name,StageName,Amount,CloseDate FROM Opportunities),
 (SELECT CaseNumber,ContactId,Subject,Priority,Status FROM Cases)
FROM Account
WHERE Name = 'Burlington Textiles Corp of America'

Adn this gives me everythign I ask for with no complaints, and I can also get any of the contact fields that are actually transcribed to the  Case record (Email, Phone, Fax, etc.).

What breaks, is when I try to get something form the Case Contact by reference like:

SELECT Id, Name,
 (SELECT FirstName, LastName, Title, Email, Phone FROM Contacts),
 (SELECT Name,StageName,Amount,CloseDate FROM Opportunities),
 (SELECT CaseNumber,ContactId,Contact.FirstName, Contact.LastName, Subject,Priority,Status FROM Cases)
FROM Account
WHERE Name = 'Burlington Textiles Corp of America'

Which basiclaly gets me everything I want, but it also gives me some extraneous information abotu how it GOT the first and last name of the contact.

"Contact":{"attributes":{"type":"Contact","url":"/services/data/v48.0/sobjects/Contact/0031U00001G0UCdQAN"},"FirstName":"Perry","LastName":"Noya"}

If I attempt to embed a second query for Contact within the subquery for Case, it just throws an error saying it doesn't understande the relationship, and am I missing the __r? (No.)

It may be that I just live with the additional text and clean it up in Apex, but I'm tryign to determine if I'm just missing something simple first.
I created a VF page, and when I "edit page" and drage the VF component to the page, I select the page name from the "Visualforce Page Name" drop down, yet when I click save, I get a pop up with this error: "Component 'Visualforce' has an invalid value for property 'Visualforce Page Name'." What would the problem be? The page is enabled for lightning, so I don't know what else could be causing this error?
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
hi,
when i am trying to deploy a am having 
Error parsing file: LWC Metadata Xml Parser: ParseError at [row,col]:[2,26]
Message: Element type "LightningComponentBundle" must be followed by either attribute specifications, ">" or "/>".LightningComponentBundle error inn my XML file.


im attaching my xml
User-added image

when if removing <targets> tag ...then the component is getting deployed.

did anybody face this issue?
pls help..
A. To guarantee at least 50% of code is covered by unit tests before it is deployed
B. To ensure every usecase of the application is covered by a test
C. To confirm every trigger is executed at leat once.
D. To confirm all classes and triggers compile successfully
A.String qryName = ‘%’ + String.escapeSingleQuotes(name) + ‘%’;
String qryString = ‘SELECT ID FROM contact WHERE name LIKE \ ' % ' + qryName + ' % \ ' ';
List<contact> queryResult =Database.query(queryString);


B. String qryName = ‘%’ + name + ‘%’;
String qryString = ‘SELECT ID FROM contact WHERE name LIKE :qryName' ;
List<contact> queryResult =Database.query(queryString);

C. String qryString = ‘SELECT ID FROM contact WHERE name LIKE \ ‘%’ + name + ‘%\ ’ ’;
List<contact> queryResult =Database.query(queryString);

D. String qryName = ‘%’ + String.enforceSecurityChecks(name) + ‘%’;
String qryString = ‘SELECT ID FROM contact WHERE name LIKE :qryName;
A. Call “Opportunity.StageName.Label”.
B. Call “Opportunity. StageName.getDescribe().getLabel()”.
C. Call “opp.StageName.getDescribe().getLabel()”.
D. Call “opp.StageName.Label”.
I have a Lightning Datatable with a URL field whose target value has been a forward slash concatenated with a case object ID (so it resolved to https://mydomain.lightning.force.com/objectId).  Prior to Summer '19, this produced the intended result: the link opened a new tab in the Lightning service console.  As of this week, though, it's opening in a new browser tab instead (so effectively a target="_blank").  I have two questions:
  1. Does anyone know if this change was documented anywhere?
  2. Is there anything I can do with the typeAttributes that will produce the same result that calling workspaceAPI.openTab() does (regardless of focus)?
Current column definition (wrapped for ease of reading) in the Controller:
 
{label: "Case Number",
    fieldName: "Anchor",
    type: "url",
    typeAttributes: {
        label:{
            fieldName: "CaseNumber"
        }
    },
    sortable: true},
Thanks for any help!
Mark

#Summer19
I have built a new App for end users to use to access HD services. I am building a new component to house large buttons that will launch flows that in turn will create new cases.

So far, so good.

When I click the buttons, the flow opens in a new tab. The user completes the steps and a case is created.

Again, all good.

I do not like the user experience with the new tab though. When they click the Finish button at the end, it just takes them back to the opening screen element and does not close the tab.

What I am looking for is an experience that is more like what i get when I launch a flow from say a contact record as a quick action. That opens the flow in a some sort of sub process like this:
User-added image

User-added image

User-added image
And the sub process then closes when the user clicks the Finish button.

Is there a way to accomplish this same effect from within this new component I have built? some HTML or other that will open the flow in this same sort of process? The best I have managed so far is the separate tab and that is just not doing it for me.

Any suggestions?
Best regards,
Steve
Hi Guys

I am trying to iterate through the images in a zip file which is stored as static resource in my org. Also I want to display these images in a scrolable tile/box in lightning component. Finally I want a way in which the end user can choose amoung these images by (Shift-Click).

Thanks
Hi guys,

I'm having issues calling an url from salesforce. 
Here is th code.
private final String clientId = 'xxxxxxxxx';
private final String clientSecret = 'xxxxxx';
String reqbody = 'grant_type=password&client_id='+clientId+'&client_secret='+clientSecret;
Http http = new Http();
HttpRequest request = new HttpRequest();
request.setBody(reqbody);
request.setMethod('GET');
request.setEndpoint('http://xxxx/api/xx-xxx-xxxxxxx-api/v1.0/getEmplId?firstName=xxx&lastName=xxx&middleName=xx');
HttpResponse response = http.send(request);
if (response.getStatusCode() != 201) {
  System.debug('The status code returned was not expected: ' +
       response.getStatusCode() + ' ' + response.getStatus());
} else {
   System.debug(response.getBody());
}
I'm getting the following message - response|"System.HttpResponse[Status=Service Unavailable, StatusCode=503]".
I've added the site url in salesforce. 

Please let me what I'm doing wrong?!

Appreciate your help!

Thanks,
NSK
 
I have a flow which calls apex action to do a callout.
I am using Workbench to call this flow to test it.
I am getting the below error message:
Your query request was running for too long.
errorCode: QUERY_TIMEOUT

I don't have any SOQL inside my Flow. If I remove the callout code, the flow is working. But, if I do callout from the Apex inside @InvocableMethod method, it is failing.

Is there any limit to avoid callout from @InvocableMethod annotation?
Is it possible to show the marker in Green color instead of red color in lightning:map tag?
How to set the Popup width while using LookupHoverDetail.getHover(). If anyone has sample code, it will be very useful.
I am looking for good materials and sample questions for Service cloud exam.
String accessToken = Auth.AuthToken.getAccessToken(authProviderId, 'Open ID connect');
        system.debug('Access Token is ' + accessToken);

here authProviderId has my Auth. Provider id.

It is returning null value.

I would like to write a trigger, when the user logins in and logs out.

 

-

Magulan

http://www.infallibletechie.com

 how to get Application name using Apex?

 

Regards,

Magulan D

How to view Answers in Site without logging in?

 

Regards,

Magulan D

How many records can be exported using export details in reports?

 

--

Magulan D

How many records can be exported using Export Details button in reports?

I want to post from VF page to Facebook.

 

Can anyone help?

 

Regards,

Magulan D

I created  component which shows product data. I need productId on selection of checkbox.Please refer Image
User-added imageAny one give me a hint.
Thanks
Hi,

In the past, I've designed a custom Visualforce Page as the default login page of my Digital Experience.

To do so, I developed my VFP and associated it to a controller.
Then, in All Sites > my Digital Experience > Workspace > Administration > Login & Registration > Login Page Type, I choosed the Visualforce Page option, then picked up my VFP file.

Now, I'd like to use a LWC for my custom login page.

How can I achieve this?
The first issue I'm facing is that in the Login Page Type select box, I can't see any "LWC" option whatsoever.

Thank you

Hello. Im trying to pass a list of SObject an apex action in Einstein Bot. But it doesnt work. It gives an error, saying that the class is missing the required input, which, of course, its not true.
 
This is the error message:
"Error when invoking /support/conversations/0X90E0000004CsX/invocations/0SC0E0000004NZEWA2: [{"actionName":"APIT88_KnowledgePrint","errors":[{"statusCode":"REQUIRED_FIELD_MISSING","message":"Missing required input parameter: inputKnowledge","fields":[]}],"isSuccess":false,"outputValues":null}]"

Action in Einstein Bot

User-added image

 

Code in Apex

public with sharing class RecebendoAgencias {
    public class AgenciaBot {
        @InvocableVariable(required = true)
        public List<Agencia__c> agencia;
    }
    
    @InvocableMethod(label = 'imprime agencias')
    public static void imprimeAgencias(List<AgenciaBot> agencias){
 		System.debug('Aff..');
    }

}

It's a basic code where I don't do much, but the error already happens. Can anybody help me?
Hello,

I have two chat buttons on two different site that connect to the same SF org. When the agents are online the name of the button is saved in the chat transcript so that they can see which site the chat is coming from.

When the agents are offline the chat transcript is not created and the name of the button is not saved anywhere. So when they review the case there's not way to know which site the request is coming from.

Is there any way to save the chat button name or something similar to let the agents know which site the case has been created on?

Hi,

I am using /services/data/v55.0/sobjects/LiveChatTranscript/{ID} api to fetch chat transcript data. From the response i am receiving valid CaseId field.

When trying to fetch Case Object using /services/data/v55.0/sobjects/Case/{ID}, passing CaseId received from above response. I returned 404 code with

[
    {
        "errorCode": "NOT_FOUND",
        "message": "The requested resource does not exist"
    }
]

 

Can someone help me on that.

 

Also, when fetching updated Case ids list for 20 days, i am receiving empty list. using the api salesforce doc (https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_get_updated.htm)

/services/data/v55.0/sobjects/Case/updated/?start=2022-06-01T00%3A00%3A00%2B0000&end=2022-06-21T00%3A00%3A00%2B0000

{
    "ids": [],
    "latestDateCovered": "2022-06-21T00:00:00.000+0000"
}
Hi Team
can any help me to create this batch class
How to write batch apex when Order__c object Amount__c field get change from 100 to 200 then Opportunity Amount Field should get update to 200.
On Order__c object there is formula field External_Id__c filed and on Opportunity there is Text field External_Id__c.
so can any one help me to create batch apex class.
public with sharing class Contact {
@AuraEnabled
    public static list<Contact> contactlist(){
        List<Contact> con = new List<Contact>();
            con = [Select Id, Lastname from Contact limit 5];
        system.debug(con);
        return con;
    }
}
Hi guys, long time listener first time caller

I am trying to create an LWC that updates account records from the opportunity page. I was wondering how would I retrieve and then update account fields. Would this require calling apex classes to update the record? I cant seem to find any examples of using LDS to edit fields of a related record. 

Many thanks 
Hello,
 
I have a Custom Object with 4 fields and 1 Date Field. If I try to create a new record with same values I need to check the old records and if the record persists then need to update the old Record with new Date . This is the code I have tried but the issue is it's updating old record as well as creating new record with same values which cause duplicates.I have written this in before Insert. please help.
 
public class duplicateHandler {
 
   public static void triggertocheckDuplicateBeforeInsert(list(List<CustObject> custList){
 Set <String> agencySet = new Set<String>();
Set <String> agencyTypeSet = new Set<String>();
Set <String> advetiserSet = new Set<String>();
Set <String> platformSet = new Set<String>();
Set <Date> startDateSet = new Set<Date>();
 
List<CustObject> oldList = new List<CustObject>();
 
        for (CustObject custMap : custList){
             agencySet.add(custMap.Agency__c);
             agencyTypeSet.add(custMap.Agency_Type__c);
             advetiserSet.add(custMap.Advertiser__c);
             platformSet.add(custMap.Platform__c);
        }
 
        List<CustObject> oldcustList = [SELECT Agency__c,Agency_Type__c,Advertiser__c,Platform__c,Start_Date__c FROM CustObject WHERE Agency__c IN :agencySet AND Agency_Type__c IN :agencyTypeSet AND Advertiser__c IN :advetiserSet AND Platform__c IN :platformSet];
for (CustObject custMap : custList){
  for( CustObject oldCust : oldcustList){
    if(oldcustList.size() > 0){
       if (custMap.Start_Date__c != oldCust.Start_Date__c) {
          oldcustList.Start_Date__c = custMap.Start_Date__c;
oldList.add(oldCust);
}
}
}
update oldList;
}
}
Hi. I have this trigger:
trigger preventAccountCreateOrUpdate on Account (before insert, before update) {
            for (Account a : Trigger.new) {
            if (a.type=='Prospect') {
              a.addError('You can not create or update this record.');
            }
          }
        }
How can I change the code to handler trigger that I have Account Trigger Handler Class and Account Trigger?
 
My lightning component all the picklist values from the related object 

User-added imageUser-added image

Aura Component
<div class="four wide column">
                        <label for="category-dropdown"><b>Select Category</b></label>
                        <select id="category-dropdown" label="Category" class="ui small fluid selection dropdown">
                            <option value="{!v.defaultCategory}">--None--</option>
                            <aura:iteration items="{!v.categoryOptions}" var="category">
                                <option value="{!category}">{!category}</option>
                            </aura:iteration>
                        </select>
                    </div>


Aura Hepler
({
    enableCategoryValues: function(component){
        
        let action = component.get('c.getCategoryValues');
        action.setParams({
          'recordId': component.get('v.recordId')
        });
        
        action.setCallback(this, function(response){
            
            let state = response.getState();
            
            if(state === 'SUCCESS') {
                
                component.set('v.categoryOptions', response.getReturnValue());
                component.set('v.catgoryFilterEnabled', true);
                
            }else{
                console.error(JSON.stringify(response.getError()))
            }
            
        })
        $A.enqueueAction(action)
    },
   })


Aura Controller
   
@AuraEnabled
    public static List<String> getCategoryValues(String recordId) {
        
        List<String> catregories = new List<String>();
        
        Schema.DescribeFieldResult fieldResult = SVMXC__Service_Order__c.Category__c.getDescribe();
        List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues();
        for( Schema.PicklistEntry pickListVal : ple){
            catregories.add(pickListVal.getValue());
        }     
        //catregories.sort();
        system.debug('catregories : '+catregories);
        
        List<String> hasValueCategory = new List<string>();
        
        Set<String> categorySet = new Set<String>();
        
        List<sharinpix__SharinPixImage__c> sharinPixImageList = [select
                                                                 Id,
                                                                 sharinpix__AlbumID__c,
                                                                 sharinpix__ImagePublicId__c,
                                                                 Landscape_Portrait__c,
                                                                 sharinpix__FileName__c,
                                                                 sharinpix__ImageURLOriginal__c,
                                                                 Image_Thumbnail_F__c,
                                                                 sharinpix__ImageURLFull__c ,
                                                                 CreatedDate,
                                                                 sharinpix__Tags__c,
                                                                 Work_Order__c,
                                                                 Work_Order__r.IP_Templates_Type__c,
                                                                 Work_Order__r.SVMXC__Component__c,
                                                                 Work_Order__r.Name,
                                                                 Work_Order__r.Start_Date_Time__c,
                                                                 sharinpix__Width__c,
                                                                 sharinpix__Height__c,sharinpix__Title__c,
                                                                 Image_Name__c,
                                                                 Work_Order__r.Category__c
                                                                 from
                                                                 sharinpix__SharinPixImage__c
                                                                 where
                                                                 sharinpix__AlbumID__c != null 
                                                                 AND
                                                                 (NOT sharinpix__Tags__c LIKE '%After%')
                                                                 AND
                                                                 (NOT sharinpix__Tags__c LIKE '%Before%')
                                                                  AND
                                                                 (NOT sharinpix__Tags__c LIKE '%Time-Hrs%')
                                                                
                                                                 AND
                                                                 Work_Order__r.SVMXC__Component__c =: recordId 
                                                                 AND Work_Order__r.Category__c =: catregories 
                                                                 ORDER BY Work_Order__r.Start_Date_Time__c, sharinpix__FileName__c, sharinpix__SortPosition__c];
        
        if(sharinPixImageList != null){
           
            for(sharinpix__SharinPixImage__c pix : sharinPixImageList){
                if(pix.Work_Order__r.Category__c != null){
                    categorySet.add(pix.Work_Order__r.Category__c);
                }
            }
            
        }
        
        hasValueCategory.addAll(categorySet);
        
        return hasValueCategory;        
    }

please check and help me with the issue

thanks in advance 
Himanshu
I need the following to be in rows and not columns
<apex:page standardcontroller="Account">
<apex:pageBlock >
<apex:pageBlockSection title="Handoff">
<apex:pageBlockTable value="{!Account.Handoffs__r}" var="h"> <apex:Column value="{!h.Name}"/>
<apex:column value="{!h.Account__c}"/>
<apex:column value="{!h.Opportunity__c}"/>
<apex:column value="{!h.Point_of_Contact__c}"/>
<apex:column value="{!h.Training__c}"/>
<apex:column value="{!h.Training_Notes__c}"/>
<apex:column value="{!h.Data_Migration__c}"/>
<apex:column value="{!h.Data_Migration_Notes__c}"/>
<apex:column value="{!h.Integration__c}"/>
<apex:column value="{!h.Integration_Notes__c}"/> </apex:pageBlockTable>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:page>
Hey All, 
 
I am currently building out a LWC PreChat form for our business.  Everything is working except when I iterate through the fields, they all show as text input which is ok for 99% of it, but we have one that is a picklist.
 
I am utilizing the lightningsnapin-base-prechat and following the sample from the Component Reference here: https://developer.salesforce.com/docs/component-library/bundle/lightningsnapin-base-prechat/documentation
 
However, our issue is that during the rendering of the component, it shows all as text inputs, as that is what is set via the for:each iteration loop. 
 
What my question is, is there a way to capture the drop down as a combobox in the iteration?  I have been trying everthing I know, from even rebuilding the form to not be filled via iteration and to maually build all the input fields, however, that doesnt reneder correctly so probably not the best idea. :)
 
Just wondering if anyone else had played around with this or has any ideas on how to make it work. 
 
Thanks in advance.
HI, 
Trying to print attachments -  PDF and Image. I created the LWC component. I developed a Lightning data table to get a LIST of attachments related to the case and gave handle row action added PRINT button It is working if I have one page and It is not working when it has more than one page. If I have more than one page still it will be printing only one page!! How to get all pages to Print.
User-added imageUser-added image
I am creating new picklist field in Account object which has two values : 'Active' and 'Inactive'. If I will create new record then I can assign value for this picklist field easily but what about already existing records? How can I assign ' Active' value to this picklist field for all already existing records of Account object?
Lightning recordEditForm will not render anything if the logged in user has only read permission based on data-level security.

I have a custom object that is a child of Opportunity so its data-level security is controlled by its parent (Opportunity) sharing settings.

All of my user Profiles have Object-level permissions set to Read/Write on the child object and I rely on data-level security (sharing settings) to determine which users can read and which can write the child object.
I created a custom Aura component for this object with a lightning:recordEditForm component and a lightning:inputField.

I would expect the recordEditForm to render for all users but only allow the users with read/write permssion to save changes. In fact, the inputField will not render at all for the read-only user. The Save button will render but not the input field.

The recordEditForm form works fine for the read/write user.
If I replace the entire lightning:recordEditForm with a lightning:recordViewForm the read-only user can see the data but now the read/write users cannot edit it.
I was expecting that I could use the same recordEditForm for all users and allow data-level security settings to control who can make changes.

The standard record detail page works correctly: all of the fields are visible to both users but only the users with read/write permission can save changes. So I know that the sharing settings are working as expected. I would like the lightning:recordEditForm to behave the same as the record detail page.

Has anybody encountered this problem before? Your help is much appreciated.
Hello All,

I have a created a new QucikAction button and invoking LWC component which is performing some DML'S like Insert,update and delete.
 Quick Action button is available on all the child records and parent, the button should be only available for parent but as record type is same for both parent and child records i can't use different page layouts to hide the Quick action for child.
ex : Account A has child Account records 1,2,3 ect.
Account has lookup to another custom object , in my scenario Account A related  parent record type(Custom object) is not same  as child Account related parent.
So on click of Quick Action on child Account record,I need to verify the record type of parent and display error message(toast message) saying this record is not valid to perform DML's.

May I get any help! 

Thank you All.
Hello, I have an apex class that should be automatically scheduled to be executed at the last day of the month. Could you tell me how to edit my Apex class code to add the scheduler code? I really do not understand how to combine these 2 codes. My Apex class:
 
public class GeneratePDF{
   
@InvocableMethod(Label = 'PDF genreation' description='')
public static void generatePDF(List<Id> AccountId) {

     PageReference page = Page.MonthlyReport;

    
     page.getParameters().put('Id', AccountId.get(0));
     Blob contentBlob = page.getContentAsPDF();
     
    ContentVersion cv = new ContentVersion();
    cv.VersionData = contentBlob;
    cv.Title = 'MonthlyReport Pdf';
    cv.PathOnClient = 'MonthlyReport.pdf' ;
    insert cv;                
    cv = [SELECT Id, ContentDocumentId FROM ContentVersion WHERE Id = :cv.Id LIMIT 1];
        
    ContentDocumentLink cdl = new ContentDocumentLink();
    cdl.ContentDocumentId = cv.ContentDocumentId;
    cdl.ShareType = 'I';
    cdl.LinkedEntityId = AccountId.get(0);
    insert cdl;
    }
}

 
What is the best way integration between two clouds, Here the requirement is integrate from salesforce cloud to amazon cloud..
  • April 22, 2014
  • Like
  • 1