Athraigh Féach View Bunaithe ar Aitheantas Úsáideora I Foirm InfoPath

Bhí muid ar fhorbair foirm InfoPath le tuairimí éagsúla chun tacú le cíos nua / on-boarding process. When the company hires a new person, an roinn TF agus grúpaí eile is gá gníomh a ghlacadh (arna chur ar bun párolla, chumas rochtain ar iarratais chuí, aimsiú deasc, etc). We use on form but a different view of the form for each of those functions.

At this company, most of the people involved in the business process are IT-savvy, so when they access the form, their default view is a "menu" view with buttons that direct them to their specific function. Mar sin féin, we needed to simplify things for the new hire’s direct manager. This person should not see any of the IT related stuff. Go deimhin, ba chóir di a fheiceáil ach amháin ag féachaint ar an fhoirm agus nach bhfuil an rogha a fheiceáil na tuairimí eile, fiú.

I ár gcás, go bhfuil cuntas bainisteoir díreach ar ceangailte go díreach leis an bhfoirm caoinchead teagmháil roghnóir (which I am always wanting to call a "people picker" ar chúis éigin).

Is iad na céimeanna seo a leanas:

1. I modh a dhearadh, téigh go dtí Tools -> Foirm Roghanna -> Oscail agus Sábháil.

2. Select "rules".

3. Create a new rule whose action is "switch to view" agus ghiaráil a bhfuil riocht an ainm úsáideora() fheidhm.

ainm úsáideora() returns the "simple" user name without the domain. If I log into SharePoint with credentials "domain\pagalvin", ainm úsáideora() returns "pagalvin".

The contact selector provides three bits of information for a contact. The "AccountID" portion is most useful for this scenario. The only thing that makes this even a little bit of challenge is that the contact selector (in my environment anyway) returns the domain and user ID, as in "domain\pagalvin". This prevents us from doing a straight-forward equality condition since AccountID ("domain\pagalvin") will never equal userName() ("pagalvin").

We can get around this using the "contains" operator: AccountID contains userName().

We can take it further and pre-pend a hard-coded domain in front of the userName() function to get our equality check and eliminate the risk of a false positive on the contains operator.

We would have REALLY like to automatically switch view for other users based on their AD security group membership. Mar shampla, when a member of the "IT Analytics" group accesses the form, automatically switch to the IT Analytics view. We didn’t have time to implement it, but my first thought is to create a web service that would have a method like "IsMemberOfActiveDirectorySecurityGroup", pass it the userName() and return back true or false. Does anyone have any other, more clever idea? Is there any SharePoint function we can leverage from InfoPath to make that determination?

</deireadh>

Clibeanna Technorati:

3 smaointe ar "Athraigh Féach View Bunaithe ar Aitheantas Úsáideora I Foirm InfoPath

  1. Pingback: Infopath Switch View Based On User « Sladescross's Blog

Leave a Reply

Ní thabharfar do sheoladh r-phoist a fhoilsiú. Réimsí riachtanacha atá marcáilte *