• Benoy Vm
  • NEWBIE
  • 55 Points
  • Member since 2015
  • SFDC Solution Architect
  • Extreme Networks


  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 4
    Replies
I am using a Salesforce Lab app named Enhanced Data Grids.  It allows you to build sortable data grids.  Part of the functionality allows you to add actions to the lighting component.  I am struggling to build an edit event for the rows.   I am using e.force:editRecord as the event.  You can select the action type (which I selected Row Button)  Finally, there is a section for Event Payload.  The help syntax for Event Payload indicates:  Payload for this event.  For LIST activation, will automatically replace #parentrecordId# with valid id.  For ROW actions, will automatically replace fieldnames with # at beginning and end with the corresponding values.  example:{"recordId":"#Id#")

I am struggling on the correct syntax to allow the edit page to open for the related row in the list.  

Any help would be greatly appreciated!  thanks!

Fred

 
  • August 13, 2018
  • Like
  • 0

Hi, the page simply says "Saucony" and no data below.

The only thing I can think of based on a past one I did is to change line 2 of the class

From: public List<Sales_Order_Line__C> Sales_Order_Lines {get;set;} 
To: public List<Sales_Order_Line__C> Sales_Order_Line__C {get;set;} 

but I get the error
Error: Compile Error: Invalid identifier: Sales_Order_Line__C at line 2 column 34    

Any idea?  I have done similar ones that work, can't figure this one out.

This query alone does work and returns matches
SELECT SalesOrderSalesOrderLine__r.Account__r.Name, SalesOrderSalesOrderLine__r.OrderDate__C, ProductName__c, PurchaseQuantity__c FROM sales_order_line__C WHERE ProductName__C LIKE '%Guide%'

CLASS

public class SauconyController {
public List<Sales_Order_Line__C> Sales_Order_Lines {get;set;} 
    private String sortOrder = 'SalesOrderSalesOrderLine__r.OrderDate__C';
public List<Sales_Order_Line__C> getSales_Order_Lines() {
    List<Sales_Order_Line__C> results = Database.query(
        'SELECT SalesOrderSalesOrderLine__r.Account__r.Name, SalesOrderSalesOrderLine__r.OrderDate__C, ProductName__c, PurchaseQuantity__c ' +
        'FROM Sales_Order_Line__C' +
        'WHERE ProductName__c like %Guide% ' +
        'ORDER BY ' + sortOrder + ' DESC '
    );
    return results;
}
}

PAGE

<apex:page controller="SauconyController" sidebar="false" showheader="false">
<font size="5">
    <apex:form >
        <apex:pageBlock title="Saucony" id="Sales_Order_Lines_list">
            <!-- Sales Order Lines list -->
            <apex:pageBlockTable value="{! Sales_Order_Lines }" var="sl">
            <apex:column value="{!sl.SalesOrderSalesOrderLine__r.Account__r.Name}"/>
            <apex:column value="{!sl.SalesOrderSalesOrderLine__r.OrderDate__c}"/>
            <apex:column value="{!sl.ProductName__c}"/>
            <apex:column value="{!sl.PurchaseQuantity__c}"/>
        </apex:pageBlockTable>  
        </apex:pageBlock>
            </apex:form>
</font>
</apex:page>
 

Thanks.

I am using a Salesforce Lab app named Enhanced Data Grids.  It allows you to build sortable data grids.  Part of the functionality allows you to add actions to the lighting component.  I am struggling to build an edit event for the rows.   I am using e.force:editRecord as the event.  You can select the action type (which I selected Row Button)  Finally, there is a section for Event Payload.  The help syntax for Event Payload indicates:  Payload for this event.  For LIST activation, will automatically replace #parentrecordId# with valid id.  For ROW actions, will automatically replace fieldnames with # at beginning and end with the corresponding values.  example:{"recordId":"#Id#")

I am struggling on the correct syntax to allow the edit page to open for the related row in the list.  

Any help would be greatly appreciated!  thanks!

Fred

 
  • August 13, 2018
  • Like
  • 0
