Hi,
I use the program of alec polidaev which calculate workday between 2 datepicker with rules only ( you can download the form here : http://cid-e5a123fca40349ad.skydrive.live.com/self.aspx/.Public/WorkDaysCalc.xsn?sa=433793328 )
so i've a xml file(name = daysOfTheWeek) in data connection for receive the holidays. the problem is on a rule for the workday field,
the rule is : compte(hday[traduire(BeginDate; "-"; "") <= traduire(@hdayn; "-"; "") and traduire(EndDate; "-"; "") >= traduire(@hdayn; "-"; "")])
path : hday -> xdXDocument:getDOM("daysOfTheWeek")/somestuff/holydays/hday
BeginDate ->/my:myFields/my:BeginDate
EndDate ->/my:myFields/EndDate
@hdayn-> traduire(xdXDocument:getDOM("daysOfTheWeek")/somestuff/holydays/hday/@hdayn
alec's form works well but if i delete this line and rewrite it, it doesn't count the holiday in workday calculation the problems are : If you add hday,BeginDate,@hdayn,EndDate with infopath IU --> error because the form act like BeginDate is in this path if you add hday,BeginDate,@hdayn,EndDate with path like this
compte(xdXDocument:getDOM("JourSemaine")/somestuff/holydays/hday[traduire(/my:DemandeConge/my:Congés/my:DateDebut;
"-"; "") <=
traduire(xdXDocument:getDOM("JourSemaine")/somestuff/holydays/hday/@hdayn;
"-"; "") and
traduire(/my:DemandeConge/my:Congés/my:DateFin; "-"; "")
>= traduire(xdXDocument:getDOM("JourSemaine")/somestuff/holydays/hday/@hdayn;
"-"; "")])
there is no error detected but the holidays aren't count into workday calculation so my question is what i'm doing wrong in reproducing
compte(hday[traduiree(BeginDate; "-"; "") <= traduire(@hdayn; "-";
"") and traduire(EndDate; "-"; "") >= traduire(@hdayn; "-"; "")])
Thanks in advance
Edit : Alec responded me in his blog, for who wonder here is the solution :
count(xdXDocument:GetDOM(”daysOfTheWeek”)/somestuff/holydays/hday[translate(xdXDocument:get-DOM()/my:myFields/my:BeginDate,
"-", "") <= translate(@hdayn, "-", "") and
translate(xdXDocument:get-DOM()/my:myFields/my:EndDate, "-", "") >=
translate(@hdayn, "-", "")])