Lumipat Tingnan View Batay sa User ID Sa Isang Form InfoPath

Kami ay binuo ng isang InfoPath form na may maraming mga tanawin upang suportahan ang isang bagong hire / on-boarding process. When the company hires a new person, ang IT department at iba pang mga pangkat kailangang gumawa ng pagkilos (set up ng Payroll, paganahin ang access sa naaangkop na mga application, hanapin lamesa, at iba pa). We use on form but a different view of the form for each of those functions.

Sa kumpanyang ito, karamihan sa mga tao na kasangkot sa proseso ng negosyo ay mga IT-savvy, kaya kapag sila ay ma-access ang form, their default view is a "menu" view with buttons that direct them to their specific function. Gayunman, we needed to simplify things for the new hire’s direct manager. This person should not see any of the IT related stuff. Sa katunayan, dapat siya makita isa lang na view ng ang form at hindi kahit na magkaroon ng isang pagpipilian upang makita ang iba pang mga tanawin.

Sa aming kaso, na direct account manager ay direktang nakatali sa anyo ng kagandahang-loob ng isang makipag-ugnay sa selector (which I am always wanting to call a "people picker" para sa ilang kadahilanan).

Ang hakbang na ito ay ang mga sumusunod:

1. Sa mode na disenyo, pumunta sa Tools -> Form Options -> Buksan at I-save.

2. Select "rules".

3. Create a new rule whose action is "switch to view" at na ang kondisyon Pinakikinabangan ang username() tungkulin.

Username() returns the "simple" user name without the domain. If I log into SharePoint with credentials "domain\pagalvin", Username() 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 (sa aking kapaligiran pa rin) ay magbabalik ng mga domain at user ID, as in "domain\pagalvin". This prevents us from doing a straight-forward equality condition since AccountID ("domain\pagalvin") hindi kailanman ay magiging katumbas username() ("pagalvin").

We can get around this using the "contains" opereytor: AccountID ay naglalaman ng Username().

Maaari naming dalhin ito sa karagdagang at pre-pend isang hard-code na domain sa harap ng Username() gumana upang makakuha ng aming mga check-pantay at puksain ang panganib ng isang false positive sa ay naglalaman ng operator.

We would have REALLY like to automatically switch view for other users based on their AD security group membership. Halimbawa, when a member of the "IT Analytics" grupo-access ang 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", pumasa ito ang username() and return back true or false. Does anyone have any other, mas matalino ideya? Is there any SharePoint function we can leverage from InfoPath to make that determination?

</dulo>

Technorati Tags:

3 ano sa tingin mo "Lumipat Tingnan View Batay sa User ID Sa Isang Form InfoPath

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

-Iwan ng sagot

Ang iyong email address ay hindi nai-publish. Mga kinakailangang patlang ay minarkahan *