Јас работам на некои најавите каде што вработените можат да побараат одмор, болните време, итн. Еден валидација правило кое вели дека секогаш мора да побара време надвор во 4 час интервали. Ова е лесно доволно да се направи - користи некоја функција modulo. Modulo функција ви кажува остатокот во поделба. Доколку не постои остатокот, modulo is zero, во спротивно, it’s whatever is left. На пример, 8 mod 4 = 0 (8 / 4 = 2 with no fraction). Од друга страна, 8 mod 5 is 3.
I needed to do this once with SPD 2007 once upon a time and I actually ended up using an InfoPath form to solve, so it was handled on the front end at the time. In the current case, there may be an InfoPath form in the picture, but that’s not clear yet. Така, I was working out a technique to ensure that time requests are always in 4 hour increments. I was going to do the math, save it in a string and then do some substring stuff.
I pull up SPD 2010 and to my surprise (and a little embarrassment) there is a modulo function already:
I am once again pleasantly surprised that something I needed is already there out of the box. It does seem like a weird function for Microsoft to include in the mix. It has a sort of “this is easy, so let’s throw it in” feel to it. I sympathize with that, as I do it myself all the time. This CodePlex project has a bunch of little functions that result from the ItsEasy principle. Во исто време, Microsoft continues to support evidence the “95% of the way” effect with the product. They implement the Mod function, but not the round function, for instance.
</крајот>
Да се претплатите на мојот блог.
Следете ме на Twitter во http://www.twitter.com/pagalvin
Pingback: Tweets that mention SharePoint Designer 2010 MOD function « Paul Galvin's SharePoint Space -- Topsy.com