fd.field().value() not working
Posted: 29 Jan 2015
Hi,
I have a form with an lookupfield called Ticket. I try to set die lookupfield with javascript with the help of a url parameter. My javascrpt is the following:
//check if my custom parameter ParentID is set
var parentID = 5;
if (parentID) {
//parentID is set
var ret = fd.field('Ticket').value(parentID);
//check if the setting was succesful
if (parentID == ret.value()) {
$('.ticket-field').hide();
} else {
alert(parentID + " - " + ret.value());
}
}
When I open the form with following url (ie. from a related item list) the ticket field is succesfully set:
http://server/Lists/Ticketaufgaben/fd_T ... e%26ID%3D5
When I open the form with following url (ie. from a user defined action) the alert box is telling me that setting the value was not successfull.
http://server/Lists/Ticketaufgaben/fd_T ... fcb607d26e
The only difference between the two URL is the ID parameter in the source parameter.
I see no reason thy it is necessary to have an ID parameter in the source paramter just to do the fd.field('Ticket').value(parentID);
Can you tell me what I did wrong?
I have a form with an lookupfield called Ticket. I try to set die lookupfield with javascript with the help of a url parameter. My javascrpt is the following:
//check if my custom parameter ParentID is set
var parentID = 5;
if (parentID) {
//parentID is set
var ret = fd.field('Ticket').value(parentID);
//check if the setting was succesful
if (parentID == ret.value()) {
$('.ticket-field').hide();
} else {
alert(parentID + " - " + ret.value());
}
}
When I open the form with following url (ie. from a related item list) the ticket field is succesfully set:
http://server/Lists/Ticketaufgaben/fd_T ... e%26ID%3D5
When I open the form with following url (ie. from a user defined action) the alert box is telling me that setting the value was not successfull.
http://server/Lists/Ticketaufgaben/fd_T ... fcb607d26e
The only difference between the two URL is the ID parameter in the source parameter.
I see no reason thy it is necessary to have an ID parameter in the source paramter just to do the fd.field('Ticket').value(parentID);
Can you tell me what I did wrong?