Announcements
I have created menu item button named "situationary declaration " in all sales order form so when i clicked on this button it will open the report
with the dilogue box having invoice id parameter but i dont want that , what i want is
if i open specific sales order and then click "situationary declaration " button it should directly open the report for that sales order which having invoice id .
no need of dilogue box is there report should directly open on click of menu item button.
can someone suggest how can i get this done.
hi ,.
thanks for the correction in code now i am getting required output now.
thank you
Have you debugged the code and find out whether line number 32 returns salesId selected in the form?
Also it seems select statement you have added to salesOrderExim table is wrong. No need of join. Refer to below code which I have modified.
[ExtensionOf(formStr(SalesTable))] final class EximSalesForm_Extension { ////// /// /// /// [FormControlEventHandler(formControlStr(SalesTable, Dev_SituationaryDeclaration), FormControlEventType::Clicked)] public static void Dev_SituationaryDeclaration_OnClicked(FormControl sender, FormControlEventArgs e) { SalesOrderExim salesOrderExim; CustInvoiceJour custInvoiceJour; SalesTable salesTable; InvoiceId _id; SalesId salesId; Args args = new Args(); str parameterString; ; FormDataSource salesTable_ds = sender.formRun().dataSource(1); args.caller(salesTable_ds); salesTable = salesTable_ds.cursor(); select * from salesOrderExim where salesOrderExim.RefrenceRecId == salesTable.RecId; args.record(salesOrderExim); args.parm(salesOrderExim.InvoiceId); new MenuFunction(menuItemDisplayStr(Dev_SituationaryDeclarationMnu), MenuItemType::Display).run(args); } }
Thanks,
Girish S.
hi , thanks for helping me out with code , I am getting report generated in output ,but my report is selecting first record from "salesorderexim" table but i want to get the report of sales id which i select in salesorder form , how can i get it deone can you plz help me out.
[ExtensionOf(formStr(SalesTable))] final class EximSalesForm_Extension { ////// /// /// /// [FormControlEventHandler(formControlStr(SalesTable, Dev_SituationaryDeclaration), FormControlEventType::Clicked)] public static void Dev_SituationaryDeclaration_OnClicked(FormControl sender, FormControlEventArgs e) { SalesOrderExim salesOrderExim; CustInvoiceJour custInvoiceJour; SalesTable salesTable; InvoiceId _id; SalesId salesId; Args args = new Args(); str parameterString; ; args.record(salesOrderExim); args.parm(salesOrderExim.InvoiceId); FormDataSource salesTable_ds = sender.formRun().dataSource(1); args.caller(salesTable_ds); salesTable = salesTable_ds.cursor(); select * from salesOrderExim join salesTable where salesTable.RecId == salesOrderExim.RefrenceRecId; new MenuFunction(menuItemDisplayStr(Dev_SituationaryDeclarationMnu), MenuItemType::Display).run(args); } }
args.caller() will expect type Object. You are trying to pass the string field to caller method which is wrong.
Get the formRum from the FormControl and pass that as a argument to the caller method.
args.caller(sender.formRun());
Thanks,
Girish S.
yes i will change the menu item to output type . but i am getting error in my code
"Error Type mismatch in 'Args.caller' argument 1. The expected type is 'Object', but the actual type is 'str'."
on this line
args.caller(salesOrderExim.InvoiceId);
[FormControlEventHandler(formControlStr(SalesTable, Dev_SituationaryDeclaration), FormControlEventType::Clicked)] public static void Dev_SituationaryDeclaration_OnClicked(FormControl sender, FormControlEventArgs e) { SalesOrderExim salesOrderExim; CustInvoiceJour custInvoiceJour; SalesTable salesTable; Args args = new Args(); str parameterString; ; args.record(salesOrderExim); args.caller(salesOrderExim.InvoiceId); select forupdate salesOrderExim where salesOrderExim.RefrenceRecId == salesTable.RecId; if(salesTable.SalesStatus==SalesStatus::Invoiced) { select InvoiceId,InvoiceDate from custInvoiceJour where custInvoiceJour.SalesId == salesTable.SalesId; new MenuFunction(menuItemDisplayStr(Dev_SituationaryDeclarationMnu), MenuItemType::Display).run(args); } }
It will be better if you create new output menu item and map the controller classes to it.
Thanks,
Girish S.
i am using display menu item for this is will this work with display menu item , what do you suggest about this .
Thanks,
regards Dinesh
You can do like that as I already mentioned in my previous reply about using the "prePromptModifyContract" method. Seems you have already done that, So please refers to the previous reply. Also you pasted the code for the same.
But this can be done by editing the controller class - If the same report is used in other menus it will also get affected.
Thanks,
Girish S.
thanks for reply ,
but i was looking for something like this
can you suggest how can i modify my code by reffering above link.
Refer to the below blog.
On the above blog it will download this as file. To show it in screen just change the SRSPrintMediumType to "Screen"
Thanks,
Girish S.
André Arnaud de Cal...
294,217
Super User 2025 Season 1
Martin Dráb
232,978
Most Valuable Professional
nmaenpaa
101,158
Moderator