-
Anyone else who is struggling with something similar should look at xsnfixup.js. You need to use the CabSDK from microsoft in conjunction with the javascript.
MSDN has full details:
http://msdn2.microsoft.com/en-us/library/Aa192521(office.11).aspx
-
Yah, Now going back and looking at your code you have it right.
I would try specifying a value on your assignment. Set Last Updated by to "Bob" or something to verify this functionality.
You could also add an alert on the IP field before and after too.
-
GetLogin() is working fine, just like it should. After sLastUpdated_by = XDocument.DOM.selectSingleNode("/dfs:myFields/dfs:dataFields/d:EMPLOYEE_NOT_ON_SITE/@LastUpdated_by") sLastUpdated_by seems to be 'null' (I've seen in the Wath window) and cannot be assigned a value.
XDocument.UI.Alert(GetLogin()) shows me the ...
-
You would need to debug, I often have an Alert with my variables fire at various points to be able to track their states.
Have you verified your GetLogin() is working and set you curDate somewhere else?
-
Thanks for the suggestion, but your code doesn't work.
Anyhow I tought you first need to declare your variables before assigning a value. I think it has to see with the fact that this code is assigned to a button, the same thing works if it used in the 'onafterchange' event of a control.
Regards
-
You would need to add a field to store the state you want and then set up your sections to reference this field and act accordingly. InfoPath by default resets each time it is opened. To override this you must put in some explicit rules in the Open Rules or setup the sections to check for state and then act accordingly.
So obviously a ...
-
You have your assignments out of order.
You set your field values before you GetLogin() and currDate.
Try This...
function CmdSave::OnClick(eventObj)
{
var curDate = new Date()
sLastUpdated_by.text = GetLogin();
sLastUpdated_time.text = curDate
var sLastUpdated_by = ...
-
With the following code, I try to set 2 field values (LastUpdated_by and LastUpdated_time) at the moment a custom submit button is pressed.
function CmdSave::OnClick(eventObj)
{
var curDate = new Date()
var sLastUpdated_by = ...
-
Thanks for the advice Clay, that takes care of all of my problems and is only 100 to 150 times easier than what I was doing.
-
Thanks for the info,
The optional section cannot be bound to repeating fields or groups, do you know if its possible to configure the section so it could be bound to these fields?
do you familiar with a way to do this on single fields, in expression boxes for example?
Thanks.