Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
microsoft.public.axapta.programming
Edit datasource fieldvalues
koffidan
11/15/2005 1:51:00 PM
Hi
When updating vendor invoices from the invoicepool form, you click the
button 'Purchase order' and you get the Posting Invoice form (PurchEditLines).
I would like to update all lines (datasource PurchParmLines) from a class.
So far I have done the following in Main:
FormRun purchEditLines;
FormDesign purchEditLinesDesign;
FormObjectSet purchParmLine;
FormRealControl lineQty;
;
purchEditLines = _args.caller();
// purchEditLinesDesign = purchEditLines.design();
purchParmLine = purchEditLines.dataSource(4);
purchParmLineBuffer = purchParmLine.cursor();
purchParmLineBuffer.ReceiveNow = 3;
purchParmLineBuffer.doUpdate();
purchParmLine.refresh();
This works mostly, but only with ONE line. How do I update more than one
line, I hope you can help me. Thanks.
Regards
Koffidan
--
Koffidan
http://www.koffidan.ubifone.com/eng/d...
3 Answers
Anton Venter
11/15/2005 8:59:00 PM
0
Have a look at the following article on Axaptapedia
http://www.axaptapedia.com/index.php/Multiple_grid_...
"koffidan" <koffidan@discussions.microsoft.com> wrote in message
news:CDE5110E-62B9-4BBE-859C-D9F2301E4952@microsoft.com...
> Hi
>
> When updating vendor invoices from the invoicepool form, you click the
> button 'Purchase order' and you get the Posting Invoice form
> (PurchEditLines).
>
> I would like to update all lines (datasource PurchParmLines) from a class.
> So far I have done the following in Main:
>
> FormRun purchEditLines;
> FormDesign purchEditLinesDesign;
> FormObjectSet purchParmLine;
> FormRealControl lineQty;
> ;
>
> purchEditLines = _args.caller();
> // purchEditLinesDesign = purchEditLines.design();
> purchParmLine = purchEditLines.dataSource(4);
>
> purchParmLineBuffer = purchParmLine.cursor();
> purchParmLineBuffer.ReceiveNow = 3;
> purchParmLineBuffer.doUpdate();
>
> purchParmLine.refresh();
>
>
> This works mostly, but only with ONE line. How do I update more than one
> line, I hope you can help me. Thanks.
>
> Regards
>
> Koffidan
>
>
>
>
>
>
>
> --
> Koffidan
>
>
http://www.koffidan.ubifone.com/eng/d...
Khue Trinh
11/16/2005 8:20:00 AM
0
whenever setting a datasource to menuitem, Axapta will pass the whole table
data to args. you have to loop through the args.record() and check if the
line is marked or not.
This below code from SalesFormLetter to post the sales order:
for (common = formDataSource.getFirst(true) ? formDataSource.getFirst(true)
: formDataSource.cursor(); common; common = formDataSource.getNext())
{
if (!journalList)
{
journalList = new RecordSortedList(common.tableId);
journalList.sortOrder(fieldNum(Common, recId));
}
journalList.ins(common);
}
Hope this help
Khue Trinh
--
ERP Dev.
"koffidan" wrote:
> Hi
>
> When updating vendor invoices from the invoicepool form, you click the
> button 'Purchase order' and you get the Posting Invoice form (PurchEditLines).
>
> I would like to update all lines (datasource PurchParmLines) from a class.
> So far I have done the following in Main:
>
> FormRun purchEditLines;
> FormDesign purchEditLinesDesign;
> FormObjectSet purchParmLine;
> FormRealControl lineQty;
> ;
>
> purchEditLines = _args.caller();
> // purchEditLinesDesign = purchEditLines.design();
> purchParmLine = purchEditLines.dataSource(4);
>
> purchParmLineBuffer = purchParmLine.cursor();
> purchParmLineBuffer.ReceiveNow = 3;
> purchParmLineBuffer.doUpdate();
>
> purchParmLine.refresh();
>
>
> This works mostly, but only with ONE line. How do I update more than one
> line, I hope you can help me. Thanks.
>
> Regards
>
> Koffidan
>
>
>
>
>
>
>
> --
> Koffidan
>
>
http://www.koffidan.ubifone.com/eng/d...
koffidan
11/16/2005 2:10:00 PM
0
Thank you for both your replies, it was helpfull !
But it still doesn't work for me :-(
I have made the following code in my Main method:
PurchParmLine purchParmLine;
FormDataSource purchParmLine_ds;
int i = 0;
;
purchParmLine = _args.record();
if (purchParmLine.dataSource())
purchParmLine_ds = purchParmLine.dataSource();
for (purchParmLine = purchParmLine_ds.getFirst(true) ?
purchParmLine_ds.getFirst(true): purchParmLine_ds.cursor(); purchParmLine;
purchParmLine = purchParmLine_ds.getnext())
{
// Some processing
i++;
}
On the menuitem used on the form PurchEditLines, I have set the property
MultiSelect to Yes.
On the invoice I'm trying to update, I have two purchase lines, but my
counter only counts to one because it's only the record the cursor is
standing on that I find.
How can I get access to all the lines?
Regards
Koffidan
--
Koffidan
http://ww...
"Anton Venter" wrote:
> Have a look at the following article on Axaptapedia
>
http://www.axaptapedia.com/index.php/Multiple_grid_...
>
> "koffidan" <koffidan@discussions.microsoft.com> wrote in message
> news:CDE5110E-62B9-4BBE-859C-D9F2301E4952@microsoft.com...
> > Hi
> >
> > When updating vendor invoices from the invoicepool form, you click the
> > button 'Purchase order' and you get the Posting Invoice form
> > (PurchEditLines).
> >
> > I would like to update all lines (datasource PurchParmLines) from a class.
> > So far I have done the following in Main:
> >
> > FormRun purchEditLines;
> > FormDesign purchEditLinesDesign;
> > FormObjectSet purchParmLine;
> > FormRealControl lineQty;
> > ;
> >
> > purchEditLines = _args.caller();
> > // purchEditLinesDesign = purchEditLines.design();
> > purchParmLine = purchEditLines.dataSource(4);
> >
> > purchParmLineBuffer = purchParmLine.cursor();
> > purchParmLineBuffer.ReceiveNow = 3;
> > purchParmLineBuffer.doUpdate();
> >
> > purchParmLine.refresh();
> >
> >
> > This works mostly, but only with ONE line. How do I update more than one
> > line, I hope you can help me. Thanks.
> >
> > Regards
> >
> > Koffidan
> >
> >
> >
> >
> >
> >
> >
> > --
> > Koffidan
> >
> >
http://www.koffidan.ubifone.com/eng/d...
>
>
>
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Edit datasource fieldvalues
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password