Tuesday 9 April 2019

SharePoint Interview Questions - 2

1. How to get two lists data whereas one column details same in another list by rest api?
list1, list2

Ans:    url: _spPageContextInfo.siteAbsoluteUrl + "/_api/web/lists/GetByTitle('" + listName + "')/items?$Select=Title,EmployeeName,Salary,Dept/Title,Dept/Code&$expand=Dept",
            type: "GET",

2. Managed metadata navigation in SharePoint online?

Ans: Managed navigation lets you define and maintain your site navigation by using term sets. With managed navigation, it's not the location of your content that defines where in the navigation your content will appear, but how you tag your content with terms from a term set.

3. How to get Tasks list data of all sub sites in site collection?

Ans:  We can fetch by Content query web part. or Content search webpart


4. Difference between Remote Event Receiver and Event Receiver?
Remote Event Receiver:
1.A provider hosted app is must, which means you need additional infra 
2.Works using web services, you expose web services on your provider hosted app, 
3.that are called when an event is fired.
Only Client Object Model is available inside the 4.event receiver code, so you'll be limited by CSOM's limitations. 
5.This is the only option to override events if you have O365/SharePoint online. 
6.Using this approach makes your code future safe, when SOM is killed finally. 
7.This is the list of events available to override.

Event Receivers
1.No additional infra required to host event receiver code.
2.Works using code running in context of W3WP.exe in case of farm solutions and spucworkerprocess.exe in case of SandBox solutions.
3.Full fledged SOM API is available in case of farm solutions, no limits.
4.This is only available in On-Premises environment.
5.This might be deprecated or unsupported in future releases.
6.This is the list of events available to override in SER


5. Difference between STSADM and Poweshell commands, SharePoint online management shell.
  • STSADM and Powershell can be used to administer the SharePoint environment
  • registry operations are not supported
Powershell:
  • easily play around with system registry
  • PowerShell is Microsoft’s next-generation scripting language offering direct access to .NET objects, complex flow and structure capabilities
  • We can maniplulate 500 out-of-the-box cmdlets or by creating custom cmdlets. Management Shell is just a PowerShell instance that loads the sharepoint.ps1 script file.
SharePoint online management shell:
you can display all available SharePoint Online cmdlets using the command
Command: Get-Command *-SPO*
6. Difference between Site definition and Site template

7. What is App?
  Easy-to-use, stand-alone applications that perform tasks or address specific business needs.
  You can add apps to your site to customize it with specific functionality or to display information

       1. We can add App from your organization’s App Catalog 
       2. You can also buy apps from third-party developers by browsing the SharePoint store

Please make sure do SSL Enabled = "False" before deploy in solution properties(VS)
8. Diff between SharePoint hosted app and provider hosted app
9. Difference between App web url and Host web URL?

App web url:
  • SharePoint site where our app will deploy.
  • App Web domain contains main domain as well as App Hash URL ( Random Unique ID ).
  • After Every deployment it will change.
Host web url:
  • SharePoint site where our app will install. It always be a specific domain name.
  • It is Main Site of subweb (App Web).
host web, is installed on a host website at the following URL: https://ourserver.sharepoint.com/sites/marketing The app for SharePoint will be deployed to app web with a URL like the following: https://ourserver-edff2019ea6dacb.sharepoint.com/sites/marketing Notice that the app web URL contains the App ID (edf2019ea6dacb), which is a hexadecimal number generated when the app is installed.
11. What is Client id, Client Secret, IssuerID?
Client ID/Client Secret: The client ID is the one which is unique for every Provider Hosted Applications.
And the PowerShell Script to register this ClientID
The same can be done by the Site as well. 1. Go to the http://sitecollection/_layouts/15/appregnew.aspx 2. Enter the Values and click on the Generate.
3. Client ID need to add in web.config and AppManifest.xml
Issuer ID: This ID is the one which should be included on our Web.Config only of the Provider Hosted Applications

11. What is Tenant?

