Solusyon sa Problema: “FileNotFoundException” Sa My Tampok Tatanggap.

I was working on a feature last week that would add some event receivers to a specific list instance. (I-blog nang kaunti tungkol sa receiver na listahan dito).

Gamit ang command line, Maaari ko bang i-install ang tampok na walang error (ngunit tingnan sa ibaba para sa mga nakatagong error). When I tried to deploy the feature on the site, MOSS complained of a "FileNotFoundException" mali. This blog entry describes how I solved it.

Ito ang error na Moss ay nagpakita sa akin sa web browser:

Feature ‘b2cb42e3-4f0a-4380-aaba-1ef9cd526f20’ could not be installed because the loading of event receiver assembly "xyzzyFeatureReceiver_0" Nabigo ang pag-: System.IO.FileNotFoundException: Could not load file or assembly ‘xyzzyFeatureReceiver_0’ o isa sa mga dependency. Ang sistema ay hindi maaaring mahanap ang tinukoy na file.
Ang pangalan ng file: ‘xyzzyFeatureReceiver_0’
at System.Reflection.Assembly.nLoad(AssemblyName filename, String codebase, Katibayan assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Katibayan assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(String assemblyString, Katibayan assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(String assemblyString)
at Microsoft.SharePoint.Administration.SPFeatureDefinition.get_ReceiverObject()
WRN: Assembly nagbubuklod na pag-log ay naka-OFF.
Upang paganahin ang assembly magbigkis pagkabigo na pag-log, itakda ang mga registry value [HKLM Software Microsoft Fusion!EnableLog] (DWORD) upang 1.
Nota: Mayroong ilang mga pagganap ng multa na nauugnay sa assembly na pag-log magbigkis pagkabigo.
Upang i-on ang tampok na ito off, alisin ang mga registry value [HKLM Software Microsoft Fusion!EnableLog].

I-troubleshoot ang mga isyu sa Windows SharePoint Serbisyo.

Alam ko kung paano i-sadya maging sanhi ang error na iyon: don’t install the assembly in the GAC. Pero, it was in the GAC. I normally install assemblies into the GAC by dragging them into the c:\windows\assembly folder using windows explorer. I’ve never felt 100% komportable paggawa na dahil ako palaging naisip gacutil na umiral para sa isang dahilan … so I tried that. It made no difference.

Hinanap ko ang Internets at nahanap ang post na ito: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2243677&SiteID=1

Ang poster na nangyari sa ma-gamit ang parehong bit root ng code (mula sa Inside WSS aklat mula sa listahang ito) so that was a hopeful sign. Gayunman, ang mungkahi ng dekorasyon ang assembly na may isang [pagtitipon: ] directive didn’t make sense to me. I tried it anyway and I was right. It made no difference.

Then I noticed that my class definition was not public. I made it public and that made no difference.

Susunod, I went to the trouble of enabling the "assembly bind failure log" (ng pagsunod sa mga kapaki-pakinabang at tumpak na mga tagubilin na ibinigay) and this is where things started to get interesting. That log shows me that the runtime is searching everywhere on that server for my assembly. It even appears to be searching for it in my medicine cabinet. Pero … hindi ito maghanap ng mga ito sa GAC.

I put on my winter jacket and go searching the Internets again and find that someone has had this problem too. The lengthy discussion in that posting peters off into nothing and I can’t find a solution.

I move my assembly into one of the places the log claims it’s searching and I make a little more progress. I’m rewarded with a new error in the browser when I try to activate the feature:

Failed to create feature receiver object from assembly "xyzzyFeatureReceiver_0", type "Conchango.xyzzyFeatureReceiver" para sa tampok b2cb42e3-4f0a-4380-aaba-1ef9cd526f20: System.ArgumentNullException: Halaga ay hindi maaaring maging null.
Pangalan ng parameter: uri
at System.Activator.CreateInstance(Uri ng uri, Boolean nonPublic)
at System.Activator.CreateInstance(Uri ng uri)
at Microsoft.SharePoint.Administration.SPFeatureDefinition.get_ReceiverObject()

I-troubleshoot ang mga isyu sa Windows SharePoint Serbisyo.

Oras para sa isang huling biyahe sa Internets!

Oras na ito mahanap ko out, predictably sapat, that MOSS issues this error because the assembly is not in GAC.

Gusto kong makakuha ng isang bagay na positibo out sa ito at subukan sa pakiramdam ng kaunti mapagmataas na aking nilikha ang Takas ng MSIL pagtitipon, but it’s not working. I’m just plain annoyed. I find myself muttering "chicken or the egg" sa ilalim ng aking hininga.

I finally decide to punt. I create an entirely new project and copy/paste the code from the incredible-cloaked-from-the-GAC-assembly non-working project over to this new project. (I look for a build flag called something like "hide from assembly binding if installed in the GAC" ngunit hindi mahanap ang isa).

I-install ko ang mga tampok at i-activate ito at … ito gumagana! Kaya, pagkatapos ng lahat na, I had to basically ‘reboot’ my project. Ito ay isa pang dahilan kung bakit ako mapoot mga computer.

I did learn something useful from this. I had been installing features using the stsadm command line all day long and been using the "-force" option out of habit. For some reason, I did not use the -force option when I installed the new project. Oras na ito, Ginawa ko talaga, truly forget to copy this new project’s assembly into the GAC. Bilang isang resulta, I received that "FielNotFoundException" mali. Oras na ito, Ang nakuha ko ito mula sa stsadm, not when I tried to activate the feature via the web browser. Kaya, -force actually plays two roles. It allows you to re-install an existing feature. It also allows you to install a buggy feature that cannot work at runtime by suppressing the error. It probably says as much in the help somewhere but I never noticed it.

</dulo>

Technorati Tags: ,

Linggo ng nakakatawang: Tuktok 10 Mga paraan Upang inisin ang iyong Asawa

  1. Bumili ng brokuli kapag alam mong mayroon nang higit sa sapat sa refrigerator.
  2. Go for a run. Cool off. Take off clean pillow case and replace with T-shirt. Cover with clean pillow case.
  3. Kapag sa pagmamaneho, magtanong kung dapat naming pumunta sa maling paraan pababa sa isang one-way na kalye.
  4. Para 15 taon, tuwing Linggo na iyong asawa ay nagmumungkahi ng pagpunta sa isang museo, express sorpresa na museo ay bukas sa Linggo ni.
  5. Para 15 taon, occasionally suggest going to the local book store on Sunday. Express surprise that they are not open on Sunday’s (Salamat ng maraming Blue Batas!).
  6. Gamitin 20 mga punto upang gawin ang isang 3 point turn.
  7. Sa isang cool na maagang Taglagas hapon, walk into the room and turn on the A/C. Complain that it’s cold. When wife says, "then why did you turn that on, gago" at nakakakuha ng hanggang sa i-off ito, grab the warm spot she had on the couch. Bonus points if she does not realize you did it until much later.
  8. Buksan up ng lata ng masarap na tuna puti albakora at kumain ito tuwid mula sa makakaya, sa kama, sa gabi.
  9. Pumunta sa kusina habang asawa ay kumakain ng hapunan, buksan ang kubyertos dibuhista at push kagamitan sa paligid hanggang asawa screams, "what are you looking for!"
  10. Sa pagtanggap ng bagong mga business card, lihim ilagay ang mga ito lahat sa paligid ng bahay: Sa ilalim ng kama, sa pillow kaso, sa loob ng tasa ng kape, sa kanyang pitaka, pahiran sa bulsa, kotse glab compartments, ang pantry — anywhere you can think of.
  11. Sumulat ng entry sa blog tungkol sa iyong asawa.
  12. Gumising.
  13. Kapag paglalakad sa mga kalye ng New York City, be on the alert for "crusty" objects on the ground. Pagpapanatiling sa isip ang mga espesyal na takot ang iyong asawa ni, maabot down na bilang kung upang pumili ng isa up up at hilingin, "hmm, Siguro kung ano na ang?" (Be prepared for wife to body slam you as if she’s a secret service agent protecting the President from a sniper or you’ll find yourself laying on your back on the sidewalk).
  14. Drive twice around a parking lot looking for space. You know you’ve really hit pay dirt when your son in the back seat yells, "Oh no! Siya'y paggawa ito muli!"
  15. Write "top 10" mga listahan na walang 10 mga item.

===

Bonus asawa magtawa:

Two male co-workers go out to lunch. One of them tells the other, "I let loose an embarrassing Freudian slip the other night."

"A Freudian slip? What’s that?"

"Well, kapag tapos na kami sa pagkain, tagapagsilbi ang dumating sa pamamagitan ng at tinanong kung paano namin nagustuhan ang aming pagkain. Ako nilalayong sabihin, ‘I loved the chicken breast’ but instead I said ‘I loved your breasts’. I was so embarrassed."

"Ah," his co-worker replied. "I had the same thing happen to me this weekend with my wife. We were eating breakfast I meant to ask her to pass the butter, ngunit sa halip ko screamed sa kanya, ‘You ruined my life!'"

</dulo>

Technorati Tags:

ID ng Kaganapan 1023: “Windows ay hindi maaaring-load ang extensible counter MSSCNTRS DLL”

I-UPDATE (04/08/08): I seem to have solved this problem. From the command line, I ran "c:\windows system32 lodctr / R" bilang sa bawat isang entry ng pakikipag-usap tungkol sa InstallShield problema at na Lumilitaw na malulutas ito para sa akin.

Ako napansin na kanina lamang, my desktop/server fan never turns off. I know it used to turn off. I took a moment to check it out noticed that the a VMware process was running a consistent 20% utilization on one of the CPU’s. I checked the event log and saw these errors in the application log happening dozens of times per minute:

Windows ay hindi maaaring-load ang extensible counter DLL UGatherer, ang unang DWORD sa data seksyon ay ang code Windows error.

Windows ay hindi maaaring-load ang extensible counter DLL UGTHRSVC, ang unang DWORD sa data seksyon ay ang code Windows error.

Windows ay hindi maaaring-load ang extensible counter MSSCNTRS DLL, ang unang DWORD sa data seksyon ay ang code Windows error.

Kung ako mag-drill sa mga detalye ng isa sa mga mensaheng iyon, Nakukuha ko ito:

Pinagmulan: Perflib

Uri: Mali

Kategorya: Wala

ID ng Kaganapan 1023

I did some research and there was some indication it could be a permission problem in terms of access to the DLLs in question. I played around with that stuff but could not affect things in a positive way so I gave up on that.

VMware ay mapag-angil sa akin tungkol sa pagsasagawa ng isang update para sa lubos ng ilang oras, kaya ako jotted down na ang bersyon ko ay naka-install (apparently "1.0.1 build 29996") and did the update. This upgraded me to v1.04. Sadly, hindi ito maayos ang isyu.

I can stop the insane number of messages going to my application log if I shut down a service named "VMware Authorization Service". This prevents me from using the VMware software, kaya … not such a great option.

Ang host na operating system ay Windows XP 64 kaunti.

Hindi sa tingin ko ito ay palaging nangyari, ngunit hindi ko isipin ang anumang partikular na kaganapan na maaaring humantong sa ito.

Ito ang dahilan kung bakit ako mapoot mga computer.

</dulo>

Technorati Tags:

Mabilis & Madali: Palitan ang pangalan ng In-upload ng File Paggamit ng SharePoint Bagay Model Via isang Tatanggap ng Kaganapan

I-UPDATE: This works but there are significant limitations which are described in the comments. This may still be useful in some cirumstances.

I-UPDATE 2: Sa aking kasalukuyang proyekto, users always upload documents. Bilang isang resulta, I don’t run into a problem where MS Word is running and thinks that the file was renamed on it. I did run into a problem, "the file was modified by someone else" and solved this via a simple semaphore type flag. Users need to change a meta data field from its default value to something else. The itemupdated() receiver maghahanap ng isang wastong halaga doon bago aktwal na gumaganap ang palitan ang pangalan at mula noon, I have not had any problems. Your mileage may vary.

I have a client requirement to change the name of files uploaded to a specific document library to conform with a particular naming convention. The API does not provide a "rename()" pamamaraan. Sa halip, ginagamit namin "MoveTo(…)". Here is a minimal bit of code to accomplish this:

 publiko magpawalang-bisa walang bisa ItemAdded(SPItemEventProperties katangian)
        {
            SPFile f = properties.ListItem.File;

            f.MoveTo(properties.ListItem.ParentList.RootFolder.Url + "/xyzzy.doc");
            f.Update();

        }

The only tricky bit is the "properties.ListItem.ParentList.RootFolder.Url". The MoveTo() method requires a URL. That mashed up string points me to the root folder of my current document library. This allows me to avoid any hard coding in my event receiver.

Ito ay isang mas kapaki-pakinabang bersyon na gumagana ang parehong bagay, but assigns the name of the file to "Title":

 publiko magpawalang-bisa walang bisa ItemAdded(SPItemEventProperties katangian)
        {
            DisableEventFiring();

            // Magtalaga ng pamagat ng item na ito upang ang pangalan ng mismong file.
 // Tandaan: Pagtatalaga na ito ay kailangang maganap bago naming baguhin ang mismong file.
 // Pagtawag update() sa SPFile Mukhang magpawalang-bisa ang mga katangian sa
 // ilang mga kahulugan.  Updates to "Title" Nabigo ang hanggang sa pagbabagong iyon (at mag-update() tumawag)
 // ay inilipat sa harap ng mga pagbabago sa mga pangalan ng file.
            properties.ListItem["Title"] = Properties.ListItem.File.Name;

            properties.ListItem.Update();

            SPFile f = properties.ListItem.File;

            // Kumuha ng mga extension ng file.  Kailangan namin na mamaya.
 pisi spfileExt = bago File Info(f.Name).Karugtong;

            // Palitan ng pangalan ang file sa ID sa listahan ng item at gamitin ang file extension upang panatilihing
 // na bahagi nito buo.
            f.MoveTo(properties.ListItem.ParentList.RootFolder.Url +
                "/" + properties.ListItem["ID"] + spfileExt);

            // Commit ang paglipat.
            f.Update();

            EnableEventFiring();
        }

Forum ng Talakayan: Pagpapatupad ng Pinakamahusay na Kasanayan Pagsunod sa mga non-walang halaga Moss Kapaligiran

Ang isang kapwa, "Mark", has started up a potentially interesting newsgroup discussion focusing on "establishing excellent SharePoint Governance from the start" para sa isang 35,000 gumagamit kapaligiran.

Ang mga talakayan ay dito: http://groups.google.com/group/microsoft.public.sharepoint.portalserver/browse_thread/thread/6d9a738d981af772/1c390b15c5407db6?#1c390b15c5407db6

Pop sa ibabaw at mag-ambag!

</dulo>

Custom Action URL ay hindi Makakaapekto ba ang Ipakita para sa Bagong Tampok

I’m still in the habit of crafting my feature XML files by hand since it’s all quite new to me. I don’t want to rely on a front-end tool that does stuff I don’t understand (sinabi niya bilang siya ay nagsulat ng isang blog entry gamit ang isang tool na wala siyang maintindihan).

Ngayon, I was trying to add a custom action to the site settings but it just wouldn’t show up. I could install the feature and see it in the site features, ngunit kapag ako ay nag-activate ito (ganap) ito lamang ay hindi lalabas sa mga drop-down na menu.

I finally realized that I misspelled "SharePoint" sa Lokasyon ng katangian ng <CustomAction> buko. This is the bad elements.xml file:

<?xml salin="1.0" pag-encode="utf-8" ?>
<Mga Sangkap xmlns="http://schemas.microsoft.com / sharepoint /">
  <CustomAction
 ID="SiteActionsToolbar"
 GroupId="SiteActions"
 Kinalalagyan="Microsoft.Sharepoint.StandardMenu"
 Pagkakasunud-sunod="100"
 Pamagat="Hello!"
 Paglalarawan="Custom menu action na idinagdag sa pamamagitan ng isang tampok."
 ImageUrl="_layouts / images / menuprofile.gif">

    <UrlAction Url="http://www.xyzzy.com"/>

  </CustomAction>
</Mga Sangkap>

Mabuti:

<?xml salin="1.0" pag-encode="utf-8" ?>
<Mga Sangkap xmlns="http://schemas.microsoft.com / sharepoint /">
  <CustomAction
 ID="SiteActionsToolBar"
 GroupId="SiteActions"
 Kinalalagyan="Microsoft.SharePoint.StandardMenu"
 Pagkakasunud-sunod="100"
 Pamagat="Hello!"
 Paglalarawan="Custom menu action na idinagdag sa pamamagitan ng isang tampok."
    >
    <UrlAction Url="http://www.xyzzy.com"/>
  </CustomAction>
</Mga Sangkap>

That one took me a good two hours to figure out 🙂

Ako ng mga mag-aliw sa ang katunayan na ang ilang mga araw sa hinaharap, Kukunin ko magagawang sabihin na may matibay na paniniwala, "back in the day, Mayroon akong maglakad sa tatlong milya up burol sa niyebe (walang sapin ang paa!) in order to deploy a custom feature to MOSS. You kids, Hindi mo alam kung paano madaling mayroon ka nito! Get off my lawn!"

Hindi na makahintay.

</dulo>

Technorati Tags: ,

Blog Stats

I thought some people might be interested in my blog’s statistics. You can use mine as a benchmark to compare your own.

I’m running my blog on windows live spaces. They collect stats for me and I don’t know any way to control that. It’s good as far as it goes, but it’s fairly limited in that I can’t do much actual analysis with it. I’d love, halimbawa, to be able to generate a listing of my most frequently hit posts but I can’t do that without a prohibitive manual process. If someone knows better, mangyaring sabihin sa akin.

Live na mga puwang katayuan sabihin sa akin: kabuuang mga hit para sa araw, total hits for the week and total hits since day zero. It also tells me what people did to get to my blog (e.g. google, MSDN forum link, at iba pa).

Sa ilang mga paraan, a "hit" ay halata. Kung binabasa mo ang pangungusap na ito ngayon, mo na ang halos tiyak na nakarehistro bilang isang solong hit.

RSS is a little confusing. On one hand, I see individual RSS hits all day long. Pero, I also see RSS "sweeps". A sweep is when I see 20 o 30 RSS hits all within a one or two second window. I assume these are automated things like google checking in on my site, siguro ibang tao browser … hindi sigurado. They are definitely some kind of automated process. I cannot tell, gayunman, how many of my total hits are automated and how many have an actual human on the other side. I would guess at least 100 hit bawat araw ay awtomatiko.

Sa upang ang mga numero!

Nagsulat ako sa aking unang entry sa blog sa Hulyo 27, 2007.

Isinulat ko humigit-kumulang 60 blog entry mula noon, higit sa 50 ng kung saan ay direktang umuugnay sa SharePoint.

Ako nagsimula upang subaybayan ng aking mga hit sa isang spreadsheet sa isang pang araw-araw na batayan sa dulo ng Setyembre.

Buwanang Mga Pagsisimula:

Unang linggo ng: Kabuuang Hits
Oktubre 1,234
Nobyembre 2,162
Disyembre 3,071
Enero 2008 4,253

Kabuuang sa pamamagitan ng Buwan

Buwan Kabuuang Hits
Oktubre 6,620
Nobyembre 11,110
Disyembre 13,138

Mataas na Marks Tubig

Uri Kabuuang Hits
Pinakamahusay na Araw 958
Pinakamahusay na Linggo 4,253
Kabuuang Hits Dahil Araw ng Zero 42,438

Ako interesado sa iba’ stats. If you care to share yours in the comments, mangyaring gawin!

</dulo>

Technorati Tags:

Linggo Umaga ng nakakatawang: “Oo, oo, oo. Kalokohan, kalokohan, blah.”

Tungkol sa anim na taon na ang nakalipas, ang aking apat na taon gulang na anak na lalaki at ako ay sa itaas ng hagdan nanonood ng Discovery channel "shark attacks" espesyal (marahil ang isang ito). He was very young at the point and I was always worried what he might see on a show like this and how he might take it. I didn’t want him to develop, halimbawa, anumang espesyal na mga takot ng tubig o magsitsit ng isang bagay na hindi naaangkop sa kanyang mga kaibigan at posibleng maging sanhi ng kanyang sanggol kaibigan network na dumating pag-crash down na.

Discovery handles these kinds of subjects very well. It’s not about creating a takot sa isang bagay, but rather to show how unusual it is for sharks to attack humans.

Kaya, we’re watching it and there is this one particularly scary attack involving a small girl. As Discovery is building the drama of the attack, aking anak na lalaki (sino ay palagi nang naging lubhang matatakutin pa rin), is getting very excited. I make some noises about how unusual it is for sharks to attack people, and how bad the poor girl must feel. I’m trying to explain that people recover from these events and become stronger for it. Gayunman, I had misinterpreted his excitement. He was not worried about the girl at all. Sa halip, habang pumapalakpak ang kanyang mga kamay, siya ay nagsasabi sa akin, "The sharks love it! It’s terrific. It’s wonderful. Its a DREAM COME TRUE!"

Akala ko ito ay masayang-maingay, but also very disturbing. Sa isang banda, Ako ay natutuwa — kahit na isang maliit na maipagmamalaki — na maaaring siya ay may malakas na damdamin empathic, cross-species though they may be. As humans, we need to develop our "empathic muscles" kaya makipag-usap o makakapunta ka tulad ng ito tao 🙂 Sa kabilang dako, he was feeling cross-species empathy toward a species who was exhibiting behavior inimical to his own. I was really struggling with this when the narrator used the word "paradigm". My son picked up on that and asked me what that meant.

Iyan ay hindi tulad ng isang madaling salita upang ilarawan sa isang apat na taong gulang na, but I gave it a try. When I think of the word "paradigm", Thomas Kuhn is never far from my thoughts. Nabasa ko Ang Istruktura ng Scientific Revolutions bumalik sa Lafayette at para sa mas mahusay o mas masahol pa para sa, the word "paradigm" is pregnant with extra meaning for me. (Sort of like the word "contact" pagkatapos ng hearing ng Movie boses Telepono sabihin sa akin kung saan maaari kong makita na pelikula [Naisip ko na ang libro ay mas mahusay]; Ako palaging sabihin sa aking sarili, "CONTACT!" whenever I see or hear someone say "contact").

Gayon pa man, Sinusubukan ko upang ipaliwanag sa kanya ang isang Kuhnian kahulugan, that it’s "a historical movement of thought" and that it’s a "way of thinking with a number of built-in assumptions that are hard to escape for people living at that time." Talaga, hindi ka maaaring makipag-usap tulad ng sa isang apat na taong gulang na, so I’m trying to successively define it to smaller pieces and feeling rather proud of myself as I do so. (Ko lang Alam na isang tao sa labas ng kolehiyo gusto pakialam na ako ay basahin Kuhn!).

I’m just warming to the task when he interrupts me. Waving his hand sa aking pangkalahatang direksyon at hindi kailanman pagkuha ng kanyang mga mata off ang isa pang mabangis na atake pating, siya lamang sabi, "Yeah, oo, oo. Kalokohan, kalokohan, blah.".

So magkano ang para sa 🙂

Sa puntong iyon, Ko nagpasya upang patakbuhin ang layo, rhetorically pagsasalita, magpahinga, at tangkilikin ang panonood ng mga kawani na tao pating atake sa aking anak na lalaki.

</dulo>

Technorati Tags:

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:

Aksidenteng Code Pagdaragdag sa isang Form InfoPath; Sadyang pag-alis nito

Kapag nagtatrabaho sa mga pindutan sa isang form, we often add rules. You access the rules editor from the properties of the button.

Kapag ng pag-click sa paligid ng mabilis, it’s easy to accidentally click on "Edit Form Code" instead of "Rules …".

Ang unang pagkakataon na ginawa ko ito, I canceled out of the code editor. Gayunman, kapag sinubukan kong i-publish ang form ng kaunti habang mamaya, it required that I publish as an "Administrator-approved form template (advance)". I didn’t actually do any programming and I absolutely didn’t want to go through an unnecessary approval process. I was in a bit of panic at the time due to time constraints. To get past it, I simply restored a previous backup and continued. I had recently seen some blog posts about people going into the form’s XML to tweak things and I was afraid I would have to do something similar.

Ngayon, I did it again. Oras na ito, Ako ay nagkaroon ng konting oras sa aking mga kamay at nalaman na maaari mong madaling i-undo ito.

Pumunta sa:

Tools -> Form Options -> Programming: "Remove Code"

Hindi ito makakuha ng mas madali kaysa na.

</dulo>

Technorati Tags: ,