Why do you need this change?
We need to use the standar functions for InsertReceivableDocs or InsertPayableDocs in batch mode without open a form for select the "Cartera Docs." to insert
Describe the request
We nee taht the code will be Refactor using new functions creating a new function with the code after the Run of the page, for use externally, like this:
Old Code
if CarteraDocuments.RunModal() <> ACTION::LookupOK then
exit;
CarteraDocuments.GetSelected(CarteraDoc);
Clear(CarteraDocuments);
if not CarteraDoc.Find('-') then
exit;
New Code
if CarteraDocuments.RunModal() <> ACTION::LookupOK then
exit;
CarteraDocuments.GetSelected(CarteraDoc);
Clear(CarteraDocuments);
InsertSelectedCarteraDocs(GroupNo, BillGr, CarteraDoc)
end;
procedure InsertSelectedCarteraDocs(GroupNo: Code[20]; var BillGr: Record "Bill Group"; var CarteraDoc: Record "Cartera Doc.")
var
BankAcc: Record "Bank Account";
CarteraSetup: Record "Cartera Setup";
CustLedgEntry: Record "Cust. Ledger Entry";
CheckDiscCreditLimit: Page "Check Discount Credit Limit";
SelectedAmount: Decimal;
begin
if not CarteraDoc.Find('-') then
exit;
Internal work item: AB#635592
Why do you need this change?
We need to use the standar functions for InsertReceivableDocs or InsertPayableDocs in batch mode without open a form for select the "Cartera Docs." to insert
Describe the request
We nee taht the code will be Refactor using new functions creating a new function with the code after the Run of the page, for use externally, like this:
Old Code
if CarteraDocuments.RunModal() <> ACTION::LookupOK then
exit;
CarteraDocuments.GetSelected(CarteraDoc);
Clear(CarteraDocuments);
if not CarteraDoc.Find('-') then
exit;
New Code
if CarteraDocuments.RunModal() <> ACTION::LookupOK then
exit;
CarteraDocuments.GetSelected(CarteraDoc);
Clear(CarteraDocuments);
InsertSelectedCarteraDocs(GroupNo, BillGr, CarteraDoc)
end;
procedure InsertSelectedCarteraDocs(GroupNo: Code[20]; var BillGr: Record "Bill Group"; var CarteraDoc: Record "Cartera Doc.")
var
BankAcc: Record "Bank Account";
CarteraSetup: Record "Cartera Setup";
CustLedgEntry: Record "Cust. Ledger Entry";
CheckDiscCreditLimit: Page "Check Discount Credit Limit";
SelectedAmount: Decimal;
begin
if not CarteraDoc.Find('-') then
exit;
Internal work item: AB#635592