Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / April 2006

Tip: Looking for answers? Try searching our database.

Calculating two fields in Code

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Aria1844@hotmail.com - 05 Apr 2006 16:59 GMT
I'm new to Info Path so forgive me for the simplicity of this question. But
I'm modifying the Expense Report template and have added a few more fileds of
my own. Now I'm trying to compare two fileds to see which has the lowest
value and take that and do some calculations with it; see below! Except what
happens is that it never picks up the right value. Here I'm looking for the
lowest value, if I enter 100 for USAIDLodgingPerDiem and enter 50 for
ActualHotelCostPerNight it always takes the 100. Now enter a lower value than
100 and it works just fine! PUZZELED!!
Any assistance would be greatly appreicated.
Aria

/*
function TravelLodgeCost()
{
    var USAIDLodgingPerDiem =
XDocument.DOM.selectSingleNode("//my:USAIDLodgingPerDiem");
    var ActualHotelCostPerNight =
XDocument.DOM.selectSingleNode("//my:ActualHotelCostPerNight");
    var NumberOfNights = XDocument.DOM.selectSingleNode("//my:NumberOfNights");
    var LodgingCalculation =
XDocument.DOM.selectSingleNode("//my:LodgingCalculation");
   
    if (USAIDLodgingPerDiem.nodeTypedValue >=
ActualHotelCostPerNight.nodeTypedVlaue){
        XDocument.UI.Alert(USAIDLodgingPerDiem.nodeTypedValue);
        setRoundedValue(LodgingCalculation,
getNodeTypedValue(ActualHotelCostPerNight,0,true) *
getNodeTypedValue(NumberOfNights,0,true));
    }else{
        XDocument.UI.Alert(USAIDLodgingPerDiem.nodeTypedValue);
        setRoundedValue(LodgingCalculation,
getNodeTypedValue(USAIDLodgingPerDiem,0,true) *
getNodeTypedValue(NumberOfNights,0,true));
    }
   
   
}
*/
S.Y.M. Wong-A-Ton - 06 Apr 2006 13:58 GMT
You may want to fix the typo in your code first and then try it again.
"ActualHotelCostPerNight.nodeTypedVlaue" should be
"ActualHotelCostPerNight.nodeTypedValue". It might make a difference...
---
S.Y.M. Wong-A-Ton

> I'm new to Info Path so forgive me for the simplicity of this question. But
> I'm modifying the Expense Report template and have added a few more fileds of
[quoted text clipped - 34 lines]
> }
> */
Aria1844@hotmail.com - 07 Apr 2006 14:23 GMT
That wasn't the issue! Any other suggestions?

> You may want to fix the typo in your code first and then try it again.
> "ActualHotelCostPerNight.nodeTypedVlaue" should be
[quoted text clipped - 40 lines]
> > }
> > */
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.