Unable to select view fields for use with custom action
Hi,
Here is a view I've created, with a custom action I've just added. I've had to add the custom action using the view definition free-script editor, because I was unable to select the field "FullEpisodeNumber" as argument for the function in the "create custom action" wizard. Why??
list Subs_a_bajar
{
displayname = "Subs a bajar"
show all rows from Capitulos [Sub == false]
(
Serie
FullEpisodeNumber
Title
Filename
DateAdded
)
filters
(
Serie
"Ready to watch" : (Sub && Seen == false)
"Need subs" : Sub == false
)
group by
(
Serie ascending
)
options
(
display rows = 30
)
custom actions
(
"Subs bajados"
(
function = SubBajado(Serie, FullEpisodeNumber)
show action in view header = true
show action for each record = false
)
)
}
here is the code of SubBajado() function:
void SubBajado(string S, string E)
{
// Recuperamos el capitulo visto (x)
info "S=" + input.S;
info "E=" + input.E;
x = Capitulos [(Serie == input.S && FullEpisodeNumber == input.E)];
x.Sub = true;
thisapp.SetFirstNonSeen(input.S);
}
When I select a row in the view, and run the custom action for it, E (FullEpisodeNumber passed from the view to the function) appears to be null inside the function (while actually FullEpisodeNumber isn't null in the view)!
I get S=some value
E=null
and then the funcion fails (because E couldn't be null).
Some help? Is it a bug?
Regards,
Alex