Reputation: 311
In a customised form I would have a create Purchase Menubutton which opens a dialog to create a purchase order.
But I need to select few records like one or two lines and then create purchase order only for those records. How do I do that?
Upvotes: 1
Views: 2039
Reputation: 10345
Here is a piece of code which allows you to get the record from the previous form.
You have to put this piece of code in the INIT method of the dialog. So you have to override the init of the dialog.
DmoVehicleTable vehicleTable;
DmoVehicleId vehId;
// Get the vehicle ID from the previous form
if (element.args() && element.args().record())
{
switch (element.args().record().TableId)
{
case (tableNum(DmoVehicleTable)):
vehicleTable = element.args().record();
vehId = vehicleTable.VehicleId;
break;
default:
throw error (strFmt("@SYS477", this.name()));
}
}
I hope this will help you.
If you need more help: http://sirprogrammer.blogspot.com/
Upvotes: 0
Reputation: 18051
Take a look on the "Create purchase order" button on the SalesTable
form.
It works differently: you select the lines to purchase after you press the button, but it might work in your case also.
Also have a look on how to use multiple selected records in a grid.
Upvotes: 1