• Leo10
  • NEWBIE
  • 486 Points
  • Member since 2016
  • Mr
  • Beo software private limited


  • Chatter
    Feed
  • 14
    Best Answers
  • 1
    Likes Received
  • 2
    Likes Given
  • 14
    Questions
  • 146
    Replies
I am facing this error when I am refreshing my VF page. I know this is because SOQL query is written inside the for loops but I am struggling with removing the SOQL outside the for loop. 

Here is the method which is called when constructor runs when the page loads

Can anyone please help me in this case.

Thanks
Avesh Lakha​
public List<selectedProductClass> getSelectedProductClassString(){
       
       
        List<List<String>> lstProductsInCategory = new List<List<String>>();
        lstAllAccountProductClassString = new List<selectedProductClass>();
        
        Map <List<String>,String> mapProductCategory = new Map <List<String>,String>();
        Map <List<String>,String> mapShow = new Map <List<String>,String>();
        
        
       for(Account_Product__c accProducts : [SELECT Id,Account__c,Product_Category__c,Show__c,Products__c from Account_Product__c where Account__c =: this.iAccountId]){
                   
           for(String pd : accProducts.Products__c.split(';')) {
           selectedProductClass objClass = new selectedProductClass ();
                objClass.selectedShow = accProducts.Show__c ;
                objClass.selectedCategory = accProducts.Product_Category__c;
                objClass.selectProduct = pd;
                                                 
           Product__c[] prod  = [SELECT Id from Product__c where  Name =:pd AND Product_Category__c =: accProducts.Product_Category__c AND Show__c =:accProducts.Show__c limit 1];
              if (prod.size() > 0)
                objClass.ProductId = prod[0].Id;
                lstAllAccountProductClassString.add(objClass); 
            }
               lstProductsInCategory.add(accProducts.Products__c.split(';'));
               mapProductCategory.put(accProducts.Products__c.split(';'),accProducts.Product_Category__c);
               mapShow.put(accProducts.Products__c.split(';'),accProducts.Show__c);
        }
        

        return lstAllAccountProductClassString;
    }

 
Hi All,

Im a little stuck on an error i am recieving in this Trail. I have successfully set up and logged in with SSO based on the steps but i still get this error and i cant seem to see why?

Challenge Not yet complete... here's what's wrong:
Could not find SAML Enabled in your org's setup audit trail. Make sure that you have 'SAML Enabled' checked under 'Federated Single Sign-On Using SAML' in your org's 'Single Sign-On Settings'.
Hello,

I am looking for way to override the standard Recent account pages.
User-added image
Basically, I want to remove the New button, and keeping rest as it is.
I donot want to consume new tab

Thanks for suggestion
  • April 19, 2017
  • Like
  • 1
Hi All,

