• michael.vo
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 1
    Replies
I need to get records between a specific time period in a push topic. For example all records between 6pm and 2am. 

Select Id from Opportunity where dateTime >= {Today's Date @ 6pm} and dateTime <= Tomorrow's Date @ 2am}

Is this possible?

I have one solution which is to just pull all today's and tomorrow's records and then filter on the client side by the right time.

http://www.salesforce.com/us/developer/docs/officetoolkit/Content/sforce_api_calls_soql_select_dateformats.htm

Anyone else have a solution to this?
In the init.js of raja's angularjs mobile pack the smartstore property of navigator is null on ipad device and safari:

if (navigator.smartstore) {
SFConfig.dataStore = new Force.StoreCache('sobjects', [
            {path: 'Name', type: 'string'},
            {path: 'attributes.type', type: 'string'}
        ], 'Id');

        SFConfig.dataStore.init();
 }

Is there another property I have to initialize before this?

Also what is the following commented out code doing?

//Uncomment below and set accessToken(= sessionId), instanceUrl and proxyUrl to test smartstore (mock version - coz real smartstore is part of cordova)
// inside the browser
//initApp({
//    accessToken: '00Di0000000JEm3!AQ4AQLnaKs7PPHaRd0xjvJwJkf6O.9R7ECpU5mndDb1DwYsoxhMDrCyEag.5Ws_HFI5fY.9fYgsQ_4F1D5vXltKmK5b7guCK',
//    instanceUrl: 'https://na15.salesforce.com',
//    proxyUrl: 'http://localhost:3000/proxy/'
//});

 

I have the following custom controller class. I get the error when I have 50 or more records and it works fine with less than 50. In the constructor I do this:

 

public Constructor {

 

filteredOpportunities = [select zone__c, Opportunity.Account.Last_Name__c, Opportunity.Account.First_Name__c, SortReservationTime__c, restaurant__c, Covers_Purchased__c, Reservation_Time__c, name, Reservation_note__c, id, AVTablenumber__c, coatcheck__c, primary_acct_name__c, notes__c, c_s_d__c, coversdined__c, numberOfTaxisNeeded__c, time_arrive__c, time_sat__c, time_finished__c, no_show__c, aviary_ticket__c, tix_site_total_price__c from opportunity where Date__c = TODAY and Opportunity.RecordType.name = 'Reservation' and Covers_Purchased__c > 0 and restaurant__c = 'Aviary' Order By SortReservationTime__c ASC, Opportunity.Account.Last_Name__c ASC];

 

for (Opportunity opp : filteredOpportunities) {

    filteredOpportunityWrappers.add(new OpportunityWrapper(opp)); }

 

this.controller = new ApexPages.StandardSetController(this.filteredOpportunities);

 

 

 

 

 

It takes about a minute to open the edit screen after clicking on the edit button for an opportunity.

 

What is going on under the hood? (how does it store it on the mobile device, is it making a call to salesforce.com)

 

How can I fix this? Is there an offline mode for data storage?

I need to get records between a specific time period in a push topic. For example all records between 6pm and 2am. 

Select Id from Opportunity where dateTime >= {Today's Date @ 6pm} and dateTime <= Tomorrow's Date @ 2am}

Is this possible?

I have one solution which is to just pull all today's and tomorrow's records and then filter on the client side by the right time.

http://www.salesforce.com/us/developer/docs/officetoolkit/Content/sforce_api_calls_soql_select_dateformats.htm

Anyone else have a solution to this?
In the init.js of raja's angularjs mobile pack the smartstore property of navigator is null on ipad device and safari:

if (navigator.smartstore) {
SFConfig.dataStore = new Force.StoreCache('sobjects', [
            {path: 'Name', type: 'string'},
            {path: 'attributes.type', type: 'string'}
        ], 'Id');

        SFConfig.dataStore.init();
 }

Is there another property I have to initialize before this?

Also what is the following commented out code doing?

//Uncomment below and set accessToken(= sessionId), instanceUrl and proxyUrl to test smartstore (mock version - coz real smartstore is part of cordova)
// inside the browser
//initApp({
//    accessToken: '00Di0000000JEm3!AQ4AQLnaKs7PPHaRd0xjvJwJkf6O.9R7ECpU5mndDb1DwYsoxhMDrCyEag.5Ws_HFI5fY.9fYgsQ_4F1D5vXltKmK5b7guCK',
//    instanceUrl: 'https://na15.salesforce.com',
//    proxyUrl: 'http://localhost:3000/proxy/'
//});

 

I have the following custom controller class. I get the error when I have 50 or more records and it works fine with less than 50. In the constructor I do this:

 

public Constructor {

 

filteredOpportunities = [select zone__c, Opportunity.Account.Last_Name__c, Opportunity.Account.First_Name__c, SortReservationTime__c, restaurant__c, Covers_Purchased__c, Reservation_Time__c, name, Reservation_note__c, id, AVTablenumber__c, coatcheck__c, primary_acct_name__c, notes__c, c_s_d__c, coversdined__c, numberOfTaxisNeeded__c, time_arrive__c, time_sat__c, time_finished__c, no_show__c, aviary_ticket__c, tix_site_total_price__c from opportunity where Date__c = TODAY and Opportunity.RecordType.name = 'Reservation' and Covers_Purchased__c > 0 and restaurant__c = 'Aviary' Order By SortReservationTime__c ASC, Opportunity.Account.Last_Name__c ASC];

 

for (Opportunity opp : filteredOpportunities) {

    filteredOpportunityWrappers.add(new OpportunityWrapper(opp)); }

 

this.controller = new ApexPages.StandardSetController(this.filteredOpportunities);