• Harry Dhanoa
  • NEWBIE
  • 30 Points
  • Member since 2013

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

Am trying to create a native mobile app in SF.

Started with the trailhead :-
https://trailhead.salesforce.com/trails/mobile_sdk_intro/modules/mobile_sdk_native_ios/units/mobilesdk_ios_getting_started

Successfully finished all the steps on my macbook until I hit this command:-

forceios create
Application type    native
Application name    MyTrailNativeApp
Package name    com.mytrail.ios
Organization name    MyApps, Inc.
Output directory    TrailiOSApps

The Output is:-

********************************************************************************
*
*   Creating ios native application using Salesforce Mobile SDK
*     with app name:        MyTrailNativeApp
*          package name:    com.mytrail.ios
*          organization:    MyApps, Inc.
*   
*     in:                   TrailiOSApps
*   
*     from template repo:   https://github.com/forcedotcom/SalesforceMobileSDK-Templates#v5.1.0
*          template path:   iOSNativeTemplate
*
********************************************************************************

/Users/harpritdhanoa/Documents/mobileAppsSF/MyReact/ios/TrailiOSApps /Users/harpritdhanoa/Documents/mobileAppsSF/MyReact/ios
Installing npm dependencies
npm notice created a lockfile as package-lock.json. You should commit this file.
up to date in 1.307s
Installing pod dependencies
Update all pods
Updating local specs repositories
Analyzing dependencies
Fetching podspec for `SalesforceAnalytics` from `node_modules/SalesforceMobileSDK-iOS`
[!] No podspec found for `SalesforceAnalytics` in `node_modules/SalesforceMobileSDK-iOS`


[!] Automatically assigning platform ios with version 9.0 on target MyTrailNativeApp because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
/Users/harpritdhanoa/Documents/mobileAppsSF/MyReact/ios
forceios failed

Command failed: pod update

I googled a lot but could not find anything relevant online, hence thought I ask the gurus out here.
Any help would be appreciated.

-Harry

Hi,

I wrote a custom button that call a class to insert a pdf in chatter feed of a Custom Object.

This was successfully done with the code snippet below:-

 

global class  ImportFileToSF { 

  Webservice static String  uploadPDF(Id testId) { 

    Boolean isAnUpdate = false;

    Http h = new Http(); 

    HttpRequest req = new HttpRequest(); 

    string url = 'http://www.salesforce.com/us/developer/docs/daas/salesforce_migration_guide.pdf'

    url = url.replace(' ', '%20'); req.setEndpoint(url); 

    req.setMethod('GET'); 

    req.setHeader('Content-Type', 'application/pdf;'); 

    req.setCompressed(true); 

    req.setTimeout(120000); 

    HttpResponse res = null

    res = h.send(req); 

    blob file = res.getBodyAsBlob(); 

    blob oldFile = null;

  

    FeedItem post = new FeedItem();

    post.ParentId = testId;

    post.ContentData = file;

    post.ContentFileName = 'SF migration.pdf';

    post.CreatedById = '005E0000000i4VFIAY';

    post.Type='ContentPost';

    post.Visibility = 'AllUsers';

    

    insert post;

  }    

}

Now the requirement is when I click the button again a new version of that document should be inserted.

Could some one give me a code snippet that does the job?

 

Hello,

Am trying to create a native mobile app in SF.

Started with the trailhead :-
https://trailhead.salesforce.com/trails/mobile_sdk_intro/modules/mobile_sdk_native_ios/units/mobilesdk_ios_getting_started

Successfully finished all the steps on my macbook until I hit this command:-

forceios create
Application type    native
Application name    MyTrailNativeApp
Package name    com.mytrail.ios
Organization name    MyApps, Inc.
Output directory    TrailiOSApps

The Output is:-

********************************************************************************
*
*   Creating ios native application using Salesforce Mobile SDK
*     with app name:        MyTrailNativeApp
*          package name:    com.mytrail.ios
*          organization:    MyApps, Inc.
*   
*     in:                   TrailiOSApps
*   
*     from template repo:   https://github.com/forcedotcom/SalesforceMobileSDK-Templates#v5.1.0
*          template path:   iOSNativeTemplate
*
********************************************************************************

/Users/harpritdhanoa/Documents/mobileAppsSF/MyReact/ios/TrailiOSApps /Users/harpritdhanoa/Documents/mobileAppsSF/MyReact/ios
Installing npm dependencies
npm notice created a lockfile as package-lock.json. You should commit this file.
up to date in 1.307s
Installing pod dependencies
Update all pods
Updating local specs repositories
Analyzing dependencies
Fetching podspec for `SalesforceAnalytics` from `node_modules/SalesforceMobileSDK-iOS`
[!] No podspec found for `SalesforceAnalytics` in `node_modules/SalesforceMobileSDK-iOS`


[!] Automatically assigning platform ios with version 9.0 on target MyTrailNativeApp because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
/Users/harpritdhanoa/Documents/mobileAppsSF/MyReact/ios
forceios failed

Command failed: pod update

I googled a lot but could not find anything relevant online, hence thought I ask the gurus out here.
Any help would be appreciated.

