• Kt Yadav
  • NEWBIE
  • 70 Points
  • Member since 2015
  • Consultant
  • deloitte

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 12
    Questions
  • 29
    Replies
Hi , 
I am facing one issue related to "selectFamily" method, can any one tell the exact issue.
User-added image
Hi, 
I am new to Sales cloud and I want to understand the feature difference provided by Salesforce Sales Cloud license and Vlocity CPQ App Exchange Product.
Can anyone suggest which one is better for Salesforce CPQ implementation.

Regards,
Keerti Yadav
 
Hi,
I am keep getting this error on step 10.
User-added image
FriendswithBoat App Code
<aura:application extends="force:slds">
     <lightning:layout >
        <lightning:layoutItem padding="around-small" size="6">
            <c:BoatSearch/>
        </lightning:layoutItem>
        <lightning:layoutItem padding="around-small" size="6">
            <c:BoatDetails/>    
            <article class="slds-card slds-m-bottom_large" title="Current Boat Location">
                <div aura:id="map">
                    <c:Map/>
                </div>
            </article>
        </lightning:layoutItem>
    </lightning:layout>
    <lightning:layout >
    </lightning:layout>
</aura:application>
 
Hi There is a Visual force page calling lightning compoent throwing error.
Uncaught SyntaxError: Invalid or unexpected token throws at https://c.XXXX.visual.force.com/apex/CS_PD_PageLayoutComponent?id=0010E00000HZkI6QAL&tour=&isdtp=p1&sfdcIFrameOrigin=https://XXXX.lightning.force.com&sfdcIFrameHost=web&nonce=b92faed0849d7bbb9f9

Here is a code
<apex:page standardController="Account" showHeader="false" standardStylesheets="false" sidebar="false" applyHtmlTag="false" applyBodyTag="false" docType="html-5.0">   
    
    <html xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">  
    <apex:includeScript value="/lightning/lightning.out.js" />
        
    <apex:includeScript value="{!URLFOR($Resource.svg4everybody + '/svg4everybody-master/dist/svg4everybody.js')}" /> 
       
        <div id="lightning" />
        <script>
         $Lightning.use("c:CS_CP_PortfolioDashboardApp", function() {
            // Write a function that creates the component on the page
            $Lightning.createComponent("c:CS_CP_PortfolioDashboard_HeaderContainer",
                                       { SalesforceId : '{!Account.Id}', AccountName: '{!Account.Name}', JobTitle : '{!Account.Job_Title__c}'},
                                       "lightning",
                                       function(cmp) {
                                                // do some stuff
                                       });
        });
        </script>
    </html>    
</apex:page>
 
Hi,
I am running below query on my custom meta data with like clause but it is not giving the correct results.
string prodCode='%TW%';
for(RCF_Application_File_Status__mdt objFileStatus : [Select MasterLabel,DeveloperName,Final_Status__c,RCF_Product_Code__c From                                     RCF_Application_File_Status__mdt where RCF_Product_Code__c like :prodCode OR RCF_Product_Code__c = 'ALL']){
    system.debug(objFileStatus.MasterLabel+'_____'+ objFileStatus.Final_Status__c+'---------------------'+objFileStatus.RCF_Product_Code__c);
}

Using the above query i am only rows containing "All" not the result containing "TW,ML".
Is there any limitations on Custom Meta Data for "Like" Clause.
    
 
Hi,
Can we create a custom button on Lighnting flow screen for home page navigation.
We have navigation actions on flow i.e. Next Previous,Finish,Pause,Resume.
But suppose we have 5 screens and we want to go to home or start screen from anyone of them how do we do that.
Alough we have sequentional naviagtion but i wanted to skip and direcly naviagte to home/start screen.
 
Hi ,
Can anyone explain the use case of storable action in lightning or share one example of it.
 
Hi ,
I have implemented Partner Community using Napili Template, For Task/Event object I am not getting Edit/Delete button in Desktop view, but I am able to see it in mobile view.Please suggest any workaround.

