• Princes91221
  • NEWBIE
  • 44 Points
  • Member since 2020


  • Chatter
    Feed
  • 1
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 11
    Questions
  • 7
    Replies
Was wondering if anyone could advise on the best methodology to import Salesforce reports into SharePoint or OneDrive, so that multiple people can collaborate on the same report.
Currently we're not using a connector to SharePoint, and are looking to move away from this due to potential security risks.
Any advice or recommendations will be greatly appreciated, and thank you in advance!
Hi Everyone,

I have created a multi select lookup component in Account object.
Selected multi select lookup values
Below I am pasting the code.
public class reUsableMultiSelectLookupCtrl {
    @AuraEnabled(cacheable=true)
    public static List<sObject> retriveSearchData(String ObjectName, String fieldName, String value, List<String> selectedRecId) {
        List<sObject> sObjectResultList = new List<sObject>();
        if(selectedRecId == null)
            selectedRecId = new List<String>();

        if(String.isNotEmpty(value)) {
            String query = 'Select '+fieldName+' FROM '+ObjectName+' WHERE Name LIKE \'%' + value.trim() + '%\' and ID NOT IN: selectedRecId order by createdDate DESC LIMIT 5';
            for(sObject so : Database.Query(query)) {
                sObjectResultList.add(so);
            }
        }
        return sObjectResultList;
    }
}

I want to save the select lookup in lead object under a custom field.

Any help is appreciated.

Thanks in advance!
Hello guys,

I am unable to extract values/data using data loader CLI.
I was able to extract data from sandbox but unable to extract from production.
I have generated encrypted password but it is still throwing error like,
`Error while calling web service operation: login, error was:com.sforce.soap.partner.fault.LoginFault: null.`
This is my process-conf.xml
 
<beans>
    <bean id="extractCandidate"
        class="com.salesforce.dataloader.process.ProcessRunner"
        scope="prototype">
        <description>Extract candidate__c from Salesforce Sandbox using Data Loader CLI.</description>
        <property name="name" value="extractCandidate"/>
        <property name="configOverrideMap">
            <map>
                <entry key="sfdc.debugMessages" value="true"/>
                <entry key="sfdc.debugMessagesFile" 
                    value="C:\Users\PrinceSharma\Desktop\DataLoaderPractice\DataExtractThroughCLI\output\candidateExtractSoapTrace.log"/>
                <entry key="sfdc.endpoint" value="https://login.salesforce.com"/>
                <!-- <entry key="sfdc.Server host" value="https://www.salesforce.com"/> -->
                <entry key="sfdc.username" value="user@email.com"/>
                <!--Password below has been encrypted using key file, 
                    therefore, it will not work without the key setting: 
                    process.encryptionKeyFile.
                    The password is not a valid encrypted value, 
                    please generate the real value using the encrypt.bat utility -->
                <entry key="sfdc.password" value="encrytedPassword****"/>
                <entry key="process.encryptionKeyFile" 
                    value="C:\Users\PrinceSharma\.dataloader\dataLoader.key"/>
                <entry key="sfdc.timeoutSecs" value="600"/>
                <entry key="sfdc.useBulkApi" value="true"/>
                <entry key="sfdc.loadBatchSize" value="200"/>
                <entry key="sfdc.extractionRequestSize" value="50"/>
                <entry key="sfdc.entity" value="Candidate__c"/>
                <entry key="sfdc.extractionSOQL" value="SELECT Account_Name__c,EmpStatus_Active_Inactive__c,STARTDATE__c,Tentative_End_Date__c,End_Date_on_Project__c,Name,CANDIDATELASTNAME__c,CANDIDATEEMAIL__c,Phone__c,Account_Manager_Name__c,VMS__c,Touchpoint__c,Intelliswift_SDFEDF__c,PMurphy_SDFEDF__c,Visa_Type__c,SDF_Received_On__c,EDF_Received_On__c,Reason_Project_Ended__c FROM Candidate__c"/>
                <entry key="process.operation" value="extract"/>
                <entry key="dataAccess.name" value="C:\Users\PrinceSharma\Desktop\DataLoaderPractice\DataExtractThroughCLI\result\candidateExtract.csv"/>
                <entry key="dataAccess.type" value="csvWrite"/>
            </map>
        </property>
    </bean>
</beans>

Is anything wrong in this code.

Any help would be appreciated.

Thank you in advance!

I have installed Zulu v18.0.2.1, even have set the JAVA HOME.

User-added image

and also installed Data Loader v55

I open Data Loader, after few seconds command prompt flashes and disappears and nothing happens afterwards.

Any help would be appreciated.

Thanks in advance!

