Destroy / Release store instance - extjs

I work in a navigation view. In this navigation view, you can stumble on a profile page.In this profile page you can see others profiles related to the current profile (basically pictures displayed in a dataview). You can navigate to other profile views by taping on these profiles.
Every time, the user click on a profile pictures, I create a new instance of the profile view and a new instance of the profile store.
Now, what I want to do, when the user goes back, (so when the view is popped) is delete the instance of the store associated to the instance of the profile view.
I already know when and how to delete the view, I just want to know how to delete the store and any reference to it.
Update : StoreManager
I just discovered the Ext.StoreManager.unregister function. Is it enough or is there something that should be done, to release the store (in order to free memory)?

Ext.getStore('storeId').destroy();
http://docs.sencha.com/touch/2-0/#!/api/Ext-method-getStore

Related

How to change the Read Access to the users on custom Visualforce page in Salesforce

The question is about the custom visualforce page in Salesforce. The page is created for getting contacts, opportunity, loans all are at a single dynamic link on the account named "Manage portal Access" Which comes under "Customer Portal Access" Tab like details and related list under "Account" Tab.The page was created to Manage the customer account, contacts and opportunities relationship. The page contains Email, Role, Last Login and a Toggle button as "Enabled".When this toggle button is enabled, those users have access to this portal relationship. It has respective apex class also.
The task here is, the toggle button can be enabled/disabled by some users, this want to be changed here by providing Read only access and assign two permission sets for edit access on this portal enable/disable.
" As a user I want Read Only Access to the portal tab. I want to be able to view all information on the tan and click through any dynamic links, but not be able to toggle the portal enable or un-portal enable any contacts. All Salesforce users should have a minimum of read only access to the Customer Portal Access Tab. The two permission below currently and should continue to provide edit access to the customer portal access section.
Create Customer Portal User
Document Manage Portal Admin "
Whether there is any customization option like providing access to objects in Salesforce through (Layouts, Fields FLS, Validation Rule)?
Or
-This can be achieved only through code on Visual force page and it's respective apex class, if this is the case how can I do it, whether there is any certain command or method for providing access or through controller class?
The "normal" object permissions (Create/Read/Update/Delete) and field level security (Read/Update) can be referenced in Visualforce. Something like this might be enough for you:
<apex:commandButton disabled="{!$ObjectType.Contact.fields.Role__c.updateable}">
Check the DescribeFieldResult in Apex reference. There's also something mentioned in VF developer guide but it's bit hidden and not as detailed: https://developer.salesforce.com/docs/atlas.en-us.234.0.pages.meta/pages/pages_variables_global_objecttype.htm
If you need more control than just whether field is editable or not - maybe look into Custom Permissions. They're your own checkboxes you add to Profile/Permission Set and you can check them in pure VF too, no apex required.
So... you decide. If most of the page is supposed to be identical, "just" about the button being enabled/disabled (or maybe even not rendered at all) - it's best to put the condition in the button. If it sounds like you need 2 different layouts - having 2 big blocks of code and one or another rendered might be cleaner to maintain and test.
P.S. Remember that good tester can activate the button using browser's developer tools. You should make similar "is field accessible / is custom permission assigned" check in Apex that runs on button click.

Redirect to Angular app

I tried google to search the answer but may be I am not asking the correct question.
My Scneario is, I have an angular app(APP1) with a grid. The grid has a link in one of its cell which points to an external asp.net web application(APP2). When the user clicks on the link he/she will be navigated to APP2, where they will perform some actions. Once done the user will click a button on APP2 which will save the data and generate an ID and Navigate back to APP1(angular app).I need to get hold of this id that is returned from APP2 and do some operations in APP1.
Let me know if its not clear what I am trying to do.
App1(angular)->App2/someparameter(asp.net webform app)->App1/id(angular)
How can I achieve this?

Data shows when page accessed from internally, but not on public site