Mobile View for the Standard/Custom button Task object
In the Create Remote Site Setting Unit from "Quick Start:Einstein Vision" , the Remote Site URL is outdated as it's not matching with the end point URL provided in the 
Vision Controller Class to access the token ,so I was getting an error"Unauthorized endpoint, please check Setup->Security->Remote site settings. endpoint = https://api.einstein.ai/v1/oauth2/token".
Please Update it with the "https://api.einstein.ai" from "https://api.metamind.io".
 
I have one custom object and trigger for insert and inside trigger there is future call  and one batch class  doing insert on same object so to prevent recursion  how will i handle it out of box, no business logic.
Is there any way we can handle it from Out of box without writing any custom logic?
what is a difference in passing parameter to method xyz(trigger.new) or xyz((List<Account>)Trigger.new) if both are referring to account context
//Handler Class
public class InvoiceClass {
    public static void invoiceProduct(List<Invoice_Product__c> invProduct){
        for(Invoice_Product__c inv : invProduct){
            inv.Total_Price__c = inv.Price__c * inv.Quantity__c;
        }
    }
    public static void invoiceAmountUpdate(List<Invoice_Product__c> invProduct ){
        Set<id> invoiceIds = new Set<id>();
        for(Invoice_Product__c invPro : invProduct){
            if(invPro.InvoiceLookUp__c != Null){
                invoiceIds.add(invPro.InvoiceLookUp__c);   
            }
        }
        List<Invoice__c> invoices = [Select id, Total_Amount__c, (Select id, Total_Price__c
                                                                  From Invoice_Products__r)
                                     From Invoice__c where id in : invoiceIds];
        for(Invoice__c inv: invoices){
            inv.Total_Amount__c = 0;
            for(Invoice_Product__c invProd : inv.Invoice_Products__r){
                inv.Total_Amount__c += invProd.Total_Price__c;
            }
        }
        if(invoices != Null){
            update invoices;
        }
    }
}
//trigger
trigger InvoiceProductTrigger on Invoice_Product__c (before insert, before update, after insert, after update, after delete) {
    if((Trigger.isInsert || Trigger.isUpdate) && Trigger.isBefore){
        InvoiceClass.invoiceProduct(Trigger.new);
    }
    if(Trigger.isAfter && (Trigger.isInsert || Trigger.isUpdate)){
        InvoiceClass.invoiceAmountUpdate(Trigger.new);
    } 
    if(Trigger.isAfter && Trigger.isDelete){
        InvoiceClass.invoiceAmountUpdate(Trigger.old);
    }
    if(Trigger.isAfter && Trigger.isUpdate){
        InvoiceClass.invoiceAmountUpdate(Trigger.old);
    }
}

 
I have began this project but by the time i upload the CSV File worldwide_sales_with_flags i get this error:

Error image screenshot
Text says: Forbidden: {"gackId":"1377834474-66695 (-1485123873)","message":"Invalid request."}

What im doind wrong?

Thanks in advace for the help

 
Hi , 
I am facing one issue related to "selectFamily" method, can any one tell the exact issue.
User-added image
lI am receiving too many soql queries: 101.
Need elp on how I  can redo this bit of code to reduce the number of queries to stop the receiving the error.
private Id hasTemplateBuilding(Apttus__APTS_Agreement__c agreement) {
        if(agreement != null) {
            List<Template_Assignment__c> building = [SELECT Template__c FROM Template_Assignment__c WHERE Building__c =: agreement.Building__c];
            if(building.size() == 1) {
                return building[0].Template__c;
            } else {
                return null;
            }
        } else {
            return null;
        }
    }
  • October 13, 2018
  • Like
  • 0
Hello Guys,

I am working on custom metadata, I have custom meta data "Org_Email_Signature__mdt" and is having field type Long text Area "Email_Signature__c".

Now, when I create a new user, I need to fetch that custom meta data to a field "Signature" in user object. I need to write a trigger for this.

Please help me to achieve this functionality.
Hi,
I am keep getting this error on step 10.
User-added image
FriendswithBoat App Code
<aura:application extends="force:slds">
     <lightning:layout >
        <lightning:layoutItem padding="around-small" size="6">
            <c:BoatSearch/>
        </lightning:layoutItem>
        <lightning:layoutItem padding="around-small" size="6">
            <c:BoatDetails/>    
            <article class="slds-card slds-m-bottom_large" title="Current Boat Location">
                <div aura:id="map">
                    <c:Map/>
                </div>
            </article>
        </lightning:layoutItem>
    </lightning:layout>
    <lightning:layout >
    </lightning:layout>