I have written below trigger.
trigger D2R_DFA_InventoryTrigger on DFA_Inventory__c (before insert, before update) {
    if(trigger.isBefore) {
        if(trigger.isInsert || trigger.isUpdate) {
              for(DFA_Inventory__c inv : trigger.new) {
                 if(inv.Add_Quantity__c != null) {
                    if(inv.Available_Quanity__c == null)
                        inv.Available_Quanity__c = 0;
                    inv.Available_Quanity__c = inv.Add_Quantity__c + inv.Available_Quanity__c;
                    inv.Add_Quantity__c = null;
                }
            }
        }
        
        if(trigger.isInsert) {
           Map<Id, List<DFA_Inventory__c>> mapInvByDFA_Id = new Map<Id, List<DFA_Inventory__c>>();
           for(DFA_Inventory__c inv : trigger.new) {
              mapInvByDFA_Id.put(inv.DFA__c, new List<DFA_Inventory__c>());
            }
            List<DFA_Inventory__c> lstExistingInvs = [SELECT Id, DFA__c, Product__c FROM DFA_Inventory__c
                                                      WHERE DFA__c=:mapInvByDFA_Id.keySet() ];
            
            for( DFA_Inventory__c inv : lstExistingInvs) {
                 if(!mapInvByDFA_Id.containsKey(inv.DFA__c)) {
                    mapInvByDFA_Id.put(inv.DFA__c, new List<DFA_Inventory__c>());
                }
                mapInvByDFA_Id.get(inv.DFA__c).add(inv);
            }
            
            for(DFA_Inventory__c inv : trigger.new) {
                if(mapInvByDFA_Id.containsKey(inv.DFA__c) && mapInvByDFA_Id.get(inv.DFA__c).size() > 0 ) {
                    for(DFA_Inventory__c existingInv : mapInvByDFA_Id.get(inv.DFA__c)) {
                        if(inv.Product__c == existingInv.Product__c) {
                         inv.Product__c.addError('Product already exists in DFA Inventory, Update existing Inventory.');
                        }
                    }
                }
            }
          }
    }
}
Below is the test class
@isTest
public class D2R_DFA_InventoryTriggerTest
{
    @testSetup
    static void Setup()
    {
    
         product2 prod = new product2();
        prod.Name = 'Test Product';
       insert prod;
        
        Id pricebookId = Test.getStandardPricebookId();

        
        PricebookEntry standardPrice = new PricebookEntry( Pricebook2Id = pricebookId,Product2Id = prod.Id, UnitPrice = 10000, IsActive = true );
        insert standardPrice;
        
        Pricebook2 customPB = new Pricebook2(Name='Custom Pricebook', isActive=true);
        insert customPB;
        
         Profile p = [SELECT Id FROM Profile WHERE Name='System Administrator'];
            
        User u2 = new User(Alias = 'standt1',Country='United Kingdom',Email='demo1@randomdemodomain.com',EmailEncodingKey='UTF-8', LastName='Testing', LanguageLocaleKey='en_US',LocaleSidKey='en_US',ProfileId = p.Id,TimeZoneSidKey='America/Los_Angeles', UserName='dprobertdemo1@camfed.org');
        insert u2;
        
        Account acc1 = new Account(Name='TEST ACCOUNT', RecordTypeId = '012N00000005B9J', Email__c = 'test@gmail.com',Phone = '898789993', ownerId = u2.Id ,Sales_Executive__c = u2.Id);
        insert acc1;  
        
        DFA_Inventory__c dfa = new DFA_Inventory__c(Add_Quantity__c=4,Available_Quanity__c=50,Product__c = prod.Id,DFA__c = acc1.Id );
        insert dfa;
        
    }
    
        @isTest
        static void InventoryTriggerMethod1()
        {
          DFA_Inventory__c df= [select id,Add_Quantity__c,Available_Quanity__c,Product__c ,DFA__c  from DFA_Inventory__c ];
        Product2 p = [select id,Name from Product2];
        }
        
         @isTest
        static void InventoryTriggerMethod2()
        {
         Product2 p = [select id,Name from Product2];
        DFA_Inventory__c df= [select id,Add_Quantity__c,Available_Quanity__c,Product__c ,DFA__c  from DFA_Inventory__c where Product__c = :p.Id];
        try
         {
             df.Product__c = p.Id;
          update df;
       
         }
         
         catch(DMLException e)
        {
                Boolean expectedExceptionThrown =  e.getMessage().contains('Product already exists in DFA Inventory, Update existing Inventory.') ? true : false;
System.AssertEquals(expectedExceptionThrown, true);
        
        }
        
        }
        }

I am getting only 69% code coverage for trigger. I am not able to cover the add error message in test class.could anyone help on this. 

Thanks in Advance.
 
Hello Folks, can someone plz explain the benefit of using <apex:dataList > .and some situation where we need to use  <apex:dataList >  ? 

Thanks in Advance ,
Tanoy 
Need to create a lead from the contact record, where Name, Title, Company, email, and Address information is copied over.  Can someone help create this button?  I'm not sure where to even start.
HI,

Please help me to write a test class for the below apex class method.

