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
divya bharati 5divya bharati 5 

How to differetiate the Objects data in applications.

Hi All,

I am new to the salesforce, I have one query.i have two Apps namely ABC and XYZ. and Account object on both these apps.
how to fetch Account records based on only ABC app not XYZ.

Thanks
Divya. 
Best Answer chosen by divya bharati 5
Apoorv Saxena 4Apoorv Saxena 4
Hi Divya,

Apps are a collection of objects and  Objects are a collection of data.If you have some objects that all work together in a business process you can group those together under an an App.
Now coming to your question, there is no standard way here to fetch record based on your app.

But here's a workaround, you can use a picklist field for Account object record that will hold the list of all App you've set up and while filling in the details for the record you could easily set that this record belongs to which App using that field.

Hope this helps!

Please mark this question as Solved if this answers your query so that other could also be benefitted from it and view it as a proper solution.

Thanks,
Apoorv

All Answers

Apoorv Saxena 4Apoorv Saxena 4
Hi Divya,

Apps are a collection of objects and  Objects are a collection of data.If you have some objects that all work together in a business process you can group those together under an an App.
Now coming to your question, there is no standard way here to fetch record based on your app.

But here's a workaround, you can use a picklist field for Account object record that will hold the list of all App you've set up and while filling in the details for the record you could easily set that this record belongs to which App using that field.

Hope this helps!

Please mark this question as Solved if this answers your query so that other could also be benefitted from it and view it as a proper solution.

Thanks,
Apoorv
This was selected as the best answer
divya bharati 5divya bharati 5
Hi Apporva thanks for your reply. I not worked on live environment. if i am trying  to update the Account records it is reflecting to the all data of Accont object.Just want to check how to update account object for particular app in live environment. 

Thanks
Divya
Apoorv Saxena 4Apoorv Saxena 4
Hi Divya,

Until you've implemented the workaround that I've suggested above, you cannot differentiate between whether this Account record belongs to ABC app or XYZ app. Once you've implemented the workaround all records have the picklist field filled, i.e some records would be having value set as 'ABC' and some will be having value set as 'XYZ' for that field then you can easily get the Account records based on your App using a SOQL query something like this:

Select id,name from Account where App__c = 'ABC';

Here App__c is a custom picklist field on Account record that will reflect with which App the account is related.

Hope this helps!
divya bharati 5divya bharati 5
Thank You Appoorv,And could you please let me know the steps need to be taken care for working on real time projects.
Now i just completed Admin and development training. i have created apps classes and triggers in the free edition,what is the difference when comes to real time scenario.And we have to write apex class in realtime scenario is it in Sandox or in production.