function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
mikegiamikegia 

Native IPhone app access local data

Hello,

 

I am building an extension to the native salesforce Iphone application. Actually I am building a web tab that gets to save some fields of the opportunity line item. I have a problem though because it only saves them in the central salesforce database (instead of the local database of the Iphone). So I can only see the results of my saved object after it does syncing (which in some cases is as long as 10 minutes). Is there a way to have access to the local Iphone data and alter them using Web Tabs or some other way?

 

Thank you very much in advance.

Mike.

Best Answer chosen by Admin (Salesforce Developers) 
mikegiamikegia

Actually what I was referring to was not store data ouside the application. On  the contrary, store eg. the opportunity line item unit price, but not from thei user interface, but from mine (perhaps using some kind of slier to choose the new price. When syncing salesforce downloads the records in your iPhone and updates the new ones from the database. However it seems that building from scratch my own application is the most efficient and correct way to do it...

 

Thank you all..

All Answers

SporterSporter

Not with the Mobile CRM app, have a look at the Mobile SDK however for developing your own solution.

 

http://wiki.developerforce.com/MobileSDK

SporterSporter

Actually as a point I've never used a VF page in the mobile app, might offer a solution here but we'd need to wait for someone with more knowledge on that.

 

EDIT: It still won't give you access to data on the local device though but it might offer a better update solution.

mikegiamikegia

Thank you sporter..

mikegiamikegia

I contacted a salesforce person and told me that there is no way to save the information on the mobile device and that he didn;t know if I could do a sync now programmatically through apex code or visualforce.. Does anybody know if I can trigger a sunc now somehow without asking the user to do it manually?

 

Thank you very much,

Mike.

Matt D.ax1353Matt D.ax1353

There are several ways to save data as part of an iPhone app - User Preferences, files in your apps file system, Core Data, and a database framework called sqlite.  Any of those would allow you to write data from your app to a user's phone and retrieve it some other time.

 

However, it doesn't sound like the 'official' native app uses any local storage, so I don't think you can do this as an 'extension' -  you'd have to roll your own app from the ground up using native iOS.  You could use the Mobile SDK to connect a user to Salesforce, retrieve the data you want, format it, and store it.  You wouldn't necessarily need the user to prompt for a 'sync', but you probably want their permission at some point before storing data locally (also some feedback if the retrieval and formatting will take a long time).  Obviously, you'd also want to learn a lot about security in an iOS app - consider what would happen if that user's phone was stolen, etc.

mikegiamikegia

Actually what I was referring to was not store data ouside the application. On  the contrary, store eg. the opportunity line item unit price, but not from thei user interface, but from mine (perhaps using some kind of slier to choose the new price. When syncing salesforce downloads the records in your iPhone and updates the new ones from the database. However it seems that building from scratch my own application is the most efficient and correct way to do it...

 

Thank you all..

This was selected as the best answer