+ Start a Discussion
iKnowSFDCiKnowSFDC 

I have a list I need to sort by a primary key as well as a secondary key - I tried ORDER BY fieldName AND fieldNAME as well as ORDER BY fieldName AND BY fieldName - neither one compiled on save. 

 

Any ideas? 

 

Thanks!

 

JoAnn

Best Answer chosen by Admin (Salesforce Developers) 
craigmhcraigmh

Order By fieldName1, fieldName2

Best Answer chosen by Pierce Hale 15
vijay kumar kvijay kumar k
Hi Pierce

Greetings to you,

All content document public links are got stored in ContentDistribution Object.
For object reference: https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_contentdistribution.htm
Yes pierce, you can query public url from content distribution object with help of ContentDocumentID or ContentVersionId.

Ex : Select Id,ContentDocumentId,ContentDownloadUrl,DistributionPublicUrl from ContentDistribution where ContentDocumentId='0691000000FOq3nAAD'

I hope this is helpful to you. Please mark this as the best answer if it's useful to you.

Regards
Vijay
Agnibha Chakrabarti 10Agnibha Chakrabarti 10 
Hi,
I have to replicate the New Case to create a new case in lightning component. I have to create look up input box in that page.
and Store the value in case object after clicking the Save button.

Can anybody help me with the creation of lookup input field and storing it into the Case object?

Thanks
Best Answer chosen by Agnibha Chakrabarti 10
Devi ChandrikaDevi Chandrika (Salesforce Developers) 

Hi,
To create lookup input field in lightning we have to create custom lightning component.
Please refer below links which might help you with this
http://www.jitendrazaa.com/blog/salesforce/lookup-component-in-salesforce-lightning/
http://sfdcmonkey.com/2017/07/17/re-usable-custom-lookup/
https://developer.salesforce.com/blogs/developer-relations/2015/06/salesforce-lightning-inputlookup-missing-component.html

Here is an idea to vote on this
https://success.salesforce.com/ideaView?id=08730000000Dom1AAC

Hope this helps you
If this helps kindly mark it as solved so that it may help others in future.

Thanks and Regards

YiQin HeYiQin He 
Hi, 

I created a lightning component as a quick action button. In the component, I have a cancel button that I want it closed when user clicks.
User-added image

But the problem is that I cannot find any document explain how to close the modal dialog. This is the ui code:
<aura:component controller="ContactController" implements="force:lightningQuickActionWithoutHeader,force:hasRecordId" >
    <style>
        .changeRecordTypeRow {
        margin-top: 1.5rem;
        margin-bottom: 0;
        margin-left: 0;
        margin-right: 0;
        }
        
        .changeRecordTypeLeftColumn {
        float: left;
        text-align: right;
        padding-right: 1.5rem;
        width: 35%;
        font-size: .8125rem;
        color: rgb(84, 105, 141);
        }
        
        .changeRecordTypeRightColumn {
        float: right;
        text-align: left;
        width: 65%;
        }
        
        .modal-body
        {
        	height:auto !important;
        	padding:0;
        }
        
        .forceChatterLightningComponent .bodyWrapper{height:100%;width:100%;padding:0;box-sizing:border-box}
    </style>
    <div class="modal-header slds-modal__header">
        <h2 class="title slds-text-heading--medium" >Change Contact Type</h2>
    </div>
    <div class="scrollable slds-modal__content slds-p-around--medium">
        <div class="changeRecordTypeRow">
            <fieldset class="slds-form-element">
                <div class="changeRecordTypeLeftColumn">
                    <legend class="form-element__legend slds-form-element__label">Select a record type</legend>
                </div>
                <div class="changeRecordTypeRightColumn slds-form-element__control">

                    <span class="slds-radio">
                        <input type="radio" id="radio_PrimaryContact" name="recordType" />
                        <label class="slds-radio__label" for="radio_PrimaryContact">
                            <span class="slds-radio--faux"></span>
                            <span class="slds-form-element__label">Primary Contact</span>
                        </label>
                    </span>
                    <span class="slds-radio">
                        <input type="radio" id="radio_SecondaryContact" name="recordType" />
                        <label class="slds-radio__label" for="radio_SecondaryContact">
                            <span class="slds-radio--faux"></span>
                            <span class="slds-form-element__label">Secondary Contact</span>
                        </label>
                    </span>
                </div>
            </fieldset>
        </div>
	</div>
    <div class="modal-footer slds-modal__footer">
    	<div class="forceChangeRecordTypeFooter">
        	<button type="button" class="slds-button slds-button--neutral .slds-modal__close" aura:id="btnCancel" >
            	Cancel
            </button>
            <button type="button" class="slds-button slds-button--brand" aura:id="btnSave">
            	Save
            </button>
        </div>
    </div>
</aura:component>
Does anyone have similar experience? Thanks in advance.
Best Answer chosen by YiQin He
YiQin HeYiQin He
Hi Karthik,

Thanks for the reply. I've already found the solution.
Call this method $A.get("e.force:closeQuickAction").fire() will close the modal dialog.

Yiqin
SandrineSandrine 
Hello,

I alwaays get error when i try to save something from Dev console

Failed to create createContainerMember for containerId duplicate value found: <unknown> duplicates value on record with id: <unknown>
Best Answer chosen by Sandrine
AshlekhAshlekh
Hi,

Follow these stepsGo to Developer Console -> Work Space -> New Workspace
Create a new workspace
Save classes/triggers