Thanks In Advance!
public void CallJsonmethod(){
        try{
            JSONGenerator gen = JSON.createGenerator(true);
            gen.writeStartObject();
            gen.writeStringField('Name', acc.Name);
            gen.writeBooleanField(’Stream__c', acc. Stream__c);
            gen.writeBooleanField(‘Q1', acc.Q1);
            gen.writeBooleanField(’Theatre__c', acc.Theatre__c);
            gen.writeBooleanField(‘MRR__C', acc.MRR__C);
            gen.writeBooleanField(‘CRR__c', acc.CRR__c);
            gen.writeBooleanField(‘Event__c', acc.Event__c);
            gen.writeEndObject();
            system.debug('***'+gen.getAsString());
            Http h = new Http();
            HttpRequest req = new HttpRequest();
            req.setEndpoint(endPoint);
            req.setMethod('POST');
            req.setHeader('x-api-key', xapiKey);
            req.setBody(gen.getAsString());
            HttpResponse res = new HttpResponse();
            res = h.send(req);
            system.debug(res.getBody());
            ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.CONFIRM, 'Account ' + acc.Name + ‘ changed please notify to your admin'));
        }catch(Exception ex){
            ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, ex.getMessage()));
        }

 
for (Task t: triggerNew) {
             If(t.callDisposition.contains('Disconnected')){
           t.type = 'Invalid Contact Information';
        } 
         if(t.callDisposition.contains('Busy')){
            t.type = 'No Answer';
         }
        }
Above is my code where i am trying to developer code where field callDisposition contains 'Disconnected' strings it should update the  type as 'Invalid Contact Information' But what's happening is it is only seeing if the field has exact value (case sensitive) . I want if that field contains  set of any string then IF statement should be true.
Please help me on this.
 
  • January 30, 2017
  • Like
  • 0
I am new to wave analytics ,
How to bind two datasets in a single dashboards
I am attempting to use a SOQL query to query a Grandparent Object (Account), Parent Object (Opportunity), Child Custom Object (EBR_Form__c) but continue to get the following error in the Developer Console's Query Editor: 
 
SELECT id, Name, Opportunity__r.Name, Opportunity__r.Account.Name FROM EBR_Form__c

SELECT id, Name, Opportunity__r.Name, Opportunity__r.Account.Name
                                 ^
ERROR at Row:1:Column:18
Didn't understand relationship 'Opportunity__r' in field path. 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.

User-added image

What am I missing. Your help would be appreciated greatly.
 
Hi all,
I have a requirement, need to route chats from live webchat to live agents based on website languages. How to accomplish this?.

Eg: English-> English speaking agent, Spanish-> Spanish speaking agent 

Thanks in advance,
Leo
 
  • June 09, 2020
  • Like
  • 0
Hi All,
Has anyone done skill-based routing on the live webchat with apex class and process builder?. I have a requirement on route live web chat based on region/country/state wise to the live agents.
See this link   (https://help.salesforce.com/articleView?id=omnichannel_skills_based_routing_route_chat_using_skills.htm&type=5)

Thanks in advance, 
Leo
  • June 01, 2020
  • Like
  • 0
Hi All,
How to transfer files from customers to the agent on the live web chat without the agent's request. Any workaround?
https://help.salesforce.com/articleView?id=live_agent_transfer_files.htm&type=5 (https://help.salesforce.com/articleView?id=live_agent_transfer_files.htm&type=5)

Thanks in advance,
Leo
  • May 14, 2020
  • Like
  • 0
Hi all,
I have a requirement in live web chat, I need both customer form and chat with an expert option in chatbox while the expert is in online. The customer has to choose one of the options either customer form or chat with the expert. I know we have an inbuilt pre-request form in live web chat before we start to chat with an expert. 

Thanks in advance.
  • April 27, 2020
  • Like
  • 0
Hi All,
I need to create a single connected app for both android and ios. How we can do this?
Thanks. 
  • August 05, 2019
  • Like
  • 0
Hi all. I have a field called Project_Status__c which is a picklist field and have some values. I am using field tracker in it and getting OldValue and NewValue.  I need to get the count of months between OldValue and NewValue. Can anyone help?
 
  • March 14, 2019
  • Like
  • 0
Hi all,
I have integrated salesforce with other application through Rest API call and I am getting the base64 code as response. I want to convert this base64 code into a PDF format. can any one help?

Thanks,

 
  • September 13, 2017
  • Like
  • 0
Hello all
While rest API call, I am getting 504 Gateway Time-out error,  
can some one suggest What will be the problem? What needs to be done in order to make Outbound messaging up and active? 


Thanks, 
  • September 06, 2017
  • Like
  • 0
Hi all, 

I need to get some values from SLDS table while clicking on rows both single and multiple (Ctrl+mouse click) mouse clicks. How can I achieve this? 

Thanks,
  • August 16, 2017
  • Like
  • 0
Hi all
I want to use turf.js in salesforce lightning component. While  I am including turf.js in salesforce lightning component getting an error like "ReferenceError: jsts is not defined" but it is working fine in visual force page. Can any one tell how to include turf.js in lightning components
Thank you,
  • August 07, 2017
  • Like
  • 1
  • July 25, 2017
  • Like
  • 0
I have a requirement to use kendo grid in Salesforce. Has anyone used kendo grid in Salesforce? 
  • June 27, 2017
  • Like
  • 0
How to generate spatial data in salesforce by using x and y geocodes?
  • June 22, 2017
  • Like
  • 0
Hi,
Can anyone say how to migrate data from netsuite CRM to salesforce without any third party?
  • March 08, 2017
  • Like
  • 0
Hi all
I want to use turf.js in salesforce lightning component. While  I am including turf.js in salesforce lightning component getting an error like "ReferenceError: jsts is not defined" but it is working fine in visual force page. Can any one tell how to include turf.js in lightning components
Thank you,
  • August 07, 2017
  • Like
  • 1
Hi all,
I have a requirement, need to route chats from live webchat to live agents based on website languages. How to accomplish this?.

Eg: English-> English speaking agent, Spanish-> Spanish speaking agent 

Thanks in advance,
Leo
 
  • June 09, 2020
  • Like
  • 0
Hi, 
I have a list of list of map.
List<list<map<string,string>>> customer

How to the retrieve the values of the map in Apex?
Thanks in adv.

Rgds,
Vai
 
It is a requirement to provide the IPs from Salesforce so that the webservice calls made from Salesforce to PeopleSoft can be whitelisted by Integration Team. Otherwise the integration is not possible. As i said, we are based in Germany and  hence we would need the IP ranges for Germany.
I am doing syncronous callout when a quick action is called and it update a field in the record. And also a after insert tirgger that invokes queable apex which also makes a callout and update the record.After synchronous callout update the record successfully I have to refresh the record page 2 or 3 times to see the update value. How to speed up this refresh process.
  • September 25, 2019
  • Like
  • 0
List<Case> localemailaddress = new List<Case>([SELECT ID,AV_Local_Affiliate_Inbox__c FROM Case Where Id IN : newCaseMap.keySet()]);
if(localemailaddress.size()>0 && localemailaddress!=null&&localemailaddress.get(0).AV_Local_Affiliate_Inbox__c!=null){
String affiliateemail=String.valueOf(localemailaddress.get(0).AV_Local_Affiliate_Inbox__c);

Please let me know it is very urgent.

Hi

I was trying to get the patch version and i have seen the salesforce doc for this purpose but it seems no matter what i do it will just return null instad of the patch version has anyone experience the similar problem or if anyone knows about this behaviour can they help me out please.

Thanks 

Whenever a live agent receives a message from the visitor there should be be a desktop notification to be fired.
  • March 19, 2019
  • Like
  • 0
When a record is sent from external system to Salesforce, via web service, the case record needs to route to a specific agent population only within business hours (i.e. 7am to 10pm), and within federally mandated outbound calling time frame (i.e. 9am to 9pm) and within the given time zone of where the customer lives (i.e. 9am to 9pm local time zone of target customer location - eastern, central, mountain and western time). Notice how the business hours are different than the federally mandated calling time regulated hours. 

This is the use case am trying to solve for existing project that has a short timeline. I am not sure how to handle this since Omni-Channel is not smart enough. I do not have Einstein and do not want to use that as part of the solution. The timeline will allow for anything in Winter '19 release (production) and apex coding, if necessary.  (see use case details below - the call center agent works in the eastern time zone)

1) Records are sent to Salesforce, from external system 24 hours daily (i.e. outside of business hours, inside business hours).
2) Agent signs into Salesforce at 7am Eastern time zone (agent population start time)
3) Eastern time zone, Central time zone, Mountain time zone, Western time zone records are being sent to Salesforce for agent routing
3.a) As an agent, it is 7am to 8:59pm and still not time to receive case records - federally mandated calling start time not reached. However, I may be asked to perform other case work - not part of this process.
3.b) As an agent, it is now 9am and I can begin receiving only case records for the Eastern time zone
3.c) As an agent, it is now 10am and I can begin receiving only cases records for both Eastern and Central time zones
3.d) As an agent, it is now 11am and I can begin receiving only case records for Eastern, Central and Mountain time zones.
3.e) As an agent, it is now 12pm and I can begin receiving only case records for Eastern, Central, Mountain and Western time zones.
3.f) As an agent, it is now xxpm and I can begin receiving only case records for ... this could continue beyond continental time zones for North America. Likewise, it could be for time zones East of the Eastern time zones. (i.e. it needs to be flexible)
3.g) As an agent, it is now 9pm and I cannot receive any cases because I have reached the federally mandated limit for outbound communications to customers.
3.h) As an agent, it is now 10pm and the call center is closed for the day.
4) Eastern time zone, Central time zone, Mountain time zone, Western time zone records are being sent to Salesforce for agent routing
4.a) Cases are still being sent to Salesforce from the external system and their are no agents available
5) Agent signs into Salesforce at 7am (agent population start time)
5.a) As an agent, it is 7am to 8:59pm and still not time to receive case records - federally mandated calling start time not reached. However, I may be asked to perform other case work - not part of this process.
5.b) As an agent, it is now 9am and I can begin receiving only case records for the Eastern time zone
..... everything repeats
Hello, 
I want to hid this buttons in my view section
User-added image
Can you help me
Hello,
How can I move my custom buttons to the bottom of the Lightning Action with my VF Page? In the screenshot below, I'd like to move the button "Send Now" to the bottom where Cancel and Save are found. And actually I'd like to replace Save with the Send Now.
When I click the Action button now below is what pops up:
User-added image
My VF Page looks like this:
<apex:page standardcontroller="Lead" lightningStylesheets="true" extensions="SaveAmend">
    <apex:form >
        
        <!--Other info here-->
        
        <apex:commandButton value="Send Now" action="{!Send}"/>
    </apex:form>  