I have been following the salesforce Recruiting App tutorial, and reached the section on creating a public site:
http://www.salesforce.com/us/developer/docs/fundamentals/Content/adg_composite_app_public_sites.htm
I have built a simple page to display open jobs as described here:
http://www.salesforce.com/us/developer/docs/fundamentals/Content/adg_composite_app_create_public_jobs_try_it_out.htm
This is displaying the open jobs correctly when I view it through our "internal" URL: https://c.ap1.visual.force.com/apex/PublicJobs
But when I view this same page through our "external" URL: http://servian-developer-edition.ap1.force.com/careers, the page still renders, except that now the list of jobs is empty.
I don't think this is a permissions error, as if so it would surely prompt me to log in. What do I need to do to make the data show on the "external" URL?
Make sure the "guest" user for the site has Read permission for the Positions object on its profile. You can't access the profile for the guest user through the normal Profile list page in Setup; instead, click on the Public Access Settings button from your site's detail page. On the profile, go all the way to the bottom of the page and make sure the Read permission is checked. If its still not working, ensure the Field Level Security settings also correct for that profile. The FLS settings are controlled about mid-way down on the same page.
In addition to above, ensure the object, if it is a custom object is in "Deployed" status. This fixed the issue for us.
Additional Information (from help.salesforce.com):
While developing a custom object or external object, you might not want users to see and interact with it. Because users might get frustrated with changes in layout or lose data when you delete custom fields, control visibility of the new object until you are finished.
Use the Deployment Status setting in the object definition to control when users can see and use the object and its associated custom tab, related lists, and reports.
Choose “In Development” as the Deployment Status when first creating your custom object or external object. Doing so hides it from users while you are designing and testing it. Only users with the “Customize Application” permission can see the object tab, search results, related lists, and report data types.
Change the Deployment Status to “Deployed” when you want to allow all users to use the object and any associated custom tab, related lists, and reports.
If you make more enhancements after deploying a custom object or external object, you can change the Deployment Status back to “In Development.”

Couldn't see the tab I created when I log in as another user (on Force.com Platform)

I was working one of the force.com coockbooks. I created a Mileage object and addes some features like workflows and etc (This is done after I log on as an admin in my developer force account). I then created another user(Standard user). And I wanted that user to use the Mileage object to create new Mileage. However, Mileage tab is not visible. I tried by making it visible to all users in Create Apps. But, still it is not visible (as a tab) to my new created user.
How should I make Mileage tab visible so that the new created user can use Mileage tab to create a new record?
Thank you.
To ensure a non admin user has rights to access the object-tab you're creating, you should:
Verify that the user's profile, as a minimum, has read access to the object (go to user's profile's setup screen and verify the "Custom Object Permissions" section)
Ensure that the object you're displaying in the tab is "deployed" (This is a simple property on your custom object definition called "Deployment Status")
In addition to these suggestions, it could be that the tab is hidden to the user. This could be taken care of as described in Ralph's answer.
There are two things you'll want to check
First, make sure the tab is visible to the profile you're logged in as. From documentation (login may be required):
Click Your Name | Setup | Manage Users | Profiles.
Select a profile.
Depending on which user interface you're using, do one of the following:
a. Enhanced profile user interface—In the Find Settings... box, enter the name of the tab you want and select it from the list, then click Edit.
b. Original profile user interface—Click Edit, then scroll to the Tab Settings section.
Specify the tab visibility.
(Original profile user interface only) To reset users’ tab customizations to the tab visibility settings that you specify, select Overwrite users' personal tab customizations.
Click Save.
This may take care of it. If the tab still isn't visible when you're logged in as the new user, click the '+' at just after the last tab and then click 'customize tabs'. Select the new mileage tab and add it to your app.

How do you restore the state between pages?

I have an app which gives me a score at the end of the game and I want the users to share their scores on facebook.
I want scoring information to be restored to the "end game" screen after the user has logged into facebook, and move to the facebook section of the panorama/pivot.
How do I go about this? Do I save that information to storage or to I use a variable in app.xaml.cs?
You should store this data in the page's State property in the OnNavigatingFrom or OnNavigatedFrom events of the page.
You can then access it again in the OnNavigatedTo event.
The situation you are handling is called tombstoning. Read more about it at http://msdn.microsoft.com/en-us/library/ff817008(v=vs.92).aspx

Resources