• Trisha Hinojosa
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 4
    Replies
Hello,

I am using a data table within a card. I would like to be able to collapse the table without having to use javascipt, just like I can with page block sections.

Any Ideas?

E.g., page block section:

...
<apex:pageBlockSection id="pg1" collapsible="true" title="Matters" columns="1">
<apex:pageblockTable value="{!result4}" var="matt">
            <apex:column headerValue="Matter Name">                    
                <apex:outputLink value="/{!matt.Id}" target="_blank">{!matt.name}</apex:outputLink>
             </apex:column>
...

E.g., data table. Begins after  <!-- /Make Collapsible ???-->    

...
<!-- MATTER TABLE -->
<!-- HEADER CARD WITH ONE ACTION AND DATA TABLE -->
    <article class="slds-card">
          <div class="slds-card__header slds-grid">
            <header class="slds-media slds-media_center slds-has-flexi-truncate">
              <div class="slds-media__figure">
                <span class="slds-icon_container slds-icon-custom-custom90" title="Matters">
                      <svg class="slds-icon slds-icon_small" aria-hidden="true">
                        <use xlink:href="/assets/icons/custom-sprite/svg/symbols.svg#custom90"></use>
                      </svg>
                          <span class="slds-assistive-text">Matter</span>
                </span>
              </div>
                  <div class="slds-media__body">
                    <h2 class="slds-card__header-title">
                        <span class="slds-text-heading_small">Matters</span>
                    </h2>
                  </div>
                      <div class="slds-no-flex">
                    <apex:form >     
                               <apex:commandButton styleClass="slds-button slds-button--brand slds-not-selected" value="Export To Excel" action="/apex/MatterFetch"/>
                    </apex:form>     
                      </div>
            </header>
          </div>
<!-- / HEADER CARD-->
    <div class="slds-card__body slds-card__body_inner"> bla bla bla.</div>
      <div class="slds-card__body">


 <!-- /Make Collapsible ???-->          
      
      <apex:dataTable value="{!result4}" var="matt" styleClass="slds-table slds-table_bordered slds-is-selected slds-has-flexi-truncate">
            <apex:column headerValue="Matter Name">                    
                <apex:outputLink value="/{!matt.Id}" target="_blank">{!matt.name}</apex:outputLink>
             </apex:column>
...

 
Hello,

I have a custom object called "Matters". It's records are created by a product integration so I have to use a picklist field and user lookup field as a proxy for "created by". The picklist field is Salesperso__c and was replaced by a lookup field Salesperson__c at a later date.

I'm stuck trying to iterate through a list so I get the first matter for every user. 

This is what I was able to put togehter so far:
SELECT Id, Name, Salesperso__c, Salesperson__c, CreatedDate FROM Matter__c order by createdDate ASC limit 1

This only gives me the first matter ever made. Not the first matter for each salesperson.

How can I incorporate something like this: list <user> fmatter = [select id from matter order by createdDate ASC limit 1];
Should I? Do I have to do two separate queries, because I have 2 different data types for the salesperson field? 

New to SOQL.

Thank you! 

EDIT: I also tried the following query below, but it is not allowed: "[object Object]: Ordered field must be grouped or aggregated: CreatedDate"

SELECT Id, Name, Salesperso__c, Salesperson__c, CreatedDate FROM Matter__c 
GROUP BY Salesperson__c, Salesperso__c
ORDER BY createdDate ASC limit 1


...when I add CreatedDate to group by: "Malformed Query: 
[object Object]: Salesperson__c, Salesperso__c, createdDate ORDER BY createdDate ^ ERROR at Row:1:Column:116 field 'createdDate' can not be grouped in a query call"


I know I'm probably not understanding something elemental. I apologize for my ignorance. 
Hello,

I have a custom object called "Matters". It's records are created by a product integration so I have to use a picklist field and user lookup field as a proxy for "created by". The picklist field is Salesperso__c and was replaced by a lookup field Salesperson__c at a later date.

I'm stuck trying to iterate through a list so I get the first matter for every user. 

This is what I was able to put togehter so far:
SELECT Id, Name, Salesperso__c, Salesperson__c, CreatedDate FROM Matter__c order by createdDate ASC limit 1

This only gives me the first matter ever made. Not the first matter for each salesperson.

How can I incorporate something like this: list <user> fmatter = [select id from matter order by createdDate ASC limit 1];
Should I? Do I have to do two separate queries, because I have 2 different data types for the salesperson field? 

New to SOQL.

Thank you! 

EDIT: I also tried the following query below, but it is not allowed: "[object Object]: Ordered field must be grouped or aggregated: CreatedDate"

SELECT Id, Name, Salesperso__c, Salesperson__c, CreatedDate FROM Matter__c 
GROUP BY Salesperson__c, Salesperso__c
ORDER BY createdDate ASC limit 1


...when I add CreatedDate to group by: "Malformed Query: 
[object Object]: Salesperson__c, Salesperso__c, createdDate ORDER BY createdDate ^ ERROR at Row:1:Column:116 field 'createdDate' can not be grouped in a query call"


I know I'm probably not understanding something elemental. I apologize for my ignorance. 
We are in the process of cosolidating profiles (taking it from about 10 down to 1) and I need to reassign the new profile to about 400 users. This is going to be very tedious if I have to do it one by one but I can't figure out another way to do it. I looked into inline editing, data loader, and apps but nothing seems to be available to make this kind of change en masse. Has anyone else done this before and if so, did you have to do it manually?