*https://help.salesforce.com/apex/HTViewSolution?id=000204953&language=en_US

Try again, it should be fixedIf my answer helps resolve your query, please mark it as the 'Best Answer' and upvote it to benefit others and improve the overall quality of Discussion Forums.


-Thanks
Ashlekh Gera




 
csbaacsbaa 

Hello Helper

 

I want to export   from an org a package  containing  custom objects,  Custom fields , classes,  custom buttons......

 

I created a package.xml  file where I included  the Metadata  types  I want to export

 

I can not  specify  Custom button Metadata  type

Looking into the salesforce docs it seems to me that is is  considered as weblink

 

I tried  something like  below

 

.....

<types>
<members>Account.CustomButton_1</members>
<members>Account.CustomButton_1</members>
<name>webLinks</name>
</types>

 

 

 

but it does not work

 

any suggestion?

 

 

Thanks in advance

Csaba

 

 

 

 

Best Answer chosen by csbaa
David CheungDavid Cheung
@csaba, meta data name for custom button is WebLink - in the singular form, you had it as WebLinks.
@Admin why was @Vinita_SFDC chosen as the best answer?
LinThawLinThaw 
Hi,

I got following error on step 3.

Challenge Not yet complete... here's what's wrong: 
Couldn’t find Agency records from the Account object.

Can anyone pass this step?
Thanks in advance.

Regards,
LinThaw
Best Answer chosen by LinThaw
LinThawLinThaw
Hi Jennifer and ankita,

Please refer below, I passed this step 3.

fig 1.
User-added image

fig 2.
User-added image


and create Top 5 Agencies lenses.

Regards,
LinThaw
Justin DurossJustin Duross 
Hello, for the Salesforce Trailhead "Using Future Methods" I keep getting the error "The 'AccountProcessorTest' test class doesn't appear to be calling the 'AccountProcessor.countContacts' method between Test.startTest() and Test.stopTest()." I believe I have the right syntax, so I'm not sure what is wrong. My main class is fine. the problem only seems to be in the AccountProcessorTest.apxc

AccountProcessorTest.apxc
@isTest private class AccountProcessorTest {
    @isTest static void countContacts() {
        Test.setMock(AccountProcessorTest.class, new Account());
        Test.startTest();
        	AccountProcessor.countContacts();			
        Test.stopTest();
        
    } 	
}


Here is my main class in case anyone needs it:

AccountProcessor.apxc
global class AccountProcessor {
	@future
    public static void countContacts(Set<id> setId){
        List<Account> lstAccount = [SELECT Id, Number_of_Contacts__c, (SELECT Id FROM Contacts) FROM Account where id in : setid];
        for(Account acc: lstAccount){
            List<Contact> lstCont=acc.contacts;
            	acc.Number_of_Contacts__c = lstCont.size();
        }
        update lstAccount;
    }
}

Thank you in advance!
Justin Duross

 
Best Answer chosen by Justin Duross
Amit Chaudhary 8Amit Chaudhary 8
Please check below post for same issue
1) https://developer.salesforce.com/forums/?id=906F0000000D8hwIAC

Please update your Test class like below:-
@IsTest
public class AccountProcessorTest {
    public static testmethod void TestAccountProcessorTest() 
    {
        Account a = new Account();
        a.Name = 'Test Account';
        Insert a;

        Contact cont = New Contact();
        cont.FirstName ='Bob';
        cont.LastName ='Masters';
        cont.AccountId = a.Id;
        Insert cont;
        
        set<Id> setAccId = new Set<ID>();
        setAccId.add(a.id);
 
        Test.startTest();
            AccountProcessor.countContacts(setAccId);
        Test.stopTest();
        
        Account ACC = [select Number_of_Contacts__c from Account where id = :a.id LIMIT 1];
        System.assertEquals ( Integer.valueOf(ACC.Number_of_Contacts__c) ,1);
  }
  
}
Let us know if this will help you


 
Jordan MJordan M 
I am new to LWC and cant seem to figure out how to open the source code for LWC. Aura can be opened in the dev console but from what i understand this is not possible with LWC.

Is it possible to open a LWC source code from within the org? I have a LWC that was developed by someone else that needs editing. How can I access the source code?
Best Answer chosen by Jordan M
Soyab HussainSoyab Hussain
Hi Jordan Mathews,

Step 1. Go to workbench and login.

https://workbench.developerforce.com/login.php

Step 2.  Click on retrieve button.

User-added image
Step 3. click on "Choose File" button and upload package.xml file.

package.xml:
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>*</members>
        <name>LightningComponentBundle</name>
    </types>
    <version>45.0</version>
</Package>

Step 4. click on next and retrieve metadata, it will give you all the LWC components exist in your org.

User-added image

Step 5. click Download ZIP File.

Regards,
Soyab
Filip Poverud 4Filip Poverud 4 
Build a Conference Management App --> Create an Aura Component

I have tried to Copy/Paste using CTRL+C and CTRL+V, using the mouse copy/paste functions and also writing the code manually but all attempts fail. Are there any other ways of copying the text so I can complete this challenge ?
Best Answer chosen by Filip Poverud 4
Filip Poverud 4Filip Poverud 4
I fixed the error by using:
 
e.force:navigateToObjectHome

Instad of:
"standard__objectPage"

For some reason it was the navigation back to the record that failed using the code in the module.