Hope you're doing well.
I want to print an error toast, the pop-up appearing but the message is not printing.
I researched and tried a lot about that but was unsuccessful.
Below is my JS controller.
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
handleTimesheet() {
    saveData({
        firstName :this.firstName,
        lastName :this.lastName,
        accountId :this.recordId
    })
    .then(result => {
        //Shows Success Toast Event
        const e = new ShowToastEvent({
            title: 'Success',
            message: result,
            variant: 'success',
            mode: 'dismissable',
        });
        this.dispatchEvent(e);
        // console.log('result: ' +result);
    })
    .catch(error => {
        //Shows Error Toast Event
        const e = new ShowToastEvent({
            title: 'Error Occured',
            message: error.body.message,
            // I TRIED THIS AND THE BELOW LINE AS WELL
            message: error.body.output.errors[0].message,
            // I GOT ERROR ON THIS LINE "Cannot read properties of undefined (reading 'errors')"
            variant: 'error',
            mode: 'dismissable',
        });
        this.dispatchEvent(e);
        console.log('Error: ', JSON.stringify(error));
    })
}

Any help would be appreciated.

Thanks and Regards,
Prince Sharma.
Hello all,

Hope you guys are safe and doing well.

I'm new to Salesforce Development and trying to iterate an array but enable to do it.

I want to display 7 input fields.

While opening the org I'm getting the following error
"Error during LWC component connect phase: [Cannot read properties of undefined (reading 'inputHours')]"

Here's my HTML Code
<div class="slds-form-element slds-var-p-around_small">
    <div class="slds-grid">
        <template if:true={projectHoursDatas}>
            <template for:each={projectHoursDatas} for:item="projectHoursData">
                <div class="slds-col slds-size_2-of-12" key={projectHoursData.id}>
                    <b>{ projectHoursData.projectName }</b>
                </div>
                <template for:each={projectsHoursData.inputHours} for:item="inputHourValue">
                    <div class="slds-col slds-size_1-of-12 slds-text-align_center" key={inputHourValue}>
                        <!-- <input type="text" class="slds-input" key={inputHourValue} /> -->
                        <span>{inputHours}</span>
                    </div>
                </template>
                <div class="slds-col slds-size_1-of-12 slds-text-align_center" key={projectHoursData}>
                    <p>00.00</p>
                </div>
            </template>
        </template>
    </div>
</div>

and here's my JS Controller
import { LightningElement } from 'lwc';

export default class Time extends LightningElement {
    headers = [
        {
            day: 'Mo',
            date: '08 - 11'
        },
        {
            day: 'Tu',
            date: '09 - 11'
        },
        {
            day: 'We',
            date: '10 - 11'
        },
        {
            day: 'Th',
            date: '11 - 11'
        },
        {
            day: 'Fr',
            date: '12 - 11'
        },
        {
            day: 'Sa',
            date: '13 - 11'
        },
        {
            day: 'Su',
            date: '14 - 11'
        }
    ];

    projectHoursDatas = [
        {
            Id: 1,
            projectName: 'Manage Time',
            inputHours: [0, 0, 0, 0, 0, 0, 0]
        }
    ];

    enteredValues= [
        {
            Id: 1,
            hours: '00.00'
        },
        {
            Id: 2,
            hours: '00.00'
        },
        {
            Id: 3,
            hours: '00.00'
        },
        {
            Id: 4,
            hours: '00.00'
        },
        {
            Id: 5,
            hours: '00.00'
        },
        {
            Id: 6,
            hours: '00.00'
        },
        {
            Id: 7,
            hours: '00.00'
        }
    ];
}

 
Hello,

I'm trying to send mail using apex class.

While I'm executing via Execute Anonymous Apex with Editors Content it throws an error stating "Unexpected token 'body' on line #3".

Below I'm pasting my code.

List<String> address = new List<String> { 'prince.sharma930@gmail.com', 'rahuls91221@gmail.com' };
String subject = 'Topcoder Challenge Sample Mail';
String body = 'Hi, Hope you stay safe and healthy during the COVID-19.;
WelcomeEmailProcessor.sendMail(address, subject, body);

Kindly Help.
Thanks you!
Hello, 
Hope you guys are doing well in this tough situation.
I'm trying to send welcome email to customers.
I did setup in Classic Email Templates.

public with sharing class WelcomeEmailProcessor {
    // public WelcomeEmailProcessor() {
        
    // }
    public static void sendMail(List<String> address, String subject, String body) {
        EmailTemplate emailTemplate = [Select Id, Subject, Email Body FROM EmailTemplate where name = 'Dreamhouse welcomes e-mail'];
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
        mail.setToAddresses(address);
        mail.setSubject(subject);
        mail.setHtmlBody(body);
        Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
    }
}


I'm getting an error stasting only aggregate expressions use field aliasing on line number 6.
{
     "owner": "deploy-errors",
    "severity": 8,
    "message": "only aggregate expressions use field aliasing (6:39)",
    "source": "ApexClass",
    "startLineNumber": 6,
    "startColumn": 39,
    "endLineNumber": 6,
    "endColumn": 39
}

Thank you in advance! :-)
I am stuck on this challenge from past 2 days.
Kindly help.

Challenge Not yet complete... here's what's wrong:
The '# of Volunteers Still Needed' field on the 'Volunteer Shift' record is not working as expected.

I have attached a sreenshot of "# of Volunteers Still Needed" custom field.
User-added image
Thanks.
Regards Prince.
Kindly help.
I have attached an image below stating the error.

User-added image

