• Ujwala
  • NEWBIE
  • 98 Points
  • Member since 2017

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 16
    Questions
  • 35
    Replies
Im new to salesforce
I need Test class for following Triggers to cover my code coverage

1.
trigger AccountCheckbox on Account (before update) {
if(trigger.isUpdate){
for(Account a : trigger.new){
if(a.Record_Updated__c == false){
a.Record_Updated__c = true;
}
}
}
}
--------------------------------------------------------------------------------------------
2.

trigger ClosedOpportunityTrigger on Opportunity (after insert,after update) {
List<task> sai = New List<task>();

  for(opportunity opp:trigger.new){
   if(opp.stagename=='closed won'){
    task t=new task(whatid=opp.id);
    
    t.Subject = 'Opportunity Task';
    t.type= 'Call' ;
    t.ActivityDate = system.today();     
    
    sai.add(t); 
    }
   }
     insert sai;
}

---------------------------------------------------------------------------------------
3.


trigger DuplicateTask on Task (before insert, before update) {
for(task t : trigger.new){
list<task> tas = [select subject from task where subject = : t.subject];
if (tas.size()>0){
t.adderror('Task Name already exits');
}
}
}

 
i have a requirement for,
whenever comment are added in case then update case_comment__c field on case object in such way that it's add to orignal value..
Hello all,


I have developed a LWC which opens a popup on button click and that popup opens OOTB survey form.
This is working fine on desktop and android salesforce 1 app but it is not working on iPad salesforce 1 app?

Anybody have any idea about it? or any settings I have to do?

Thank you

I am facing a issue all of sudden. I have two object Lead and Estimate. Estimate comes in related list of Lead. From Lead i can create new estimate. I created a LWC component which is used to create new Estimate records. LWC component i have embedded in aura component. I developed related LWC 3 months back, on click of new button aura component is getting loaded first which loads LWC. In Aura controller i have tried to fetch recordId(lead Id) which was appearing in url using below code


var pageRef = component.get("v.pageReference"); console.log(' PageREf'+JSON.stringify(pageRef)); var state = pageRef.state; // state holds any query params console.log('state = '+JSON.stringify(state)); var base64Context = state.inContextOfRef; console.log('base64Context = '+base64Context); if (base64Context.startsWith("1\.")) { base64Context = base64Context.substring(2); console.log('base64Context = '+base64Context); } var addressableContext = JSON.parse(window.atob(base64Context)); console.log('addressableContext = '+JSON.stringify(addressableContext)); component.set("v.recordId", addressableContext.attributes.recordId);

This code was giving me LeadId from url. But from 3/4 days i am getting error when aura component is loaded. I tried to debug issue i observed change in URL. Previously a different URL was opening on click of new button which was holding lead id but now a days a different URL is appearing hence aura is not able to get leadId from url. I dont have exact URL but it was roughly like https://.../lightning/o/VLSF_Estimate__c/new?inContextOfRef=1.eyJ0eXBlIjoic3RhbmRhcmRfX29iamVjdFBhZ2UiLCJhdHRyaWJ1dGVzIjp7Im9iamVjdEFwaU5hbWUiOiJWTFNGX0VzdGltYXRlX19jIiwiYWN0aW9uTmFtZSI6Imxpc3QifSwic3RhdGUiOnsiZmlsdGVyTmFtZSI6IlJlY2VudCJ9fQ%3D%3D&count=1%2FLead%2F00Q1g000005oxHBEAY%2Fview


But now when i click new url i am getting is https://.../lightning/o/VLSF_Estimate__c/new?count=1 Please help me to understand what can be the reason behind change in onload URl..
Hi all,

i have multiselect picklist and want to add drag drop event.. but it is not working.. 

this is part of my code...

