• jojoforce
  • NEWBIE
  • 183 Points
  • Member since 2010

  • Chatter
    Feed
  • 7
    Best Answers
  • 4
    Likes Received
  • 0
    Likes Given
  • 62
    Questions
  • 47
    Replies
Does Salesforce Mobile support cookies? I'm trying to set a selected menu item to be persistent so that when I go back to a lightning component, the previously selected menu item is still selected. 

User-added image
I have a lightning component tab, that has a lightning component with lightning:buttonMenu.

However, when I go back to the lightning component tab, I'd like the menu button to retain what was selected sort of cache the last selected menu item and make them sticky.Is there a way to make them sticky? 

For example below... I selected "Menu Item Three". if I go to a different page for example an Account Record Page then I go back to the Lightning Component Tab, I'd like "Menu Item Three" to show that was my last selection.

User-added image

 




 
We have a custom object MyEvent__c with the following datetime fields StartDateTime__c and EndDateTime__c.

I am trying to get all of the current events and upcoming events.
 
For example, today is 9/14/2020   12:23 PM
 
Start Date/TimeEnd Date/TimeResults
9/14/20 1:00 PM9/14/20 2:00 PMInclude
9/14/20 9:00 AM9/14/20 1:00 PMInclude
9/14/20 8:00 AM9/14/20 8:30 AMDo Not Display
9/14/20 1:00 PM9/16/20 7:00 PMInclude
9/14/20 9:00 AM9/16/20 7:00 PMInclude
9/16/20 9:00 AM9/16/20 7:00 PMDo Not Display


Here is my query so far, but its not returning the correct results.
SELECT Id, Name FROM MyEvent__c WHERE StartDate__c = TODAY OR (StartDate__c >=TODAY AND EndDate__c <= TODAY)



 
How do yo navigate to the Calendar tab or to the Event list in Salesforce Mobile? Do we use the force:navigateToComponent? or lightning:navigation?  Any example is greatly appreciated.