Tenant is a web application.
Who is have admin rights on web application level,
He can manage site collections, Ownership.
He can manage external sharing.
He can manage storage allocation.
He can manage external Taxonomy metadata across site collection.
10. Cross Domain call in sharepoint apps?
  1.  Javascript library SP.RequestExecutor.js located in layouts directory
  2. that(SP.RequestExecutor.js) can be referenced in client-side code that runs in the app domain that allows
  3. the remote app to successfully access data on the host web
11. What is IFrame in sharepoint App?
 IFrame is client side library
We are sending request from IFrame through out AppwebProxy.aspx in the run server side code.
 --> go to developer toll (f12)
--> Find Iframe 
--> it is loading a page calling appwebproxy.aspx
--> request are running on the server
12. What is Chrome control?
13. What is Cross domain calls in sharepoint App?
14. What is SP.Requestexecutor,Js?
from hostapp url_layouts/15
Once sp.requestexecutor,js is loaded then we can start executing our code
15. How does SharePoint trust your server side code?
  1. S2S (Server to Server trust)
  2. OAuth
16. What is concept of IssueID and clientID?


117. If A person given the solution to B person Can he able develop that solution in his machine?
Ans: 
18. If b person change the appid client sectret what are he needs to change in bottom of appreg.aspx??
Ans:  We need to generate Client id, Client Secret and  fill in “App Domain” and “Redirect URL”. In fact, this is the website where the app is hosted.
How many list items we can fetch from list and show on grid?
We can fetch many but can view on 5000
If list items 20000 can we fetch those items by jsom??
Yes
How many items we can fetch by rest api?
100 items
How to disable all inputs by jqurey
Ex. $(input)
Loop it get the all id's and set up disable the control
How to ename column that sp lookup volume by caml qurey?
<Query> <Where> <Eq> <FieldRef Name='RefCountry' /> <Value Type='Lookup'>India</Value> </Eq> </Where> </Query> To query by ID you have o setup LookupId='TRUE' attribute of FieldRef element <FieldRef Name='RefCountry' LookupId='TRUE' />


Provider hosted app


Business object layer in c# programming in web application development 
Enabling or Disabling Claims Based Authentication
Logging using SharePoint server object model
Filter by start and end dates using 'today'
catch (Exception ex)
{
    SPDiagnosticsService.Local.WriteTrace(0, new SPDiagnosticsCategory("My Category", TraceSeverity.Unexpected, EventSeverity.Error), TraceSeverity.Unexpected, ex.Message, ex.StackTrace);
}
How to Create Users and bulk users in Office 365?

1. Active users - normal we can add as add user with details firstname, lastname.
2. Bulk users we can add by download csv and put the names with mail id's and then upload it.

Who is External users in Office 365?

1. Authenticated External Users
There are two main groups:

A. Existing authenticated external users:
Users who are already in your Office 365 user directory. For example, users who have previously accepted a sharing invitation or users who you have imported from another Office 365 or Azure Active Directory tenant. 
They are required to log into your system before accessing shared content.
B. Ad-hoc external users:
They are asked to verify their identity with a one-time code sent to their email. Since they are not required to log in, they don’t need a Microsoft account.
2. Anonymous External Users
These are external users who access your content via a link, so they don’t need to log in. Anonymous sharing is rather tricky since you can’t identify the person who opens up the link.

How to add external users(external sharing) in SharePoint online?

4 ways to setup external users in SharePoint.



What are levels of Office 365 external sharing?

You can granularly control how to apply the settings above to different services inside your Office 365:

SharePoint Online
Tenant level – settings located in the SharePoint admin center under Sharing
Site collection level – settings located in the SharePoint admin center under Site collections
OneDrive – settings located in the OneDrive admin center under Sharing
Office 365 Groups – settings located in the Office 365 Admin center under Settings > Services & add-ins, where you will find the Office 365 Groups.

How to control external sharing in the Office 365 admin center?

Link

1. go to admin centre
2. go to sites
3. select site and double click site url settings popup will come.
4. you can see Sharing Status.
5. there we can allow the external sharing yes(Let people Outside of Organisation).
6. So that team site would be able to access external users.(Allow your users send link to outside of organisation users)