• Rashika Singh
  • NEWBIE
  • 5 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 4
    Replies
I want to to use show and hide instead of aura if,How can i use....

 <aura:if isTrue="{!v.deviceStyle}">
                                    <div class="slds-col slds-size_4-of-5 slds-card__body">
                                        <c:Product_Details  aura:id="childComponent1"  startPage="{!v.startPage}" endPage="{!v.endPage}" pageSize="{!v.pageSize}" sortAsc="{!v.sortAsc}" totalRecords="{!v.totalRecords}" productlist1="{!v.productlist1}" listOfAllProducts="{!v.listOfAllProducts}" totalRecordsCount="{!v.totalRecordsCount}" bNoRecordsFound="{!v.bNoRecordsFound}" productList="{!v.productList}" totalPagesCount="{!v.totalPagesCount}" recordId="{!v.recordId}" scroll="{!v.scroll}"/>
                                    </div>
                                    <aura:set attribute="else">
                                        <div class="slds-col slds-card__body slds-scrollable">
                                            <c:Product_Details  aura:id="childComponent1" startPage="{!v.startPage}" endPage="{!v.endPage}" pageSize="{!v.pageSize}" sortAsc="{!v.sortAsc}" totalRecords="{!v.totalRecords}" productlist1="{!v.productlist1}" listOfAllProducts="{!v.listOfAllProducts}" totalRecordsCount="{!v.totalRecordsCount}" bNoRecordsFound="{!v.bNoRecordsFound}" productList="{!v.productList}" totalPagesCount="{!v.totalPagesCount}" recordId="{!v.recordId}" scroll="{!v.scroll}"/>
                                        </div>
                                    </aura:set>
                                </aura:if>    

how to create lightning-record-edit-form to create Contact record associated to an Account in lightning Component?

 
We have Layout Read-only fields to be added. Seems like a bug, when we try to add read-only fields they become read-write on layout. Please see below example.
 
public class metadatatest {
    public static void runUpdateLayouts(){        
        Metadata.Layout la = getLayout('Account-Account Layout');

        Metadata.LayoutSection sec = new Metadata.LayoutSection();
        sec.customLabel = true;
        sec.detailHeading = true;
        sec.editHeading = true;
        sec.label = 'Custom fields';
        sec.style = metadata.LayoutSectionStyle.OneColumn;

        Metadata.LayoutColumn col1 = new Metadata.LayoutColumn();

        Metadata.LayoutItem layoutField = new Metadata.LayoutItem();

        layoutField.field = 'testfield__c';
        layoutField.behavior = metadata.UiBehavior.Readonly;

        col1.layoutItems.add(layoutField);
        sec.layoutColumns.add(col1);

        la.layoutSections.add(sec);

        Metadata.DeployContainer dc = new Metadata.DeployContainer();
        dc.addMetadata(la);

        Id jobid = Metadata.Operations.enqueueDeployment(dc,null);
    }

    public static Metadata.Layout getLayout(String layoutName){
        List<String> layoutList = new List<String>{layoutName};
            List<Metadata.Metadata> components = Metadata.Operations.retrieve(Metadata.MetadataType.Layout, layoutList);
        return (Metadata.Layout)components[0];
    }
}


Above code will add testfield__c field to Account standard layout. But it shows as Readonly in Layout editor. But in Account both view and edit modes it's read-write.

On Layout editor:
In Layout editor

On View/Edit mode:
Edit/View Mode

It's actually editable and saving data to Account object here. Feel free to try out above code snippet. Appreciate any fix/workaround for this. Thanks.

 
Hello everyone,

I currently have a lightning application within Salesforce1 that contains multiple lightning components. The components appear past the screen, but when I try to scroll, I can see the bottom of the screen, but I get snapped back up to the top of the page. I'm having trouble figuring out why the component won't allow me to scroll down and how to fix it.

I've tried applying "slds-scrollable--y" to the div class, but that doesn't work. I've also tried adding style="overflow:scroll" as well but also to no avail.

Any help would be greatly appreciated! Thanks!