• Guillaume Minero 8
  • NEWBIE
  • 10 Points
  • Member since 2015
  • coveo

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 7
    Replies
Hi!

I'm new to building SOQL or SOSL queries.  I'm an Administrator, not a Dev, so I don't know much about building these.  Wondering if someone can help me with the steps required to pull data using 1 query for the following?

I have custom objects called Project, Project Task, and Timesheet.  Project is the parent object, while Project Task and Timesheet are the child objects.
I want to run 1 query that will pull data based on the following request:
Part 1
- Pull timesheet records for project tasks with the following filters:
* Project task Type field value = Programming or Programming Questions
*Project task Status field value = Not Started, Awaiting Assets, Received_Reviewied, In Progress

Part 2
- Pull timesheet records related to the above project tasks that were logged at the project level (object)

I'd like to group the results by project.
Make sense?  Can anyone help with this?
Thanks!
Nick
trigger NoteOnContentversion on ContentVersion (before insert, before update) {
	for (ContentVersion c : Trigger.new)  {
        
            for (ContentDocumentLink link : [
                SELECT LinkedEntityId 
                FROM ContentDocumentLink
                WHERE ContentDocumentId = :c.ContentDocumentId
            ]){
                Id parentId = link.LinkedEntityId;
                System.debug('link.LinkedEntityId '+ link);
                
                Boolean isOrderRegel = parentId.getSObjectType() == Orderregel__c.SObjectType;
                
                if (isOrderRegel && Approval.isLocked(parentId)){
                  c.addError('Approval pending. You do not have the permission to edit this note, Please contact your administrator.');
                }
            }
        
    }
}
 
@IsTest
private class NoteOnContentversion {
	
    @IsTest static void refuse_shouldAddError_whenOrderregelIsLocked() {
        // arrange
        Account a = new Account(
        	Name = '123', 
            Account_Status_DS__c = 'Strategic'
        );
        insert a;
        
        Orderregel__c orderregel = new Orderregel__c(
            Account__c = a.Id,
            Orderbegindatum__c = Date.today()
        );
        
        insert orderregel;
        Approval.lock(orderregel);
        
        ContentVersion n = new ContentVersion();
       
        insert n;
        
        ContentDocumentLink cl  = new ContentDocumentLink();
        
        insert cl;
               
        // act
        DmlException caughtException;
        try {
            insert cl;
        	insert n;
        } catch(DmlException e) {
            caughtException = e;
        }
        
        // assert
        System.assertNotEquals(null, caughtException);
    }   
}

 
Greetings!

I am still new to this and I am trying to add a MultiselectPicklist visualforce component into a lightning component using the following syntax: 
<c:MultiselectPicklist leftLabel="Available Contacts"
                leftOptions="{!allContacts}"
                rightLabel="Selected Contacts"
                rightOptions="{!selectedContacts}"
                size="14"
                width="150px"/>

The error within my lightning app reads: "Failed to save undefined: No COMPONENT named markup://c:MultiselectPicklist found : [markup://c:OpportunityTeamBox]"

The Multiselect Picklist is installed as a package. 

From what I understand, using a component in lightning follows a similar syntax to using a component in visualforce. A lightning developer, I'm sure, will instantly be able to spot the problem, but I'm not able to search for a solution to being able to use a multiselect picklist in lightning. 

If anybody has suggestions, I would be happy to see 'em. 
I have seen eclipse IDE where Apex class and Controller as well visualforce page can be created just like Salesforce console developer.
Is there any way we can have same in VSS IDE.

Regards
Aniket
The campingList JavaScript controller isn't setting the 'item' as a parameter or saving the record correctly.

My code is as follows:

1---Camping List Component
<aura:component controller="CampingListController">
	
    <aura:handler name="init" action="{!c.doInit}" value="{!this}"/>
    
    <aura:handler name="addItem" event="c:addItemEvent"
   	action="{!c.handleAddItem }"/>
    
    <aura:attribute name="newItem" type="Camping_Item__c"
     default="{ 'sobjectType': 'Camping_Item__c',
                    'Name': '',
                    'Quantity__c': 0,
                    'Price__c': 0,
                    'Packed__c': false }"/>
    
    <aura:attribute name="items" type="Camping_Item__c[]"/>
    
    <ol>
    <li>Bug Spray</li>
    <li>Bear Repellant</li>
    <li>Goat Food</li>
    </ol>
    
       <!-- NEW EXPENSE FORM -->
    <div class="slds-col slds-col--padded slds-p-top--large">

        <c:campingListForm/>

    </div>
    <!-- / NEW EXPENSE FORM -->    
   

    <div class="slds-card slds-p-top--medium">
        <header class="slds-card__header">
            <h3 class="slds-text-heading--small">Items</h3>
        </header>
        
        <section class="slds-card__body">
            <div id="list" class="row">
                <aura:iteration items="{!v.items}" var="items">
                    <c:campingListItem item="{!item}"/>
                </aura:iteration>
            </div>
        </section>
    </div>