</aura:application>
 
Visualforce Page:
<apex:page Controller="PdfGeneratorRedirectController" contentType="application/vnd.ms-excel#SalesForceExport.xls">
"Category","Date","Work Order Number","Pass / Fail"
 <apex:repeat value="{! lstscoring}" var="scring">
 "{!scring.Scoring_Category__c}","{!scring.CreatedDate }","{!scring.Work_Order__r.WorkOrderNumber}","{!scring.Pass_Fail__c}"
 </apex:repeat>
</apex:page>



Controller construcotrAfter Generation:

 lstscoring = new List<Scoring_Record__c>();
           lstscoring = [Select id,name,Scoring_Category__c,Vendor__r.name,Score__c,CreatedDate,Work_Order__r.WorkOrderNumber,Pass_Fail__c from Scoring_Record__c where Vendor__c ='001Z000001LlLGW'];
        System.debug('***** Construc'+ lstscoring +'stscr[0].Vendor__c') ;
Hi,
I am running below query on my custom meta data with like clause but it is not giving the correct results.
string prodCode='%TW%';
for(RCF_Application_File_Status__mdt objFileStatus : [Select MasterLabel,DeveloperName,Final_Status__c,RCF_Product_Code__c From                                     RCF_Application_File_Status__mdt where RCF_Product_Code__c like :prodCode OR RCF_Product_Code__c = 'ALL']){
    system.debug(objFileStatus.MasterLabel+'_____'+ objFileStatus.Final_Status__c+'---------------------'+objFileStatus.RCF_Product_Code__c);
}

Using the above query i am only rows containing "All" not the result containing "TW,ML".
Is there any limitations on Custom Meta Data for "Like" Clause.
    
 
Hi ,
Can anyone explain the use case of storable action in lightning or share one example of it.
 
HI All,
i need some help
i am stuck at there part where i am not able to save the data from the page to the database, and the strange part is, that with my below code i am able to clear the challange
below is my code 

CampingList.cmp
<aura:component controller="CampingListController">
    
    <aura:attribute name="items" type="Camping_Item__c[]"/>
    <aura:attribute name="newItem" type="Camping_Item__c" default="{'Name':'',
                                                                   'Quantity__c':0,
                                                                   'Price__c':0,
                                                                   'Packed__c':false,
                                                                   'sobjectType':'Camping_Item__c'}"/>
  <aura:handler name="init" action="{!c.doInit}" value="{!this}"/>
    
    <c:campingHeader />
    
    <!-- NEW Item entry FORM -->
    <lightning:layout >
        <lightning:layoutItem padding="around-small" size="6">
            <!-- CREATE NEW Item -->
            <div aria-labelledby="newCampaingform">
                <!-- BOXED AREA -->
                <fieldset class="slds-box slds-theme--default slds-container--small">
                    <legend id="newCampaingform" class="slds-text-heading--small 
                      slds-p-vertical--medium">
                      Add Expense
                    </legend>
                    
                    <!-- CREATE NEW EXPENSE FORM -->
                    <form class="slds-form--stacked">
                         <!-- For Name Field -->
        <lightning:input aura:id="expenseform" label="Camping Name"
                         name="expensename"
                         value="{!v.newItem.Name}"
                         required="true"/>
        <!-- For Quantity Field -->
        <lightning:input type="number" aura:id="campingform" label="Quantity"
                         name="expenseamount"
                         min="1"
                         value="{!v.newItem.Quantity__c}"
                         messageWhenRangeUnderflow="Enter minimum 1 Quantity"/>
         <!-- For Price Field -->
        <lightning:input aura:id="campingform" label="Price"
                         formatter="currency"
                         name="expenseclient"
                         value="{!v.newItem.Price__c}"
                          />
         <!-- For Check Box -->
        <lightning:input type="checkbox" aura:id="campingform" label="Packed"  
                         name="expreimbursed"
                         checked="{!v.newItem.Packed__c}"/>
        
        <lightning:button label="Create Camping" 
                          class="slds-m-top--medium"
                          variant="brand"
                          onclick="{!c.createItem}"/>
                    </form>
                </fieldset>
            </div>
        </lightning:layoutItem>
    </lightning:layout>
    <!-- ITERATIING ITEM LISTS -->
    <div class="slds-card slds-p-top--medium">
        
        <c:campingHeader />
        
        <section class="slds-card__body">
            <div id="list" class="row">
                <aura:iteration items="{!v.items}" var="item">
                    <c:campingListItem item="{!item}"/>
                </aura:iteration>
            </div>
        </section>
    </div>    
    <!-- / ITERATIING ITEM LISTS -->