</apex:page>
I tried putting the apex:commandbutton inside apex:pageblockbutton, but that didnt work either.
Thanks for your help!
Hi everyone-I have an interesting business case, so will try to keep this as concise as possible:

We have a business unit with 2 Opportunity record types, called Firm (parent opportunity) and Fund (child opportunity). I created a lookup relationship on the Opportunity object that also looks up to Opportunities. Opportunities of the Fund record type (child) are required to have a value in the lookup field that points to the parent opportunity (Firm).

Here is what I'm trying to solve for: we have a custom Currency field on the Firm record type called Total Contract Value. What I am trying to do is write a trigger that will calculate the sum of all Closed Won Fund opportunity amounts (children), plus the amount of the Firm opportunity (parent), assuming it is Closed Won as well. Would love some direction on what this trigger would look like. Thanks in advance!
Hi 
when select picklist value, based on selection , populate table results...but below code not working, can u pls check is there any wrong in below my code

VF page:
<apex:selectList value="{!statusOptions}" multiselect="false" size="1">
     <apex:selectOptions value="{!items}"/>
     <apex:actionSupport event="onselect" action="{!poplateResults}" reRender="messageBlock"/>
     </apex:selectList> 

 <apex:actionStatus id="status" startText="requesting..."/>
<apex:pageBlockSection title="Results" id="results" columns="1">
                    <apex:pageBlockTable value="{!results}" var="c"
                               rendered="{!NOT(ISNULL(results))}">