</aura:component>

2---Camping List Controller
 
({
    // Load items from Salesforce
	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);
},

    
    handleAddItem: function(component, event, helper) {
    var newItem = event.getParam("item");
    //helper.createItem(component, newItem);
        this.saveItem(component, item, function(response){
        var state = response.getState();
        if (component.isValid() && state === "SUCCESS") {
            var items = component.get("v.items");
            items.push(response.getReturnValue());
            component.set("v.items", items);
        }
    }
          
}
                      
})

3---Camping List Helper

Empty

4---Camping List Form
 
<aura:component >
	
    <aura:registerEvent name="addItem" type="c:addItemEvent"/>
        <!-- CREATE NEW ITEM FORM -->
    <form class="slds-form--stacked">

      <div class="slds-form-element slds-is-required">
          <div class="slds-form-element__control">
              <ui:inputText aura:id="itemname" label="Name"
                  class="slds-input"
                  labelClass="slds-form-element__label"
                  value="{!v.newItem.Name}"
                  required="true"/>

          </div>
     </div>

     <div class="slds-form-element slds-is-required">
          <div class="slds-form-element__control">
              <ui:inputNumber aura:id="quantity" label="Quantity"
                  class="slds-input"
                  labelClass="slds-form-element__label"
                  value="{!v.newItem.Quantity__c}"
                  required="true"/>

          </div>
      </div>

      <div class="slds-form-element">
          <div class="slds-form-element__control">
              <ui:inputCurrency aura:id="price" label="Price"
                  class="slds-input"
                  labelClass="slds-form-element__label"
                  value="{!v.newItem.Price__c}"
                  />
          </div>
      </div>

      <div class="slds-form-element">
          <ui:inputCheckbox aura:id="packed" label="Packed?"
              class="slds-checkbox"
              labelClass="slds-form-element__label"
              value="{!v.newItem.Packed__c}"/>
      </div>

      <div class="slds-form-element">
          <ui:button label="Create Camping Item"
              class="slds-button slds-button--brand"
              press="{!c.clickCreateItem}"/>
      </div>

    </form>
    <!-- / CREATE NEW ITEM FORM -->
</aura:component>

5---CampingListFormController
 
({
    
    clickCreateItem: function(component, event, helper) {    
    if(helper.validateItemForm(component)){
        // Create the new item
        var newItem = component.get("v.newItem");
        helper.createItem(component, newItem);
    }
        
        }

})

6---CampingListFormHelper
 
({
 createItem: function(component, newItem) {
    var createItem = component.getItem("createItem");
    createItem.setParams({ "item": item });
    createItem.fire();
             component.set("v.newItem",{ 'sobjectType': 'Camping_Item__c',
                    'Name': '',
                    'Quantity__c': 0,
                    'Price__c': 0,
                    'Packed__c': false }/>);
},
    

		validateItemForm: function(component) {
		
              // Simplistic error checking
        var validItem = true;

        // Name must not be blank
        var nameField = component.find("itemname");
        var itemname = nameField.get("v.value");
        if ($A.util.isEmpty(itemname)){
            validItem = false;
            nameField.set("v.errors", [{message:"Item name can't be blank."}]);
        }
        else {
            nameField.set("v.errors", null);
        }
        
        // Quantity must not be blank
        var quantityField = component.find("quantity");
        var quantity = nameField.get("v.value");
        if ($A.util.isEmpty(quantity)){
            validItem = false;
            quantityField.set("v.errors", [{message:"Quantity can't be blank."}]);
        }
        else {
            quantityField.set("v.errors", null);
        }
		// Price must not be blank
        var priceField = component.find("price");
        var price = priceField.get("v.value");
        if ($A.util.isEmpty(price)){
            validItem = false;
            priceField.set("v.errors", [{message:"Price can't be blank."}]);
        }
        else {
            quantityField.set("v.errors", null);
        }
            return validItem;

	}
})

I am still getting this error:

User-added image

Any help would be appreciated.
 
Hi,

My company has been very frustrated by the current salesforce search functionality (including advanced search). 

We'd like for the search terms found in returned records to be highlighted and displayed in the results.  Currently, if a search term is found at the end of a field, even if the field is displayed in search results, you have to open the record up in a new window to understand the context.

We use Lucene (the java based open-source search software) on our own web app and we're wondering how difficult it would be to implement a Lucene based search app for salesforce.  Has anyone developed something like this in the past?  I can't find anything on the app exchange currently, but I think there was a salesforce/lucene implementation a couple of years ago.

How would you go about implementing something like this?  Are there better options I don't know about?

Thanks,
Dave
Kingfish Group
  • February 11, 2008
  • Like
  • 0