-Harry
Hello,

Am trying to create a native mobile app in SF.

Started with the trailhead :-
https://trailhead.salesforce.com/trails/mobile_sdk_intro/modules/mobile_sdk_native_ios/units/mobilesdk_ios_getting_started

Successfully finished all the steps on my macbook until I hit this command:-

forceios create
Application type    native
Application name    MyTrailNativeApp
Package name    com.mytrail.ios
Organization name    MyApps, Inc.
Output directory    TrailiOSApps

The Output is:-

********************************************************************************
*
*   Creating ios native application using Salesforce Mobile SDK
*     with app name:        MyTrailNativeApp
*          package name:    com.mytrail.ios
*          organization:    MyApps, Inc.
*   
*     in:                   TrailiOSApps
*   
*     from template repo:   https://github.com/forcedotcom/SalesforceMobileSDK-Templates#v5.1.0
*          template path:   iOSNativeTemplate
*
********************************************************************************

/Users/harpritdhanoa/Documents/mobileAppsSF/MyReact/ios/TrailiOSApps /Users/harpritdhanoa/Documents/mobileAppsSF/MyReact/ios
Installing npm dependencies
npm notice created a lockfile as package-lock.json. You should commit this file.
up to date in 1.307s
Installing pod dependencies
Update all pods
Updating local specs repositories
Analyzing dependencies
Fetching podspec for `SalesforceAnalytics` from `node_modules/SalesforceMobileSDK-iOS`
[!] No podspec found for `SalesforceAnalytics` in `node_modules/SalesforceMobileSDK-iOS`


[!] Automatically assigning platform ios with version 9.0 on target MyTrailNativeApp because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
/Users/harpritdhanoa/Documents/mobileAppsSF/MyReact/ios
forceios failed

Command failed: pod update

I googled a lot but could not find anything relevant online, hence thought I ask the gurus out here.
Any help would be appreciated.

-Harry
Hi,

I am an administrator in a sandbox, and i have created a community without adding myself as a member. Since the release of Spring 2015:
Release notes:
"salesforce_spring15_release_notes" says "Updating Community Administration Settings Requires Community Membership" on page 13.

Hence, though i created the community and am administrator on the sandbox, i cannot access the community administration settings.

 

Hi,

I wrote a custom button that call a class to insert a pdf in chatter feed of a Custom Object.

This was successfully done with the code snippet below:-

 

global class  ImportFileToSF { 

  Webservice static String  uploadPDF(Id testId) { 

    Boolean isAnUpdate = false;

    Http h = new Http(); 

    HttpRequest req = new HttpRequest(); 

    string url = 'http://www.salesforce.com/us/developer/docs/daas/salesforce_migration_guide.pdf'

    url = url.replace(' ', '%20'); req.setEndpoint(url); 

    req.setMethod('GET'); 

    req.setHeader('Content-Type', 'application/pdf;'); 

    req.setCompressed(true); 

    req.setTimeout(120000); 

    HttpResponse res = null

    res = h.send(req); 

    blob file = res.getBodyAsBlob(); 

    blob oldFile = null;

  

    FeedItem post = new FeedItem();

    post.ParentId = testId;

    post.ContentData = file;

    post.ContentFileName = 'SF migration.pdf';

    post.CreatedById = '005E0000000i4VFIAY';

    post.Type='ContentPost';

    post.Visibility = 'AllUsers';

    

    insert post;

  }    

}

Now the requirement is when I click the button again a new version of that document should be inserted.

Could some one give me a code snippet that does the job?

 

Hey everyone.

 

I'm running a controller extension of the Opportunity Standard Controller being used across 3 pages.

 

On Page 1, I have an outputfield of all fields that get used on Page 1 - 3 that are rendered false (to accomodate the SOQL Query method used by visualforce).

 

In my controller extension I have a method that uses one of these fields and returns a list of strings. If I load each page separately (via URL not using Page References) it works perfectly. However, if I use any of my page references to move from Page 1 to 2 I get:

 

System.SObjectException: SObject row was retrieved via SOQL without querying the requested field: Opportunity.New_Contract_Start_Date__c

 

Class.OpportunityPAWizardExtension.getInvoiceDates: line 80, column 43
Class.OpportunityPAWizardExtension.<init>: line 11, column 9
External entry point

 

I know there's values for the fields on using. It's the same Opportunity ID that used between the page references, although I do have the redirect set to true (one of the references is in the apex page and without redirect true I get an invalid root component error).  The method causing the error doesn't use any user input just calculates some difference between dates for a list of invoice dates.

 

Code giving me the errror it errors online 2 when I call the New Contract Start Date Field:

Opportunity Opp = (Opportunity)controller.getRecord(); date StartDate = date.valueof(Opp.New_Contract_Start_Date__c); date EndDate = date.valueof(Opp.New_Contract_End_Date__c);

 

So why does this work on all 3 pages called separate, but breaks when using a page reference? I thought it might have to do with the SoQL error, but I check and I have both the fields listed above on the pages. So the standard controller would query them right?