Hi,
I have a report for PurchTable, there are two ways to call it. From dialog (filter by PurchId) and form button where the filter is the reg you select.
The first one works perfectly:
but the second one gives me an error "missing value"
I have a method "clicked" that takes the PurchId of the reg selected:
And a Class for the report:
I think the problem is i don't add the parameter of the filter correctly, because i try to change the name of the parameter PurchTable_PurchId to PurchId on Visual Studio, and the error change to "parameter doesn't exist on the report".
I don't know how solve this. Any idea?
Thanks.
*This post is locked for comments
Ok, it was an old modification i forget to delete, now i have the correct record, but the error still
In your main method, remove the line
Args _args = new Args();
Why do you have such line? That will overwrite the real _args that was passed to the main method with a new empty Args object!
No, i don't have the correct record:
On Visual Studio, if i change the property of parm to allow null/empty to true the records opens, but with no filter. So i think the problem is im not get pass the value filter correctly.
If it's not that, i don't know what can be.
IMPORTANT (I think)
i have this method:
protected void preRunModifyContract()
{
Query reportQuery;
if(purchId)
{
reportQuery = this.getFirstQuery();
//a la query que ya tiene el informe por defecto, le añadimos un parámetro
SrsReportHelper::addParameterValueRangeToQuery(
reportQuery, tableNum(PurchTable),
fieldNum(PurchTable, PurchId), SysQuery::value(purchId)/*purchId*/);
}
//super();
}
When i debug, the program do not enter in this mathod, I try to call it from main and i realized than reportQuery = this.getFirstQuery(); return a null value.
What do you mean by "both" clicked methods? Did you remember to add the Data source property for both buttons? Where is the second button?
I think we should first concentrate on making one button work, and then you can apply the same solution to your second button.
So, going back to your main method.
Do you now have the correct record in purchTable variable after this line:
purchtable = _args.record();
If yes, then we know that everything looks good until this, and the problem is in your controller class. You already said you get some error about missing PurchTable_PurchId even if you specify yourController.parmPurchId value. So that really indicates that your controller class doesn't know how to handle that purchId parameter.
Could you describe the current status in detail. Do you get some errors? Also please share more details about your controller class.
Yes, i deleted both clicked() method, and yes, i have selected a record. I added NeedsRecord = Yes. Nothing changed.
And you don't have the clicked() method of the button overwritten anymore? If you do, please delete the method.
Do you have a selected Purchase order in the calling form? To make sure, you can also add "NeedsRecord = Yes" in the button properties.
I have this in two forms (DataSource PurchaseTable on ListPage Form).
args.record() still not working, I'm desesperate :(
Your menuItemButton has to be associated with a data source on the calling form.
So please specify property DataSource either on the button group or the individual button.
ok, i changed everything, now i have the error-> method 'main' doesn't exist on object VSSClassControlPedidos.
I chage public void main to public static main and its works, but now i have two problems:
1. the error missing value still
2. the args.record() doesn't catch anything.
Even if i put
controller.parmPurchId("000013");
It says that PurchTable_PurchId its empty
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156