Thanks!
Regards Prince.
I want to create a validation rule in case object.
User-added image

Kindly help.
Thanks in advance.
Regards, Prince Sharma
I want to create a validation rule in case object.
User-added image

Kindly help.
Thanks in advance.
Regards, Prince Sharma
Hi Everyone,

I have created a multi select lookup component in Account object.
Selected multi select lookup values
Below I am pasting the code.
public class reUsableMultiSelectLookupCtrl {
    @AuraEnabled(cacheable=true)
    public static List<sObject> retriveSearchData(String ObjectName, String fieldName, String value, List<String> selectedRecId) {
        List<sObject> sObjectResultList = new List<sObject>();
        if(selectedRecId == null)
            selectedRecId = new List<String>();

        if(String.isNotEmpty(value)) {
            String query = 'Select '+fieldName+' FROM '+ObjectName+' WHERE Name LIKE \'%' + value.trim() + '%\' and ID NOT IN: selectedRecId order by createdDate DESC LIMIT 5';
            for(sObject so : Database.Query(query)) {
                sObjectResultList.add(so);
            }
        }
        return sObjectResultList;
    }
}

I want to save the select lookup in lead object under a custom field.

Any help is appreciated.

Thanks in advance!

I have installed Zulu v18.0.2.1, even have set the JAVA HOME.

User-added image

and also installed Data Loader v55

I open Data Loader, after few seconds command prompt flashes and disappears and nothing happens afterwards.

Any help would be appreciated.

Thanks in advance!

Hope you're doing well.
I want to print an error toast, the pop-up appearing but the message is not printing.
I researched and tried a lot about that but was unsuccessful.
Below is my JS controller.
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
handleTimesheet() {
    saveData({
        firstName :this.firstName,
        lastName :this.lastName,
        accountId :this.recordId
    })
    .then(result => {
        //Shows Success Toast Event
        const e = new ShowToastEvent({
            title: 'Success',
            message: result,
            variant: 'success',
            mode: 'dismissable',
        });
        this.dispatchEvent(e);
        // console.log('result: ' +result);
    })
    .catch(error => {
        //Shows Error Toast Event
        const e = new ShowToastEvent({
            title: 'Error Occured',
            message: error.body.message,
            // I TRIED THIS AND THE BELOW LINE AS WELL
            message: error.body.output.errors[0].message,
            // I GOT ERROR ON THIS LINE "Cannot read properties of undefined (reading 'errors')"
            variant: 'error',
            mode: 'dismissable',
        });
        this.dispatchEvent(e);
        console.log('Error: ', JSON.stringify(error));
    })
}

Any help would be appreciated.

Thanks and Regards,
Prince Sharma.
Hello,

I'm trying to send mail using apex class.

While I'm executing via Execute Anonymous Apex with Editors Content it throws an error stating "Unexpected token 'body' on line #3".

Below I'm pasting my code.

List<String> address = new List<String> { 'prince.sharma930@gmail.com', 'rahuls91221@gmail.com' };
String subject = 'Topcoder Challenge Sample Mail';
String body = 'Hi, Hope you stay safe and healthy during the COVID-19.;
WelcomeEmailProcessor.sendMail(address, subject, body);

Kindly Help.
Thanks you!
Hello, 
Hope you guys are doing well in this tough situation.
I'm trying to send welcome email to customers.
I did setup in Classic Email Templates.

public with sharing class WelcomeEmailProcessor {
    // public WelcomeEmailProcessor() {
        
    // }
    public static void sendMail(List<String> address, String subject, String body) {
        EmailTemplate emailTemplate = [Select Id, Subject, Email Body FROM EmailTemplate where name = 'Dreamhouse welcomes e-mail'];
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
        mail.setToAddresses(address);
        mail.setSubject(subject);
        mail.setHtmlBody(body);
        Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
    }
}


I'm getting an error stasting only aggregate expressions use field aliasing on line number 6.
{
     "owner": "deploy-errors",
    "severity": 8,
    "message": "only aggregate expressions use field aliasing (6:39)",
    "source": "ApexClass",
    "startLineNumber": 6,
    "startColumn": 39,
    "endLineNumber": 6,
    "endColumn": 39
}

Thank you in advance! :-)
I am stuck on this challenge from past 2 days.
Kindly help.

Challenge Not yet complete... here's what's wrong:
The '# of Volunteers Still Needed' field on the 'Volunteer Shift' record is not working as expected.

I have attached a sreenshot of "# of Volunteers Still Needed" custom field.
User-added image
Thanks.
Regards Prince.
Hi All, I am having problem in resolving an error in the 'Customization Specialist superbadge' . The error message is 'The '# of Volunteers Still Needed' field on the 'Volunteer Shift' record is not working as expected'. I have tried all the options
i.e. IF( Desired_of_Volunteers__c - Shifts_Taken__c > 0, Desired_of_Volunteers__c - Shifts_Taken__c , 0) 

and Max(Desired_of_Volunteers__c - Shifts_Taken__c,0) also.
But no luck .So it's now no more fun!!  Kindly help me in solving this soon ...