<div class="slds-grid slds-gutters">
     <div class="slds-dueling-list" draggable="true" ondragstart="{!c.testDrag}">
    <div class="slds-form-element"  draggable="true" ondragstart="{!c.testDrag}">
        <label class="slds-form-element__label" for="select-01">Select Input</label>
            <select class="slds-select" id="select-01" multiple="true" draggable="true" ondragstart="{!c.testDrag}"  >
                <aura:iteration items="{!v.input}" var="inputname"  >
                <option draggable="true" ondragstart="{!c.testDrag}" >{!inputname.Name}</option>
                </aura:iteration>
            </select>
        
    </div>
    </div>


it is not catching drag event and hence not calling method?
is it like drag drop dont work for picklist?

Thanks
Hi all,

I am working on integration PRTG with salesforce. PRTG is locally installed (at http://127.0.0.1 ).
I used following endpoint


public String baseUrl = 'http://127.0.0.1/api/table.xml?content=sensors&columns=sensor&username=prtgadmin&passhash=xxxx'; /
         public String username = 'prtgadmin';  
         public String password = 'Pune@123'; 
         public void PRTGIntegration1(){   
          HttpRequest req = new HttpRequest();
          Http http = new Http();
         
        // req.setHeader('Accept', 'application/xml');
      //  req.setHeader('Content-Type','application/xml');
        Blob headerValue = Blob.valueOf(username+':'+password);
     // req.setHeader('Authorization','Basic '+ EncodingUtil.base64Encode(headerValue));
        req.setMethod('GET');
        req.setEndpoint(baseUrl);
        
    try{
            //Execute web service call here      
    HTTPResponse res = http.send(req);  
    String ResponseJsonString = res.getStatus();    
}

But i am getting status code as 403 forbidden after execution.

is there any problem with url i am mentioning because prtg is on LAN. So when i call endpoint from cloud do i have to mention ip address or something else i should take care of

Please help!!
  • December 19, 2018
  • Like
  • 0
Hi all,

i am working on requiremnt where many SOQL coming in picture. In one of function i am fetching data from custom object which hold record more than 50,000(another code has more soql also), then by iterating over fetched data i am preparing one list of strings which i will be using to display on VF. For this i am trying to write batch class i am doing fetch in Batch but i am not getting how to return list of strings as execute is of void type.
or can you suggest how i can achive this.  
  • October 24, 2018
  • Like
  • 0
Hi all,

I have one scenario where i want to add new value into picklist field on object everytime record created related to that object.
I tried updating field using process builder..  when we check restrict checkbx on picklist field it wont allow new value but if we dont check that checkbox new values are overwriiten to old values. but i want to update it with old and new values.

can we achieve this without using apex.?? 
 
  • September 11, 2018
  • Like
  • 0
Hi all,

How can i integrate jira and salesforce using REST API without any connectors or tools in between ?

On salesforce side we need to do remote site setings.What are the settings we need to do on JIRA side regarding salesforce.?
 
Hi all,
I am getting this error for following code. Where C__FKClient__c and Owner__c are user lookup. I want to set email field value to C__FKClient__c from Owner__c
                           

                                inc=new C__FKClient__c();
                                inc.C__FKClient__c = pendingresponse[i].wrap_input.Owner__c;
                                string clienEmail= pendingresponse[i].wrap_input.Owner__r.email;
                                system.debug(clienEmail); // prints email value properly...
                                if(clienEmail!=null){
                                inc.C__FKClient__r.email = clienEmail;  // getting error for this field
                                }

How to assign email value .. ??
 
Hi all,

I am looking for how we can integrate tally with salesforce. Is it really possibe to connect/integrate salesforce with tally. I implemented some rest where we need to mention url in remote site.. but in case of tally what we need to mention??  can anybody please provide me some information..
Hi,

in my VF i am insert record in account on click of button.. but after clicking save button it creates record in database but at this stage only when i refresh page(F5 .. using chrome) again record is inserted in database.. I think it is happening because of browser warning "The page that you're looking for used information that you entered. Returning to that page might cause any action you took to be repeated. Do you want to continue?" when click refresh..

can anybody please suggest way forward to this condition.. 
Hi all,

can we perform upsert operation on permissionsetassignment object ?
Hi i am digging into campaign object of sales cloud. 
I am not getting how fields like Leads in Campaign, Converted Leads in Campaign, Contacts in Campaign are calculated and auto populated on specific action

Please help on this!! Thanks!!
  • April 10, 2018
  • Like
  • 0
Hi

In salesforce when download attachments they are saved in downloads folder on local system. But i want to change that path and set folder other than downloads. I come to know that we can set download path in salesforce but not getting how to do that? 

Please help in this regards..
  • April 03, 2018
  • Like
  • 0
Hi all,

I configured sso in my org. it is working fine on desktop but giving problem with android and ios. when i enter my custom domain on salesforce1 page is redirecting on credential page of salesforce1 but instead it should show sso login page.

Please help ...
  • December 11, 2017
  • Like
  • 0
can i approve or reject record by replying to mail using an approval process where approver is a queue with no member ?
  • December 06, 2017
  • Like
  • 0
Hi all,  i  want to add "create new view" link in visualforce page. i used <apex:listview> but i want only create new view link. How to code this??
  • December 04, 2017
  • Like
  • 0

I am facing a issue all of sudden. I have two object Lead and Estimate. Estimate comes in related list of Lead. From Lead i can create new estimate. I created a LWC component which is used to create new Estimate records. LWC component i have embedded in aura component. I developed related LWC 3 months back, on click of new button aura component is getting loaded first which loads LWC. In Aura controller i have tried to fetch recordId(lead Id) which was appearing in url using below code


var pageRef = component.get("v.pageReference"); console.log(' PageREf'+JSON.stringify(pageRef)); var state = pageRef.state; // state holds any query params console.log('state = '+JSON.stringify(state)); var base64Context = state.inContextOfRef; console.log('base64Context = '+base64Context); if (base64Context.startsWith("1\.")) { base64Context = base64Context.substring(2); console.log('base64Context = '+base64Context); } var addressableContext = JSON.parse(window.atob(base64Context)); console.log('addressableContext = '+JSON.stringify(addressableContext)); component.set("v.recordId", addressableContext.attributes.recordId);

This code was giving me LeadId from url. But from 3/4 days i am getting error when aura component is loaded. I tried to debug issue i observed change in URL. Previously a different URL was opening on click of new button which was holding lead id but now a days a different URL is appearing hence aura is not able to get leadId from url. I dont have exact URL but it was roughly like https://.../lightning/o/VLSF_Estimate__c/new?inContextOfRef=1.eyJ0eXBlIjoic3RhbmRhcmRfX29iamVjdFBhZ2UiLCJhdHRyaWJ1dGVzIjp7Im9iamVjdEFwaU5hbWUiOiJWTFNGX0VzdGltYXRlX19jIiwiYWN0aW9uTmFtZSI6Imxpc3QifSwic3RhdGUiOnsiZmlsdGVyTmFtZSI6IlJlY2VudCJ9fQ%3D%3D&count=1%2FLead%2F00Q1g000005oxHBEAY%2Fview


But now when i click new url i am getting is https://.../lightning/o/VLSF_Estimate__c/new?count=1 Please help me to understand what can be the reason behind change in onload URl..
HI All,

Am trying to fetch Custom object related Approval process records information from processinstance step using soql workbecn.
Select Account__r.Name,Team_Member__r.Name ,Team_Member__r.ISActive,Team_Member_Email__c,Team_Role__c, Status__c,RHMS_Approval_Status__c, Approval_Status__c ,(SELECT ProcessInstance.TargetObjectId ,Comments FROM ProcessInstanceStep)from Account_Team__C
where ID='a4Qc0000000kBDt'

Am getting following error..

Didn't understand relationship 'ProcessInstanceStep' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.

Kindly let me know ..How to fetch alll those records using workbench..
Im new to salesforce
I need Test class for following Triggers to cover my code coverage

1.
trigger AccountCheckbox on Account (before update) {
if(trigger.isUpdate){
for(Account a : trigger.new){
if(a.Record_Updated__c == false){
a.Record_Updated__c = true;
}
}
}
}
--------------------------------------------------------------------------------------------
2.

trigger ClosedOpportunityTrigger on Opportunity (after insert,after update) {
List<task> sai = New List<task>();

  for(opportunity opp:trigger.new){
   if(opp.stagename=='closed won'){
    task t=new task(whatid=opp.id);
    
    t.Subject = 'Opportunity Task';
    t.type= 'Call' ;
    t.ActivityDate = system.today();     
    
    sai.add(t); 
    }
   }
     insert sai;
}

---------------------------------------------------------------------------------------
3.


trigger DuplicateTask on Task (before insert, before update) {
for(task t : trigger.new){
list<task> tas = [select subject from task where subject = : t.subject];
if (tas.size()>0){
t.adderror('Task Name already exits');
}
}
}

 

Hello Everyone,

I am calling an Apex function from helper but it is throwing the below error

This page has an error. You might just need to refresh it. Error in $A.getCallback() [Cannot read property 'set' of undefined] Callback failed: apex://ScheduleIn/ACTION$getTimeZones Failing descriptor: {c:ScheduleInEventDetails}
---.apxc---------------------
@AuraEnabled
    public static Map<String, String> getTimeZones(){
        return queryPicklistValues(User.TimeZoneSidKey.getDescribe());
    }        
    @AuraEnabled
    public static Map<String, Map<String, String>> getTimezonesAndlanguages(){
        Map <String, Map<String, String>> picklists = new Map <String, Map<String, String>>();
        picklists.put('languages', queryPicklistValues(Event.Language__c.getDescribe()));
        picklists.put('timezones', queryPicklistValues(User.TimeZoneSidKey.getDescribe()));
        return picklists;
    }
    public static  Map<String, String> queryPicklistValues(Schema.DescribeFieldResult fieldResult){
        Map<String, String> options = new Map<String, String>();
        //Schema.DescribeFieldResult fieldResult = Account.Industry.getDescribe();
        List<Schema.PicklistEntry> pList = fieldResult.getPicklistValues();
        for (Schema.PicklistEntry p: pList) {
            options.put(p.getValue(), p.getLabel());
        }
        return options;
    }
   
    @AuraEnabled
    public static List<DateTime> getWeeksAvailableTimeSlots(String lang, String reason, Decimal duration, DateTime dtime){
        //TimeZone tz = TimeZone.getTimeZone('America/Los_Angeles');
 -------Helper------
getTimeZoneDisplayName : function(cmp, timezoneName) {
        console.log('getTimeZoneDisplayName');
        var action = cmp.get("c.getTimeZoneDisplayName");
        action.setParams({timezoneName : timezoneName});
        
        action.setCallback(this, function(response) {
             if (response.getState() == "SUCCESS") {
                 cmp.set("v.timezoneDisplayName", response.getReturnValue()); 
                 
             }
        });
        $A.enqueueAction(action);
    },
-------Components---

<aura:component  controller="ScheduleIn">
    <aura:attribute name="bookedEventId" type="Id"  />
    <aura:attribute name="eventDetails" type="Event"  />
    <aura:attribute name="startTime" type="String"  />
    <aura:attribute name="endTime" type="String"  />
    <aura:attribute name="action" type="string" default="confirm" />
    <aura:attribute name="timezoneDisplayName" type="string" default="" />
    <aura:attribute name="timezoneValues" type="Map" default=""/>
    
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
    <aura:registerEvent name="stepChange" type="c:ScheduleInStepChange"/>
    
    <form method="post" id="bookingConfirmationForm">
        <center style=""><Label class="Confirmationheading"></Label></center>
        <aura:if isTrue="{!v.action=='confirm' || v.action==''}">
            <center id="descEventDetails">
                <!---<img src="{!$Resource.ScheduleInTickIcon}" class="TickIcon" />-->
                <p class="ScheduleIn_BookingConfirmation" style="">{!$Label.c.ScheduleIn_Booking_Confirmation}</p>
                <!--<h1 style="color: purple;margin-top: -17px;">A Global HR Service Associate will call you during your scheduled appointment time.</h1>-->
            </center><br/>
        </aura:if>
        <aura:if isTrue="{!v.action!='confirm' &amp;&amp; v.action!=''}">
            <center id="descEventDetails">
                    <br/><br/><h5 style="color: #aa0061;font-size: 22px; font-family: brandon grosteque;margin-top: 10px;">{!$Label.c.ScheduleIn_Reschedule}</h5><br/>
            </center><br/>
        </aura:if>
        <!--<h4 style="margin-left: 251px; color: #470a68;font-size: 22px;font-family: brandon grosteque;"> Reschedule, Cancel and New Appointment </h4>-->
        <table  border="0" cellpadding="10"  class="formtable-3" id="userPreferencetable" >
            <tr>
                <td class="heading"><label class="mobile-view-confirmationnum"></label>{!$Label.c.ScheduleIn_Confirmation}</td>
                <td class="mobile-view-number" >{!v.eventDetails.What.Name}</td>
            </tr>
            <tr>
                <td class="heading"><label class="mobile-view-reason">{!$Label.c.ScheduleIn_Reason}</label></td>
                <td class="mobile-view-appointmentreason">{!v.eventDetails.Reason__c}</td>
            </tr>
            <tr>
               <td class="DescriptionIssue slds-col slds-size_1-of-3"><label style="align:center">{!$Label.c.ScheduleIn_Description}</label></td>
                <td class="Descriptionforissue">{!v.eventDetails.Description}</td>
            </tr>
            <tr>
                <td class="heading"><label class="mobile-view-status">{!$Label.c.Schedueln_Status}</label></td>
                <td class="mobile-view-confirmed" style=" color: green; font-weight: bold;"></td>
            </tr>
            <tr>
                <td class="heading"><label class="mobile-view-when">{!$Label.c.ScheduleIn_When}</label></td>
                <td class="mobile-view-time">{!'' + v.startTime + '(' + v.timezoneDisplayName + ')'}</td>
            </tr>
Hi all,

i am working on requiremnt where many SOQL coming in picture. In one of function i am fetching data from custom object which hold record more than 50,000(another code has more soql also), then by iterating over fetched data i am preparing one list of strings which i will be using to display on VF. For this i am trying to write batch class i am doing fetch in Batch but i am not getting how to return list of strings as execute is of void type.
or can you suggest how i can achive this.  
  • October 24, 2018
  • Like
  • 0
Hi Experts
could you please help on below scenario on Approval process

scenario
I have 2 Queues ,,  Medical & Finance .  Each Queue contain 3 users.  i mean Total 6 users.
When i create Approval process , the notification goes to 2 Queues i.e 6 users.
Requirement is ::
Required approval from  any Medical user  AND any Finance User    ..AND THERE IS NO ORDER PROCESS.
ii) i alrady enabled Enable '''' email approval responseEnable email approval response''' But i dont see in mail  Approve/ Reject options.
   apart from enable to check box  can i do any additonal steps for getting mail approval process??
iii) i have external usres need to configure for this approval process ....is it support external users configuraiton for approval process ?

can you please help on this urgency..
Regards
sekhar






 
  • August 02, 2018
  • Like
  • 0
Hello,
I've a three level approval process. When I initially submit a record to level 1, level 1 approver checks the record and approves it to level 2, during the  level 2 approval process, assigned approver inputs details in the fields of assigned visualforce record which are required for level 3 approver. However, during the level 2 process, the assigned approver was only able to edit the record once. If he tries to edit the record again (before approving it to level 3), it says insufficient privilage. This issue is really getting on my nerves. I would really appreciate if any one can help me. I've given the necessary view/edit permissions, record editablity for all concerned approvers but I'm only able to edit/save the record once. It's the same issue with all the approvers. 
Hi all,

How can i integrate jira and salesforce using REST API without any connectors or tools in between ?

On salesforce side we need to do remote site setings.What are the settings we need to do on JIRA side regarding salesforce.?
 
Hi all,
I am getting this error for following code. Where C__FKClient__c and Owner__c are user lookup. I want to set email field value to C__FKClient__c from Owner__c
                           

                                inc=new C__FKClient__c();
                                inc.C__FKClient__c = pendingresponse[i].wrap_input.Owner__c;
                                string clienEmail= pendingresponse[i].wrap_input.Owner__r.email;
                                system.debug(clienEmail); // prints email value properly...
                                if(clienEmail!=null){
                                inc.C__FKClient__r.email = clienEmail;  // getting error for this field
                                }

How to assign email value .. ??
 
I am trying to get the email to send to the contact in the lookup field x3_Party_Installer.  I have the following code, but I am getting an error 'Illegal Assignment from List to String' on Line 10.  Am I doing this wrong?  Or is there another way?

Controller:
public class SendSiteSurveyEmailController {

    public String Site_Survey {get;set;}
    
    Public SendSiteSurveyEmailController(ApexPages.StandardController controller) {
        Site_Survey = ApexPages.currentPage().getParameters().get('Id');
    }
    
    Public Pagereference SendSiteSurveyFunction() {
        String toaddress = [SELECT X3rd_Party_Installer__c FROM Site_Survey__c LIMIT 1];
        try{
            Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
            String[] toAddresses = new String[] {toaddress};
                mail.setToAddresses(toAddresses);
            	mail.setReplyTo(toaddress);
            	mail.setSenderDisplayName('Name');
            	mail.setSubject('DarPro Site Survey');
            	mail.setBccSender(false);
            	mail.setUseSignature(true);
            	mail.setHtmlBody('<b> BODY </b>');
            
            List<Messaging.EmailFileAttachment> fileAttachments = new List<Messaging.Emailfileattachment>();
            for (Attachment a : [SELECT Name, Body, BodyLength FROM Attachment WHERE ParentId = :Site_Survey Order By LastModifiedDate DESC Limit 1]){
                Messaging.Emailfileattachment efa = new Messaging.Emailfileattachment();
                efa.setFileName(a.Name);
                efa.setBody(a.Body);
                fileAttachments.add(efa);
                //mail.setFileAttachments(new Messaging.SingleEmailMessage[] {efa});
            }
            mail.setFileAttachments(fileAttachments);
            
            Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
            
            Contact ct = [SELECT id FROM Contact WHERE Email = :toaddress LIMIT 1];
            
            Task newTask = new Task(Description = 'Site Survey Email',
                                   Priority = 'Normal',
                                   Status = 'Completed',
                                   Subject = 'Site Survey',
                                   Type = 'Email',
                                   WhoId = ct.Id);
        } catch(Exception e) {}
        
        PageReference reference = new PageReference('https://darlingingredients--griffsdbx.cs11.my.salesforce.com/'+Site_Survey);
        reference.setRedirect(true);
        return reference;
    }
}

VF Page: 
<apex:page standardController="Site_Survey__c" extensions="SendSiteSurveyEmailController">
<apex:form >
<script type="text/javascript">
function init() {
sendEmail();
}
if(window.addEventListener)
window.addEventListener('load',init,true)
else
window.attachEvent('onload',init)
</script>

<apex:actionFunction name="sendEmail" action="{!sendSiteSurveyFunction}">
</apex:actionFunction>
</apex:form>
</apex:page>

 
Hi i am digging into campaign object of sales cloud. 
I am not getting how fields like Leads in Campaign, Converted Leads in Campaign, Contacts in Campaign are calculated and auto populated on specific action

Please help on this!! Thanks!!
  • April 10, 2018
  • Like
  • 0