Populate current user display name in a text box in SharePoint 2013 - sharepoint-2013

I have created one custom list and customize it using Info path 2013.I have created data connection using User profile service UserprofileByName.I added one text box in which i want show the current user's display name(e.g. Das, Aditi).The name should populate when user open the form in SharePoint 2013.So I set the default vale of text box as "Value(Name=PreferredName)".
But this is not working.
Please help me to configure out this.
Thanks

You can find good step by step instruction how to achieve this on MSDN (Including User Information section).
One possible reason why your current code does not work could be that you didn't put "Automatically retrieve data when form is opened" in data connection to user profile service. Id you don't put it then you need to add additional rule to FormLoad event to query service.

Related

How to set Sharepoint column value from Azure Active Directory AAD

So I am creating a list of Sharepoint for the first time. I want the column dropdown value instead of adding all users name manual, I want the list to get them from Azure Active directory.
Sharepoint:
Azure Active Directory:
Is there any direct way to accomplished or it requires a connector between them?
I don't see any direct way but a solution could be to write a PowerShell script or some sort of console app that executes on a schedule and consumes graph API endpoint to get users information and populates a particular (custom) list in your SharePoint site. Then you can create a lookup column in desired list that looks up user information in your users list.

Managing Users in Oracle APEX

I want to create multiple users in Oracle APEX so when they log in they can see and edit only reports and data they have created while they were logged in with their username. Administrator can menage with all data of all users, but users only their own data. How can that be done in APEX?
You could create an application item in Shared Components, and populate it with 'Y' when they are an administrator during either post-authentication process in your authentication scheme, or an after-authentication computation.
Then include the following in your where clauses.
where (created_by = :APP_USER or :F_ADMIN = 'Y')
First you need to be able to identify if an user is either an "End user" or an "Administrator". To do this so, I would recommend you to use your own authentication scheme (http://www.developapex.com/2018/04/custom-authentication-scheme-on-oracle.html) or you could adapt your APEX Access Control which I'm assuming you're using.
The last option is more advanced and you can use this link to start with: https://blogs.oracle.com/apex/custom-authentication-and-authorization-using-built-in-apex-access-control-a-how-to
Once you can identify the user's information, you can modify your SQL logic to add a WHERE clause which will filter to return only rows that were created by a specific user (:APP_USER returns the current user) or return every row if it's an administrator. Exactly as #Scott said.

how to pass login credentials between pages in oracle apex?

I am creating a banking application using oracle apex. once the user have logged in using his customer id in page 2, his account details table should be displayed in the next page. I've tried with
select acc_no, bal from acc_details where cust_id= :P2_USERNAME
but I'm getting 'NO DATA FOUND'.
is this the correct way to do this? I've tried to use branches too. That was also not working.
On your first page, under the "Behavior"(APEX 5)/"Action When Button Clicked"(APEX 4) attribute of your log in button set "Action" to "Redirect to page in this Application". Then set the Target page number. Under that, you'll see the 'Set Items' part. Fill up that part by setting the "Name"(APEX 5) / "Set these Items"(APEX 4) with :P2_USERNAME and then "Value"(APEX 5)/ "With these Values"(APEX 4) with :P1_USERNAME. Get rid of the "branches" that you've created before or disable them at least for now.
if your user login name and userid is same (like email address)
you may use
apex_authentication.get_login_username_cookie
for getting username/user id at each page
or you can create an application item in shared component and assign user id to this item as
:MY_APP_ITEM := 'Hello';
after login and call it from all pages
Have you tried using :APP_USER? If that didn't work you could try creating an Application item as a value container for your cust_id. Just go to Shared Components >> Application Items then create an item. This way you could reuse the value on the application item until your session expire or you clear its value.
Say you've created an Application Item named "G_CUST_ID", you want to store your cust_id's value to G_CUST_ID. Create a PL/SQL process on your log in page and write the code below:
apex_util.set_session_state('G_CUST_ID', :P2_USERNAME);
The value set on G_CUST_ID will reset automatically on session expire. Don't forget to reset the value manually on Log Out.
apex_util.set_session_state('G_CUST_ID', NULL);

how to customize publish action - sitecore

I created a user in sitecore with 2 roles assigned to him i.e author and publisher
When this user who is both author and publisher creates any content he shouldn't be able to publish it.
Can i overwrite the publish action? check on the user who submitted the content and the roles he is assigned to and restrict him with a popup message or something like that? Any help is appreciated.
Thanks.
Follow the below steps to write custom publish actions
For customizing the publish action, Write a c# class and inherit
Sitecore.Shell.Applications.Dialogs.Publish.PublishForm.There
are override methods like ActivePageChanged and OnNext. You can
basically overwrite those classes and write your own alerts with
Sitecore.Web.UI.Sheer.SheerResponse like shown below.
SheerResponse.Alert("The current item will not be published.Please
select both staging and web database to publish the HOME item.");
Copy the Publish.xml file from (your
siteroot/)/sitecore\shell\Applications\Dialogs\Publish.
Create "sitecore\shell\Override\Applications\Dialogs\publish" in root of website
Paste publish.xml in the following folder in root of your site "sitecore\shell\Override\Applications\Dialogs\publish"
Open publish.xml file and modify the Wizard tag
CodeBeside="Sitecore.Shell.Applications.Dialogs.Publish.PublishForm,Sitecore.Cli
ent"
to
CodeBeside="your Class Name with name space here,your Assembly name"
Here is screenshot of how publishoverride form should look like

How can I use SharePoint Web Services to determine if a user has a document checked out?

(Note I need a solution for this that works on 2007 and 2010)
We have a desktop application that we are adding Sharepoint Check in and out functionality to using the Web Services.
One issue we are coming up against is determining if the current user (of the desktop app) has a document checked out.
Our current approach is to get information about the document in question via Lists GetListItems call which will return us the ows_CheckoutUser field if the document is checked out.
We then want to compare the name of the check out user to the name of our user.
The problem is the name in ows_CheckoutUser seems to be the display name of the user and not the account name and therefore is not unique and not reliable for this check.
I noticed that ows_CheckoutUser also returns an ID value for the user but I can't seem to find out how to get the ID of my current user so I can compare on that instead.
Does anyone have any thoughts on this? Is this the right way to go about it or is there a better way?
I have thought about trying to run a query via GetListItems that would match on the document name and the checkout user equals my current user to see if I get any results back but I think that would suffer from the same problem.
Or maybe I need to go outside the Web Services and use the author.dll?
Edit
I've started going down the route of using an RPC call to getDocsMetaInfo via the Author.dll FP extension.
This call actually gives you the account name of the user that has the document checked out.
I'd still be interested in a solution using the Web Services however
Not sure what the native reply of sharepoint but I suppose it should be the same as when using the Camelot .NET Connector for SharePoint.
You have a few fields which possibly can hold this info
CheckedOutUserId, ID of the User who has the item Checked Out (Lookup)
IsCheckedoutToLocal, (Lookup)
CheckoutUser, Checked Out To (User)
CheckedOutTitle, Checked Out To (User) -
LinkCheckedOutTitle, Checked Out To (Computed)
It actually is LinkCheckedOutTitle that contain the visual reference to the user who checked the document out. In my case it's listed as trikksdomain\trikks, or if a localadmin checked the doc out its machine\administrator.
Here is a SharePoint 2010 Document Library Column Reference guide. http://www.bendsoft.com/download.php?id=b05c062a401cf8bc221ea5df63cc9570