<apex:column value="{!c.Type}" />
                    <apex:column value="{!c.Subject}" />
                    <apex:column value="{!c.Priority}" />
                    <apex:column value="{!c.Status}" />
                    <apex:column value="{!c.CreatedDate}" />
                     <apex:column value="{!c.Owner.Name}" />    
                    <apex:column value="{!c.SLA_Flag__c}" />
   </apex:pageBlockTable>

Controller class ::
------------------------------
public List<SelectOption> getItems() {

        List<SelectOption> options = new List<SelectOption>();
        
        options.add(new SelectOption('Admin));
        options.add(new SelectOption('Dev'));
        options.add(new SelectOption('Suppp'));
        options.add(new SelectOption('Test));
       
        return options;
    }
 public void poplateResults()
    {
         results = [select CaseNumber,Type, Subject, Priority,Status,CreatedDate,SLA_Flag__c,Owner.Name  from Case where Mail_Box_Name__c=:statusOptions];
    }

please check is there any wrong in my code ...Thanks
  • May 08, 2018
  • Like
  • 0
Hi All,

Is there a way to intigrate Googlee Charts in My lightning Components.
If So can any one share some sample examples.

Thanks
Arjun.M
Hi All,

Could you please let us know if we can Chat between Comminity Users and Normal Salesforce Users. Please also suggest a method to achieve this.

Thanks and Regards,
Christwin
I am new to wave analytics ,
How to bind two datasets in a single dashboards
I am attempting to use a SOQL query to query a Grandparent Object (Account), Parent Object (Opportunity), Child Custom Object (EBR_Form__c) but continue to get the following error in the Developer Console's Query Editor: 
 
SELECT id, Name, Opportunity__r.Name, Opportunity__r.Account.Name FROM EBR_Form__c

SELECT id, Name, Opportunity__r.Name, Opportunity__r.Account.Name
                                 ^
ERROR at Row:1:Column:18
Didn't understand relationship 'Opportunity__r' in field path. 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.

User-added image

What am I missing. Your help would be appreciated greatly.