How do you navigate to a report that has a URL parameter in salesforce mobile? The following code snippet works in desktop but not in salesforce mobile.
Essentially, I am trying to get to a Report with a URL filter parameter as per the following link (https://help.salesforce.com/articleView?id=reports_filter_url.htm&type=0)
 
var urlEvent = $A.get("e.force:navigateToURL");
        urlEvent.setParams({
          "url": "/lightning/r/Report/00O0t000000hOKEEA2/view?fv0=John%20Doe"
        });
        urlEvent.fire();

 
I have the following code snippet, and for some reason, when the method returns no data, the lightning component aura framework is throwing an error. In desktop, there's no console error message. But in salesforce mobile, the attched error callback getTasks "undefined is not an object evaluating".The other thing to note, in desktop/web, it is not getting to console.log('loadData : c.getTasks AFTER');



Apex Controller
@AuraEnabled
    public static list<Task> getTasks(String selectedFilter){


        Id currentUserId = userinfo.getUserId();
        set<Id> teamMemberIDs = new set<Id>();

        list<Task> tasks = new list<Task> ();

        teamMemberIDs.add(currentUserId);
        for(User u : [SELECT Id,ManagerId FROM User WHERE ManagerId = :currentUserId]){
            teamMemberIDs.add(u.Id);
        }

        String strQuery = ' SELECT Id, Who.Name, What.Name, AccountId,Account.Name,Subject,Status,Priority,OwnerId,Owner.Name ';
        strQuery += ' FROM Task ';
        strQuery += ' WHERE IsClosed = FALSE ';

        if(selectedFilter == 'TodayTasks'){
            strQuery += ' AND ActivityDate = TODAY ';
            strQuery += ' AND OwnerId = \'' + currentUserId + '\'';

        } else if (selectedFilter == 'AllOverdueTasks') {
            strQuery += ' AND ActivityDate < TODAY ';
            strQuery += ' AND OwnerId = \'' + currentUserId + '\'';
        } else if (selectedFilter == 'TomorrowsTask') {
            strQuery += ' AND ActivityDate = TOMORROW ';
            strQuery += ' AND OwnerId = \'' + currentUserId + '\'';

        } else if (selectedFilter == 'MyTeamsTasks') {            
            strQuery += ' AND ActivityDate = TODAY ';
            strQuery += ' AND  OwnerId IN :teamMemberIDs ';            
        }

        strQuery += ' ORDER BY Subject ASC, What.Name ASC ';
        //strQuery += ' LIMIT 6 ';

        System.debug('JOSEPH DEBUG: getTasks selectedFilter ' + selectedFilter);
        System.debug('JOSEPH DEBUG: getTasks strQuery : ' + strQuery);

        tasks = Database.query(strQuery); 
        return tasks;
    }
Aura Bundle Javascript Controller
({
    callServer : function(component,method,callback,params) {
        var action = component.get(method);
        if (params) {
            action.setParams(params);
        }      
        action.setCallback(this,function(response) {
            var state = response.getState();
            if (state === "SUCCESS") { 
                // pass returned value to callback function
                callback.call(this,response.getReturnValue());   
            } else if (state === "ERROR") {
                // generic error handler
                var errors = response.getError();
                if (errors) {
                    console.log("Errors", errors);
                    if (errors[0] && errors[0].message) {
                        throw new Error("Error" + errors[0].message);
                    }
                } else {
                    throw new Error("Unknown Error");
                }
            }
        });
        $A.enqueueAction(action);
    },
    loadData : function(component) {
        console.log('loadData : ' +  component.get("v.selectedFilter"));
    
        //Get Task Records
        this.callServer(component,"c.getTasks",function(response){
            console.log('loadData : c.getTasks BEFORE');
            component.set("v.tasksCount", response.length);   
            console.log('loadData : v.tasksCount response.length ' + response.length);
            if(response.length > 0){
                component.set("v.isThereTasks",true);
                component.set("v.tasks", response);  
    
            } else {
                component.set("v.isThereTasks",false);
            }
            console.log('loadData : c.getTasks AFTER');

        },{
            selectedFilter: component.get("v.selectedFilter")               
        }); 
    }
    
});
Aura Bundle Component
<aura:attribute name="tasks" type="Task[]"/>

 
Essentially, the task subject or the Account Name should be truncated when its too long but here is what is happening in my component. Any advice on how to use the sdls-truncate css?
 
<table class="slds-table slds-no-row-hover">
                    <tbody>
                        <aura:iteration items="{! v.tasks }" var="task">
                            <tr class="slds-hint-parent">
                                <td class="slds-text-align_left" style="width:30px;">
                                    <lightning:input type="checkbox" label="Checkbox Label" variant="label-hidden"></lightning:input>
                                </td>
                                <td class="slds-text-align_left">
                                    <div class="slds-grid slds-truncate_container_33"  >
                                        <span class="slds-truncate" title="{!task.Subject}">
                                            <a target="_blank" class="slds-text-link" href="" onclick="{! c.handleTaskLink }" data-taskid="{!task.Id}">
                                                {!task.Subject}
                                            </a>            
                                        </span>
                                    </div>
                                </td>
                                <td class="slds-text-align_right">
                                    <div class="slds-grid"  >
                                        <span class="slds-truncate" title="{!task.Account.Name}">
                                            <a target="_blank" class="slds-text-link" href="" onclick="{! c.handleAccountLink }" data-accountid="{!task.AccountId}">
                                                {!task.Account.Name}                                    
                                            </a>    
                                        </span>
                                    </div>
                                </td>
                            </tr>
                        
                        </aura:iteration>
    
                    </tbody>
                </table>

User-added image
I have the following hyperlink and I'm just trying to navigate to the sObject page. However its not redirecting to the record page.
 
<a target="_blank" class="slds-text-link" href=""  onclick="{! c.handleTaskLink }" data-taskid="{!task.Id}">{!task.Subject}</a>


 
handleTaskLink : function (component, event, helper) {

        var recordId = event.getSource().getElement().getAttribute('data-taskid');

        var navEvt = $A.get("e.force:navigateToSObject");
        navEvt.setParams({
          "recordId" : recordId,
          "slideDevName" : "detail"
        });
        navEvt.fire();
    },

 
Can we customize or hide the Page Banner in the Lightning App Page?User-added image
How do you hide the table column header and also now have any border on the lightning:datatable?

Desired Output:
User-added image
Code Snippet
<lightning:datatable class="slds-table slds-table_cell-buffer slds-table_header-hidden"
                        columns="{! v.columns }"
                        data="{! v.data }"
                        keyField="id"
                        onrowaction="{! c.handleRowAction }"
                        hideCheckboxColumn="true"
                        hideTableHeader="true"/>
Result
User-added image
We had a very complex Opportunity data structure with a lot of related objects; and we had a requirement to create a pivot table type of reporting (matrix) but we couldn't do it wit Salesforce Matrix Report so we ended up creating a lightning component that builds a matrix table of data for reporting purposes. 

Typically, users would go to the Reports tab to access a report, but in this situation we created a lightning component to display a complex set of data for reporting purposes. Where would you typically put such lightning component? 
I'm encountering a weird situation in using lightning:tabset, apparently, if the user has not yet navigated (or activated) a tab, the child component in it will be undefined thus any attributes in that component will not be accessible. 


For example... If I have not activated tab2 (meaning, the user did not click tab2 yet) then component.find('tab2') will be undefined. 
 
<lightning:tabset>
 <lightning:tab tab1>
    <c:component_in_tab1 aura:id="tab1" />
 </lightning:tab>

 <lightning:tab tab2>
    <c:component_in_tab2 aura:id="tab2" />     
  </lightning:tab>
</lightning:tabset>


 
var cmp = component.find('tab2');   // THIS THROWS UNDEFINED
var dataAttribute = cmp.get('v.myAttribute');

 
I have a Visualforce Page that is using JavaScript remoting to essentially pass an sObject that has a Date Field into a JavaScript remoting action. However, it appears that it does not seem to recognize the javascript date format. 

 
function MyObject__c(){
    this.Name = null; 
    this.Start_Date__c = null;

}


function createRecord() {
        MyObject__c myobj = new MyObject__c();

        myobj.Start_Date__c  = '2017-01-01'; 

        Visualforce.remoting.Manager.invokeAction(
            '{!$RemoteAction.myclass.mymethod}',
            myobj,
            function(results, event){
                if (event.status) {
                
                	console.log(results);


                }
             }, 
             {escape: true}
         );		
}

I have tried different variation, but it's not working. Any advice would be great.

Variations that I tried...
myobj.Start_Date__c = new date('2017-01-01').toUTCString();

Also this one...
myobj.Start_Date__c = new date('2017-01-01');

And this one...
 
myobj.Start_Date__c = new date('2017-01-01').toISOString();

 
I have a javascript remoting with an sObject that has a date function, however, it doesn't seem like it likes the date. How do I pass an sobject with Date? 

VF Page
function MyObject__c() {
        this.name = null;
	   this.Start_Date__c = null;
	    this.End_Date__c = null;
	    
    } 

function createRecord() {
       MyObject__c myobj = new MyObject__c();

         myobj.Start_Date__c  = '2017-01-01'; 
         myobj.End_Date__c  = '2017-01-31'; 

        Visualforce.remoting.Manager.invokeAction(
            '{!$RemoteAction.myclass.mymethod}',
            myobj,
            function(results, event){
                if (event.status) {
                
                	console.log(results);


                }
             }, 
             {escape: true}
         );		
}
Apex Controller
global class myclass {

   @RemoteAction
   global static void myAction(MyObject__c myobj) {
      insert myobj;
   }

}

I tried different variation in handling javascript date format...Nothing seems to work....Any advice would be great!
 
myobj.Start_Date__c  = new date('2017-01-01'); 
myobj.End_Date__c  = new date('2017-01-31');
myobj.Start_Date__c  = new date('2017-01-01').toUTCString(); 
myobj.End_Date__c  = new date('2017-01-31').toUTCString();



 
We are using a Lightning Out and have a simple Input Box with a Button. The button when clicked, retrieves the value of the input box and inserts it in the MyCustom_Object__c.

When the lightning attribute type is of "MyCustom_Object__c" then the Lightning Out does not work, however, if we use the type "Object" it works. Any ideas?
 
<aura:attribute name="MyRecord" type="MyCustom_Object__c" access="GLOBAL"/>
versus
<aura:attribute name="MyRecord" type="Object" access="GLOBAL"/>



**testComponent.cmp**
<aura:component access="GLOBAL" controller="tempLightningOut" 
        <aura:attribute name="MyRecord" type="MyCustom_Object__c" access="GLOBAL"/>
        <p> Lightning Out Testing </p>
        <lightning:input aura:id="inputNameField" label="Name" name="inputNameField" />
        <lightning:button variant="brand" label="Submit" onclick="{! c.handleClick }" />
    </aura:component>



**testComponent.app**
<aura:application extends="ltng:outApp"  implements="ltng:allowGuestAccess" access="GLOBAL" >
    
            <aura:dependency resource="markup://c:tempComponent" type="COMPONENT"/>
    
        
    </aura:application>



**testComponentController.js**
 
handleClick : function(component, event, helper) {
        
        var cmp = component.find('inputNameField');

        var inputValue= cmp.get("v.value");
        

        helper.callServer(component,"c.insertRecord",function(response){
            var cmp = component.find('inputNameField');
            cmp.set('v.value','');
            
                        
            
        },{
            inputValue: inputValue
        });
        
    }



**testComponentHelper.js**
({
        callServer : function(component,method,callback,params) {
            var action = component.get(method);
            if (params) {
                action.setParams(params);
            }
          
            action.setCallback(this,function(response) {
                var state = response.getState();
                if (state === "SUCCESS") { 
                    // pass returned value to callback function
                    callback.call(this,response.getReturnValue());   
                } else if (state === "ERROR") {
                    // generic error handler
                    var errors = response.getError();
                    if (errors) {
                        console.log("Errors", errors);
                        if (errors[0] && errors[0].message) {
                            throw new Error("Error" + errors[0].message);
                        }
                    } else {
                        throw new Error("Unknown Error");
                    }
                }
            });
    
            $A.enqueueAction(action);
        }
    })


**tempLightningOut Apex Controller**
 
public class tempLightningOut {
             @AuraEnabled    
            public static void insertRecord(String inputValue) {
        
                MyCustom_Object__c rec = new MyCustom_Object__c();
                rec.name = inputValue;
                insert rec ;
            }        
        
     }


HTML
 
<!DOCTYPE html>
<html>
<head>

<script src="https://mydomain.cs62.force.com/lightning/lightning.out.js" type="text/javascript"> </script>

<script type="text/javascript">


    $Lightning.use("c:tempApp",    // name of the Lightning app
        function() {                  // Callback once framework and app loaded
            $Lightning.createComponent(
                "c:tempComponent", // top-level component of your app
                { },                  // attributes to set on the component when created
                "lightningLocator",   // the DOM location to insert the component
                function(cmp) {
                    // callback when component is created and active on the page
                }
            );


        },
        'https://mycommunityendpoint.cs62.force.com/communityendpointtest'  // Community endpoint
    );

</script>
</head>

<body >



		<div id="lightningLocator" style="height:100%;width:100%;"></div>
</body>
</html>


 
In lightning components, what is the difference between .THIS.mycustomclass versus .THIS .mycustomclass?
 
.THIS .mycustomclass {
   //css styling
}


.THIS.mycustomclass {
  //css styling
}



 
I'm using the following modal example in Lightning Design System, however, inside Salesforce Lightning Experience, this does not display correctly. The top portion of the modal form does not show correctly and I was wondering how to adjust the positioning of this modal. This seems like a defect in the Lightning Design System and was wondering how to go around it. Thanks!



https://www.lightningdesignsystem.com/components/progress-indicator/
<div role="dialog" tabindex="-1" class="slds-modal slds-fade-in-open slds-modal--large" aria-labelledby="header43">
  <div class="slds-modal__container">
    <div class="slds-modal__header">
      <button class="slds-button slds-modal__close slds-button--icon-inverse" title="Close">
  
        <span class="slds-assistive-text">Close</span>
      </button>
      <h2 id="header43" class="slds-text-heading--medium">Modal Header</h2>
    </div>
    <div class="slds-modal__content slds-grow slds-p-around--medium"></div>
    <div class="slds-modal__footer slds-grid slds-grid--align-spread">
      <div class="slds-progress slds-progress--shade slds-order--2">
        <ol class="slds-progress__list">
          <li class="slds-progress__item slds-is-completed">
            <button class="slds-button slds-button--icon slds-progress__marker slds-progress__marker--icon" aria-describedby="step-1-tooltip" title="settings">

              <span class="slds-assistive-text">Step 1 - Completed</span>
            </button>
          </li>
          <li class="slds-progress__item slds-is-active">
            <button class="slds-button slds-progress__marker" aria-describedby="step-2-tooltip">
              <span class="slds-assistive-text">Step 2 - Active</span>
            </button>
          </li>
          <li class="slds-progress__item">
            <button class="slds-button slds-progress__marker" aria-describedby="step-3-tooltip">
              <span class="slds-assistive-text">Step 3 </span>
            </button>
          </li>
          <li class="slds-progress__item">
            <button class="slds-button slds-progress__marker" aria-describedby="step-4-tooltip">
              <span class="slds-assistive-text">Step 4 </span>
            </button>
          </li>
          <li class="slds-progress__item">
            <button class="slds-button slds-progress__marker" aria-describedby="step-5-tooltip">
              <span class="slds-assistive-text">Step 5 </span>
            </button>
          </li>
        </ol>
        <div class="slds-progress-bar">
          <span class="slds-progress-bar__value" style="width:25%;">
            <span class="slds-assistive-text">Progress: 25%</span>
          </span>
        </div>
      </div>
      <button class="slds-button slds-button--neutral slds-order--1">Cancel</button>
      <button class="slds-button slds-button--brand slds-order--3">Save</button>
    </div>
  </div>
</div>
<div class="slds-backdrop slds-backdrop--open"></div>
This is the correct display and I should see the header of the modal like below

User-added image

Inside Salesforce Lightning Experience - this is what I see and this is not correct as the header of the modal is not displayed at all
User-added image
Can the Lightning Page created through the App Builder be surfaced in Lightning Out?
It appears that only stand alone Apps can be surfaced in lightning out.
When using the force:recordEdit in a stand alone app, the form and inputs are displaying correctly with the SLDS style sheet in LEX or S1, however, in a stand alone app the forms are not display with the appropriate CSS styling. How did anyone got around this limitation with the stand alone app. 
 
<force:recordEdit recordId = "a3EU00000004ueLMAQ" />

 

According to the documentation found in this link, the force:createRecord is one of the out-of-the-box events to enable components to view or create a record. The documentation says that its only available in Lightning Expererience (LEX) or Salesforce1 (S1), HOWEVER, if you fire these events outside of LEX or S1 you have to handle the event and register the event. I couldn't find any good examples on how to do so and any help is greatly appreciated. Essentially, my use case is be able to create a record for an object in a stand alone app, LEX or S1. Currently, I am able to create a record for just LEX and S1 but when I do so with a stand alone app, it does not fire. 


https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/ref_events.htm

Use out-of-the-box events to enable component interaction within Lightning Experience or Salesforce1, or within your Lightning components. For example, these events enable your components to open a record create or edit page, or navigate to a record.
If you fire one of these events in your Lightning apps or components outside of Salesforce1 or Lightning Experience:
  • You must handle the event by using the <aura:handler> tag in the handling component.
  • Use the <aura:registerEvent> or <aura:dependency> tags to ensure that the event is sent to the client, when needed.
I'm encountering a weird situation in using lightning:tabset, apparently, if the user has not yet navigated (or activated) a tab, the child component in it will be undefined thus any attributes in that component will not be accessible. 


For example... If I have not activated tab2 (meaning, the user did not click tab2 yet) then component.find('tab2') will be undefined. 
 
<lightning:tabset>
 <lightning:tab tab1>
    <c:component_in_tab1 aura:id="tab1" />
 </lightning:tab>

 <lightning:tab tab2>
    <c:component_in_tab2 aura:id="tab2" />     
  </lightning:tab>
</lightning:tabset>


 
var cmp = component.find('tab2');   // THIS THROWS UNDEFINED
var dataAttribute = cmp.get('v.myAttribute');

 
Hello, I'm trying to install the Force.com IDE plugin for Eclipse Juno 4.2 on a Windows 8 machine and for some reason I am getting a "could not find repository" error message. For some reason, I think the repository no longer exist because in my old machine where I had Force.com IDE eclipse all my life no longer works either. Any advise or suggestion is greatly appreciated. Thanks

https://developer.salesforce.com/page/Force.com_IDE_Installation

Step #3  "In the Add Repository dialog, set the Name to "Force.com IDE" and the Location to "http://media.developerforce.com/force-ide/eclipse42" and click OK. (Use the same URL for Eclipse 4.3.)"

User-added image

We want to able to share accounts between two orgs. We have turned on Salesforce to Salesforce Sharing between two orgs.

 

Some of the accounts in Org A might already exist in Org B prior to establishing the SF2SF link. The two orgs happen to have a unique External ID as a key identifier of accounts between two orgs. So it we look up an account in one org, we can use the External ID to look it up in the other org.

 

Our issue is that some of the accounts in Org A already exist in Org B prior to establishing the SF2SF link. So we want to be able to establish the link between existing accounts between orgs.

 

Salesforce To Salesforce does not appear to detect duplicate records. If the account already exist in the other org, it generates an error DUPLICATE_VALUE as a system error preventing the record to be shared.

 

Is it possible to update PartnerNetworkRecordConnection object. If we know the ConnectionId, LocalRecordId and the PartnerRecordId, we can theorically just dataload the data. However the field PartnerRecordId does not seem updatable. Or any other workaround?

 

 

We have a custom object MyEvent__c with the following datetime fields StartDateTime__c and EndDateTime__c.

I am trying to get all of the current events and upcoming events.
 
For example, today is 9/14/2020   12:23 PM
 
Start Date/TimeEnd Date/TimeResults
9/14/20 1:00 PM9/14/20 2:00 PMInclude
9/14/20 9:00 AM9/14/20 1:00 PMInclude
9/14/20 8:00 AM9/14/20 8:30 AMDo Not Display
9/14/20 1:00 PM9/16/20 7:00 PMInclude
9/14/20 9:00 AM9/16/20 7:00 PMInclude
9/16/20 9:00 AM9/16/20 7:00 PMDo Not Display


Here is my query so far, but its not returning the correct results.
SELECT Id, Name FROM MyEvent__c WHERE StartDate__c = TODAY OR (StartDate__c >=TODAY AND EndDate__c <= TODAY)



 
How do yo navigate to the Calendar tab or to the Event list in Salesforce Mobile? Do we use the force:navigateToComponent? or lightning:navigation?  Any example is greatly appreciated.
I have the following code snippet, and for some reason, when the method returns no data, the lightning component aura framework is throwing an error. In desktop, there's no console error message. But in salesforce mobile, the attched error callback getTasks "undefined is not an object evaluating".The other thing to note, in desktop/web, it is not getting to console.log('loadData : c.getTasks AFTER');



Apex Controller
@AuraEnabled
    public static list<Task> getTasks(String selectedFilter){


        Id currentUserId = userinfo.getUserId();
        set<Id> teamMemberIDs = new set<Id>();

        list<Task> tasks = new list<Task> ();

        teamMemberIDs.add(currentUserId);
        for(User u : [SELECT Id,ManagerId FROM User WHERE ManagerId = :currentUserId]){
            teamMemberIDs.add(u.Id);
        }

        String strQuery = ' SELECT Id, Who.Name, What.Name, AccountId,Account.Name,Subject,Status,Priority,OwnerId,Owner.Name ';
        strQuery += ' FROM Task ';
        strQuery += ' WHERE IsClosed = FALSE ';

        if(selectedFilter == 'TodayTasks'){
            strQuery += ' AND ActivityDate = TODAY ';
            strQuery += ' AND OwnerId = \'' + currentUserId + '\'';

        } else if (selectedFilter == 'AllOverdueTasks') {
            strQuery += ' AND ActivityDate < TODAY ';
            strQuery += ' AND OwnerId = \'' + currentUserId + '\'';
        } else if (selectedFilter == 'TomorrowsTask') {
            strQuery += ' AND ActivityDate = TOMORROW ';
            strQuery += ' AND OwnerId = \'' + currentUserId + '\'';

        } else if (selectedFilter == 'MyTeamsTasks') {            
            strQuery += ' AND ActivityDate = TODAY ';
            strQuery += ' AND  OwnerId IN :teamMemberIDs ';            
        }

        strQuery += ' ORDER BY Subject ASC, What.Name ASC ';
        //strQuery += ' LIMIT 6 ';

        System.debug('JOSEPH DEBUG: getTasks selectedFilter ' + selectedFilter);
        System.debug('JOSEPH DEBUG: getTasks strQuery : ' + strQuery);

        tasks = Database.query(strQuery); 
        return tasks;
    }
Aura Bundle Javascript Controller
({
    callServer : function(component,method,callback,params) {
        var action = component.get(method);
        if (params) {
            action.setParams(params);
        }      
        action.setCallback(this,function(response) {
            var state = response.getState();
            if (state === "SUCCESS") { 
                // pass returned value to callback function
                callback.call(this,response.getReturnValue());   
            } else if (state === "ERROR") {
                // generic error handler
                var errors = response.getError();
                if (errors) {
                    console.log("Errors", errors);
                    if (errors[0] && errors[0].message) {
                        throw new Error("Error" + errors[0].message);
                    }
                } else {
                    throw new Error("Unknown Error");
                }
            }
        });
        $A.enqueueAction(action);
    },
    loadData : function(component) {
        console.log('loadData : ' +  component.get("v.selectedFilter"));
    
        //Get Task Records
        this.callServer(component,"c.getTasks",function(response){
            console.log('loadData : c.getTasks BEFORE');
            component.set("v.tasksCount", response.length);   
            console.log('loadData : v.tasksCount response.length ' + response.length);
            if(response.length > 0){
                component.set("v.isThereTasks",true);
                component.set("v.tasks", response);  
    
            } else {
                component.set("v.isThereTasks",false);
            }
            console.log('loadData : c.getTasks AFTER');

        },{
            selectedFilter: component.get("v.selectedFilter")               
        }); 
    }
    
});
Aura Bundle Component
<aura:attribute name="tasks" type="Task[]"/>

 
Essentially, the task subject or the Account Name should be truncated when its too long but here is what is happening in my component. Any advice on how to use the sdls-truncate css?
 
<table class="slds-table slds-no-row-hover">
                    <tbody>
                        <aura:iteration items="{! v.tasks }" var="task">
                            <tr class="slds-hint-parent">
                                <td class="slds-text-align_left" style="width:30px;">
                                    <lightning:input type="checkbox" label="Checkbox Label" variant="label-hidden"></lightning:input>
                                </td>
                                <td class="slds-text-align_left">
                                    <div class="slds-grid slds-truncate_container_33"  >
                                        <span class="slds-truncate" title="{!task.Subject}">
                                            <a target="_blank" class="slds-text-link" href="" onclick="{! c.handleTaskLink }" data-taskid="{!task.Id}">
                                                {!task.Subject}
                                            </a>            
                                        </span>
                                    </div>
                                </td>
                                <td class="slds-text-align_right">
                                    <div class="slds-grid"  >
                                        <span class="slds-truncate" title="{!task.Account.Name}">
                                            <a target="_blank" class="slds-text-link" href="" onclick="{! c.handleAccountLink }" data-accountid="{!task.AccountId}">
                                                {!task.Account.Name}                                    
                                            </a>    
                                        </span>
                                    </div>
                                </td>
                            </tr>
                        
                        </aura:iteration>
    
                    </tbody>
                </table>

User-added image
We are using a Lightning Out and have a simple Input Box with a Button. The button when clicked, retrieves the value of the input box and inserts it in the MyCustom_Object__c.

When the lightning attribute type is of "MyCustom_Object__c" then the Lightning Out does not work, however, if we use the type "Object" it works. Any ideas?
 
<aura:attribute name="MyRecord" type="MyCustom_Object__c" access="GLOBAL"/>
versus
<aura:attribute name="MyRecord" type="Object" access="GLOBAL"/>



**testComponent.cmp**
<aura:component access="GLOBAL" controller="tempLightningOut" 
        <aura:attribute name="MyRecord" type="MyCustom_Object__c" access="GLOBAL"/>
        <p> Lightning Out Testing </p>
        <lightning:input aura:id="inputNameField" label="Name" name="inputNameField" />
        <lightning:button variant="brand" label="Submit" onclick="{! c.handleClick }" />
    </aura:component>



**testComponent.app**
<aura:application extends="ltng:outApp"  implements="ltng:allowGuestAccess" access="GLOBAL" >
    
            <aura:dependency resource="markup://c:tempComponent" type="COMPONENT"/>
    
        
    </aura:application>



**testComponentController.js**
 
handleClick : function(component, event, helper) {
        
        var cmp = component.find('inputNameField');

        var inputValue= cmp.get("v.value");
        

        helper.callServer(component,"c.insertRecord",function(response){
            var cmp = component.find('inputNameField');
            cmp.set('v.value','');
            
                        
            
        },{
            inputValue: inputValue
        });
        
    }



**testComponentHelper.js**
({
        callServer : function(component,method,callback,params) {
            var action = component.get(method);
            if (params) {
                action.setParams(params);
            }
          
            action.setCallback(this,function(response) {
                var state = response.getState();
                if (state === "SUCCESS") { 
                    // pass returned value to callback function
                    callback.call(this,response.getReturnValue());   
                } else if (state === "ERROR") {
                    // generic error handler
                    var errors = response.getError();
                    if (errors) {
                        console.log("Errors", errors);
                        if (errors[0] && errors[0].message) {
                            throw new Error("Error" + errors[0].message);
                        }
                    } else {
                        throw new Error("Unknown Error");
                    }
                }
            });
    
            $A.enqueueAction(action);
        }
    })


**tempLightningOut Apex Controller**
 
public class tempLightningOut {
             @AuraEnabled    
            public static void insertRecord(String inputValue) {
        
                MyCustom_Object__c rec = new MyCustom_Object__c();
                rec.name = inputValue;
                insert rec ;
            }        
        
     }


HTML
 
<!DOCTYPE html>
<html>
<head>

<script src="https://mydomain.cs62.force.com/lightning/lightning.out.js" type="text/javascript"> </script>

<script type="text/javascript">


    $Lightning.use("c:tempApp",    // name of the Lightning app
        function() {                  // Callback once framework and app loaded
            $Lightning.createComponent(
                "c:tempComponent", // top-level component of your app
                { },                  // attributes to set on the component when created
                "lightningLocator",   // the DOM location to insert the component
                function(cmp) {
                    // callback when component is created and active on the page
                }
            );


        },
        'https://mycommunityendpoint.cs62.force.com/communityendpointtest'  // Community endpoint
    );

</script>
</head>

<body >



		<div id="lightningLocator" style="height:100%;width:100%;"></div>
</body>
</html>


 
Hi everyone!!

I am trying to used lightning dart on a visualforce as you can see in this link https://lightningdart.com/#/desktop, But i dont know how is this working.
On the link, there is a zip package for download, when i get this fiel there is some .dart fiels but i dont know how to use it.
Has anybody work with it?,Is this an static resource?, if this is an static resource, should I call it like .js scripts? and use sources like it says?.

Thanks
I'm getting an error message saying "No repository found at http://media.developerforce.com/force-ide/eclipse42.".

I'm getting this message when updating OR installing the latest Eclipse Force.com IDE. This makes me believe this is an issue with salesforce or developerforce.com as the community.developerforce.com is also not working.

When doing an update on a machine that had force.com ide eclipse working
User-added image
when doing a fresh install
User-added image
Hello, I'm trying to install the Force.com IDE plugin for Eclipse Juno 4.2 on a Windows 8 machine and for some reason I am getting a "could not find repository" error message. For some reason, I think the repository no longer exist because in my old machine where I had Force.com IDE eclipse all my life no longer works either. Any advise or suggestion is greatly appreciated. Thanks

https://developer.salesforce.com/page/Force.com_IDE_Installation

Step #3  "In the Add Repository dialog, set the Name to "Force.com IDE" and the Location to "http://media.developerforce.com/force-ide/eclipse42" and click OK. (Use the same URL for Eclipse 4.3.)"


error


 
Hi..

I created a simple @Future class in one of our DEV sandboxes, and for some reason it's not executing. It is just staying in queued status.

public with sharing class FutureTesting {

    @future
    public static void calculateInventory() {
   
        System.debug('DO SOMETHING');
    }

}


When I execute this, there is no error message but it just stays in queued status. Anybody have experienced this?

If I create 2 visualforce page VF1 and VF2 using the same Controller "MyController" would the "Total number of executed code statements" limit be contained in its own VF page? meaning, if VF1 calls VF2, then does the Script Execution Statements of VF1 count towards the "Total number of executed code statements" of VF2 as well? or are they counted seperately? 

 

 

Hi - is it possible to export a field that is of type "Long Text Area" into a CSV using the Apex Data Loader? I tried that and it seems like Apex Data Loader is not exporting the field. I know we can't filter on a Long Text Area using the WHERE clause, but is there anywhere in the documentation that says it is possible? Thanks for the help.

 

Hi.....

 

I have a Parent object that have two child objects. Its a lookup type of relationship. A parent record may or may not have a record in Child A nor Child B.

 

So basically, in regular SQL I am trying to achieve something like:

 

SELECT count(id)
FROM Parent
WHERE id in (SELECT parentID from ChildA) 
OR    id in (SELECT parentID from ChildB)

 

However, this does not seem possible in SOQL statements. Is there any work around to this dilemna? I'm trying to get the Parent records if they have child records that exists in either Child A or Child B object. A parent record may have records in Child A, but not have records in Child B (and vice-versa). At the same time, a parent record may have both records in Child A and Child B.

 

Thanks for any ideas or inputs in this matter. It seems pretty easy and I'm sure a lot of people had experienced this issue. 

 

 

 

Re-rendering an apex:actionPoller resets the timer clock to zero. Is that just client side? or is that transaction get sent up to the server?

Here's my query:

        SELECT 
              Id
            , Name
            , UserRole.Name
            , Profile.Name
            ,(  SELECT
                     Id
                    ,CRM_Territory_Type__c
                FROM Territories__r 
                WHERE CRM_Inactive__c=false 
            )
        FROM User
WHERE Territories__r.null
        ORDER BY Name

Is there any way to get this query to ONLY return results where the subquery has results?

 

Thanks!

Hello...

 

The StandardSetController that allows VisualForce pages and Apex to paginate through the records has a "Save" method. According to SalesForce documentation:

 

 

Inserts new records or updates existing records that have been changed. After this operation is finished, it returns aPageReference to the original page, if known, or the home page.

 http://www.salesforce.com/us/developer/docs/pages/Content/apex_pages_standardsetcontroller.htm

 

 

The issue that I am facing right now is everytime I make an update to any of the records and use the save method provided by that query, it always returns me to page 1.

 

For example, if I go to page 3, make an update, and perform a "Save" it always returns to the first page. I thought that it should return to the original page (which is the current page you are on). Am I misunderstanding the documentation? 

Is it possible for 1 action call two seperate action status? 

 

for example,

 

<apex:commandButton id="btnID" status="status1,status2" action="{!someAction}" value="Click Me"/>
 
<apex:actionStatus id="status1">
.....
</apex:actionStatus>

 
<apex:actionStatus id="status2">
.......
</apex:actionStatus>

 
 

 

Hi - 

 

I found this really cool gantt chart, but for some reason I'm having problem embedding it into my Visual Force page. The link of the gantt chart is the following:

 

http://dhtmlx.com/docs/products/dhtmlxGantt/index.shtml

 

I was wondering if anyone can help me figure out what's wrong with the below code? I'm not really getting any error message but the inspect element has "Uncaught TypeError: Cannot call method 'addEventListener' of null". 

 

 

<apex:page >

    <apex:stylesheet value="{!URLFOR($Resource.Timeline, 'codebase/dhtmlxgantt.css')}"/>
    <script type="text/javascript" language="JavaScript" src="{!URLFOR($Resource.Timeline, 'codebase/dhtmlxcommon.js')}"></script>
    <script type="text/javascript" language="JavaScript" src="{!URLFOR($Resource.Timeline, 'codebase/dhtmlxgantt.js')}"></script>


    <head>


    <script language="JavaScript" type="text/javascript">
        function createChartControl(htmlDiv1)
        {
            //project 1
            var project1 = new GanttProjectInfo(1, "Applet 11redesign", new Date(2010, 5, 11));
    
            var parentTask1 = new GanttTaskInfo(1, "Old code review", new Date(2010, 5, 11), 208, 50, "");
            parentTask1.addChildTask(new GanttTaskInfo(2, "Convert to J#", new Date(2010, 5, 11), 100, 40, ""));
            parentTask1.addChildTask(new GanttTaskInfo(13, "Add new functions", new Date(2010, 5, 12), 80, 90, ""));
    
            var parentTask2 = new GanttTaskInfo(3, "Hosted Control", new Date(2010, 6, 7), 190, 80, "1");
            var parentTask5 = new GanttTaskInfo(5, "J# interfaces", new Date(2010, 6, 14), 60, 70, "6");
            var parentTask123 = new GanttTaskInfo(123, "use GUIDs", new Date(2010, 6, 14), 60, 70, "");
            parentTask5.addChildTask(parentTask123);
            parentTask2.addChildTask(parentTask5);
            parentTask2.addChildTask(new GanttTaskInfo(6, "Task D", new Date(2010, 6, 10), 30, 80, "14"));
    
            var parentTask4 = new GanttTaskInfo(7, "Unit testing", new Date(2010, 6, 15), 118, 80, "6");
            var parentTask8 = new GanttTaskInfo(8, "core (com)", new Date(2010, 6, 15), 100, 10, "");
            parentTask8.addChildTask(new GanttTaskInfo(55555, "validate uids", new Date(2010, 6, 20), 60, 10, ""));
            parentTask4.addChildTask(parentTask8);
            parentTask4.addChildTask(new GanttTaskInfo(9, "Stress test", new Date(2010, 6, 15), 80, 50, ""));
            parentTask4.addChildTask(new GanttTaskInfo(10, "User interfaces", new Date(2010, 6, 16), 80, 10, ""));
            parentTask2.addChildTask(parentTask4);
    
            parentTask2.addChildTask(new GanttTaskInfo(11, "Testing, QA", new Date(2010, 6, 21), 60, 100, "6"));
            parentTask2.addChildTask(new GanttTaskInfo(12, "Task B (Jim)", new Date(2010, 6, 8), 110, 1, "14"));
            parentTask2.addChildTask(new GanttTaskInfo(14, "Task A", new Date(2010, 6, 7), 8, 10, ""));
            parentTask2.addChildTask(new GanttTaskInfo(15, "Task C", new Date(2010, 6, 9), 110, 90, "14"));
    
            project1.addTask(parentTask1);
            project1.addTask(parentTask2);
    
            //project 2
            var project2 = new GanttProjectInfo(2, "Web Design", new Date(2010, 5, 17));
    
            var parentTask22 = new GanttTaskInfo(62, "Fill HTML pages", new Date(2010, 5, 17), 157, 50, "");
            parentTask22.addChildTask(new GanttTaskInfo(63, "Cut images", new Date(2010, 5, 22), 78, 40, ""));
            parentTask22.addChildTask(new GanttTaskInfo(64, "Manage CSS", null, 90, 90, ""));
            project2.addTask(parentTask22);
    
            var parentTask70 = new GanttTaskInfo(70, "PHP coding", new Date(2010, 5, 18), 120, 10, "");
            parentTask70.addChildTask(new GanttTaskInfo(71, "Purchase D control", new Date(2010, 5, 18), 50, 0, ""));
            project2.addTask(parentTask70);
    
            var ganttChartControl = new GanttChart();
            ganttChartControl.setImagePath("{!URLFOR($Resource.Timeline, 'codebase/imgs/')}");
            
            ganttChartControl.setEditable(true);
            
            ganttChartControl.addProject(project1);
            
            ganttChartControl.create(htmlDiv1);
        }
    </script>
    
    <style>
        body {font-size:12px}
        .{font-family:arial;font-size:12px}
        h1 {cursor:hand;font-size:16px;margin-left:10px;line-height:10px}
        xmp {color:green;font-size:12px;margin:0px;font-family:courier;background-color:#e6e6fa;padding:2px}
        .hdr{
            background-color:lightgrey;
            margin-bottom:10px;
            padding-left:10px;
        }
    </style>

    </head>

    <body onload="createChartControl('GanttDiv');">
        <div style="width:950px;height:620px;position:absolute;" id="GanttDiv"></div>
    </body>



</apex:page>