</aura:component>


CampingListController.js
({     
      doInit: function(component, event, helper) {
        
        // Create the action
        var action = component.get("c.getItems");
        
        // Add callback behavior for when response is received
        action.setCallback(this, function(response) {
            var state = response.getState();
            if (component.isValid() && state === "SUCCESS") {
                component.set("v.items", response.getReturnValue());
            }
            else {
                console.log("Failed with state: " + state);
            }
        });
        
        // Send action off to be executed
        $A.enqueueAction(action);
        },
        
    createItem: function(component, event, helper) {
        var newCamping = component.get("v.newItem");
        helper.createItem(component, newCamping);
    }
              
})


CampingListHelper.js
({
    createItem: function(component, camping) {
        
        var action = component.get("c.saveItem");
        action.setParams({
            "item": camping
        });
        action.setCallback(this, function(response){
        var state = response.getState();
        if (component.isValid() && state === "SUCCESS") {
            var campings = component.get("v.items");
            campings.push(response.getReturnValue());
            component.set("v.items", campings);
        }
        });
        $A.enqueueAction(action);
    }
})


CampingListController
public with sharing class CampingListController{

    @AuraEnabled
    public static List<Camping_Item__c> getItems(){
    
        return [Select id, name, Packed__c, Price__c, Quantity__c from Camping_Item__c];
    }
    
    @AuraEnabled
    public static Camping_Item__c saveItem(Camping_Item__c Item){
    
        upsert Item;
        return Item;
    }

}
Hello,

  I am little bit confuse.
  which one execute first validation rule or before trigger.
Hi Folks, I am new to salesforce and wolud like to know, "How to calculate no of child records to a parent object without using trigger". 
Any help will be appreciated, Thank you very much beforehand.
  • March 28, 2016
  • Like
  • 1
On this documentation link: https://developer.salesforce.com/trailhead/lightning_components/lightning_components_events_handle

it says, a component can also handle its own event. Simply include an aura:registerEvent and aura:handler in that component.

Let's say I have a list of accounts and on clicking the account name, I want to display its contact list.

<aura:iteration items="{!v.accounts}" var="acc">    
        <div onclick="{!c.showContacts}" class="row primary">{!acc.Name}</div>     
    </aura:iteration>

In the showContacts controller action, how do I set the parameter to the event which takes an account object?
// How do I set acct below?
var updateEvent = component.getEvent("showContacts");
      updateEvent.setParams({ "account": acct }).fire();

var acct = component.get("v.acc.id");
this doesn't work.

I know how to do this via a sub-component that shows the account name, register the onclick event and handle it in the main component. Just wondering how you do this in the component itself since the logic is really simple and do not want to use a subcomponent for that one line of code.

Please advise.


 

i can't edit profiles.
on my other salesforce account it's like this when i open the Profiles: https://www.dropbox.com/s/esjtc829gwm7kt8/Picture3.png
but on my other account it's like this: https://www.dropbox.com/s/1d2620w9bdv80h7/Picture4.png

both accounts are developer edition.

what is the problem here?
help!

  • December 14, 2013
  • Like
  • 0

I'm wondering is it possible to create Excel or CSV file in apex code (as attachment) is it possible ? currently i only see it works with VF page, but i'm looking to do it in apex code not using vf page, I don't see any options.

 

Any help is appreciated.

 

Thanks

Ram

 

  • December 29, 2011
  • Like
  • 0