i'm trying to filter a list with a ticker ID. I could get the TickerID wiht [TicketID] but i wasn't able to filter the list with this. Here is my Code.
fd.spRendered(function() {
fd.control('Text1').text = '[TicketID]';
var temp = fd.control('Text1').value;
fd.control('Text2').text =temp; //textfield is displaying correct ticketId
var dt = fd.control('IST_Aufwand');
dt.ready().then(function() {
filterDT();
});
dt.readonly=false;
function filterDT(){
//dt.filter = "<Eq><FieldRef Name='Test'/><Value Type='Integer'>4</Value></Eq>"; //does filter by the value 4
dt.filter = "<Eq><FieldRef Name='Test'/><Value Type='Integer'>temp</Value></Eq>"; //doesn't work
dt.refresh();
}
ticketForm.Render();
Hello! The Ticket ID field contains a string (not integer) therefore the temp variable is a string too. The CAML query requires an integer. You can transform it using a functionparseInt().
Well, a tested it a bit and found out that [TicketID] is just a token that is replaced by an accordant value when the form is rendered. So when you assign fd.control('Text1').text to the variable, you assign just a [TicketID] string that can't be converted to an integer. You should refer to the TicketID field itself to assign its value to a variable.