I have the following code which works for the opportunity object, but when i duplicated the code for some other objects i am getting an error stating that i have too many SQL queries.  
Set<Id> OpportunityIds = new Set<Id>();
    Map<Id,Opportunity> mapOpportunityLogWithId = new Map<Id,Opportunity>();
    Map<Id,Opportunity> mapOpportunityLogToUpdate = new Map<Id,Opportunity>();    

    for(Opportunity a:[SELECT Description FROM Opportunity WHERE ID IN:OpportunityIds]){
        mapOpportunityLogWithId.put(a.Id,a);
    }
How do i bulkify the for loop, making it more efficient with less SQL queries?  I attempted something like the code below but on line 6 i get a problem stating "Initial term of field expression must be a concrete SObject: List"
Set<Id> OpportunityIds = new Set<Id>();
    List<Opportunity> mapOpportunityLogWithId = new List<Opportunity>();
    Map<Id,Opportunity> mapOpportunityLogToUpdate = new Map<Id,Opportunity>();    

    for(Opportunity[] a:[SELECT Description FROM Opportunity WHERE ID IN:OpportunityIds]){
        mapOpportunityLogWithId.put(a.Id,a);
    }

 

Hi, the page simply says "Saucony" and no data below.

The only thing I can think of based on a past one I did is to change line 2 of the class

From: public List<Sales_Order_Line__C> Sales_Order_Lines {get;set;} 
To: public List<Sales_Order_Line__C> Sales_Order_Line__C {get;set;} 

but I get the error
Error: Compile Error: Invalid identifier: Sales_Order_Line__C at line 2 column 34    

Any idea?  I have done similar ones that work, can't figure this one out.

This query alone does work and returns matches
SELECT SalesOrderSalesOrderLine__r.Account__r.Name, SalesOrderSalesOrderLine__r.OrderDate__C, ProductName__c, PurchaseQuantity__c FROM sales_order_line__C WHERE ProductName__C LIKE '%Guide%'

CLASS

public class SauconyController {
public List<Sales_Order_Line__C> Sales_Order_Lines {get;set;} 
    private String sortOrder = 'SalesOrderSalesOrderLine__r.OrderDate__C';
public List<Sales_Order_Line__C> getSales_Order_Lines() {
    List<Sales_Order_Line__C> results = Database.query(
        'SELECT SalesOrderSalesOrderLine__r.Account__r.Name, SalesOrderSalesOrderLine__r.OrderDate__C, ProductName__c, PurchaseQuantity__c ' +
        'FROM Sales_Order_Line__C' +
        'WHERE ProductName__c like %Guide% ' +
        'ORDER BY ' + sortOrder + ' DESC '
    );
    return results;
}
}

PAGE

<apex:page controller="SauconyController" sidebar="false" showheader="false">
<font size="5">
    <apex:form >
        <apex:pageBlock title="Saucony" id="Sales_Order_Lines_list">
            <!-- Sales Order Lines list -->
            <apex:pageBlockTable value="{! Sales_Order_Lines }" var="sl">
            <apex:column value="{!sl.SalesOrderSalesOrderLine__r.Account__r.Name}"/>
            <apex:column value="{!sl.SalesOrderSalesOrderLine__r.OrderDate__c}"/>
            <apex:column value="{!sl.ProductName__c}"/>
            <apex:column value="{!sl.PurchaseQuantity__c}"/>
        </apex:pageBlockTable>  
        </apex:pageBlock>
            </apex:form>
</font>
</apex:page>
 

Thanks.

Hello. I apologize if this is a duplicate issue, but I couldn't find a similar issue on the forums. I'm new here.

I have a custom object in Salesforce that cannot be queried. It always times out. It used to do that sometimes, but then it would work. Now, I cannot query it no matter what I do.
I tried:

  • Select Id From Object__c (Times out)
  • Select Id From Object__c Limit 5 (Times out)
  • Select Id From Other_Object__c (This works)

Any help is appreciated. Thank you.