Hello expert
How to pass parameter using vs code for dynamics 365 bc ?
Dear christelle m ,
finally below code has been successfully read data from respective table
You have to fix your filter and range. The filter cannot select any record, might be because your filter is incorrect.
Dear christelle m
when i debugging showing like this
"There is no CutBackBatchTable within the filter. Filters: Bill Code: "
Dear christelle m
thank you
i will update you soon ,thank you for help me
You may add it on the onAction trigger.
action("fetch")
{
caption = 'Fetch';
Promoted = true;
PromotedCategory = Process;
PromotedOnly = true;
PromotedIsBig = true;
ApplicationArea = All;
trigger OnAction()
begin
CutBackBatch.SetRange(<Field>, <value>); <-------- add your range here
CutBackBatch.FindFirst();
Billcode := CutBackBatch.BillCode;
License := CutBackBatch.License;
end;
Dear christelle m ,
Thank you for quick reply
page 50106 CutBackProcessWorksheetPage
{
PageType = Worksheet;
ApplicationArea = All;
UsageCategory = Administration;
SourceTable = CutBackProcessTable;
Caption = 'Cutback Process';
layout
{
area(Content)
{
field("Batch Name"; "Batch Name")
{
ApplicationArea = All;
}
field("PostingDate"; "Posting Date")
{
ApplicationArea = All;
}
repeater(CutbackProcess)
{
field("Posting Date"; "Posting Date")
{
ApplicationArea = All;
}
field("Account Category"; "Account Category")
{
ApplicationArea = All;
}
field("Bill Code"; "Bill Code")
{
ApplicationArea = All;
}
field("Partner"; "Partner")
{
ApplicationArea = All;
}
field("License"; "License")
{
ApplicationArea = All;
}
field("Percentage"; "Percentage")
{
ApplicationArea = All;
}
field("Account"; "Account")
{
ApplicationArea = All;
}
field("Account Description"; "Account Description")
{
ApplicationArea = All;
}
field("AFE"; "AFE")
{
ApplicationArea = All;
}
field("Amount"; "Amount")
{
ApplicationArea = All;
}
field("Posted"; "Posted")
{
ApplicationArea = All;
}
}
}
}
actions
{
area(Processing)
{
group(Setup)
{
action("Calculate")
{
Caption = 'Calculate';
Promoted = true;
PromotedCategory = Process;
PromotedOnly = true;
PromotedIsBig = true;
// RunObject = page "CutBackBatchPage";
ApplicationArea = All;
trigger OnAction()
begin
// Message('Please select the batch name ');
end;
}
action("Post")
{
Caption = 'Post';
Promoted = true;
PromotedCategory = Process;
PromotedOnly = true;
PromotedIsBig = true;
ApplicationArea = All;
trigger OnAction()
begin
end;
}
action("Print")
{
Caption = 'Print';
Promoted = true;
PromotedCategory = Process;
PromotedOnly = true;
PromotedIsBig = true;
ApplicationArea = All;
trigger OnAction()
begin
end;
}
action("Post and Print")
{
Caption = 'Post and Print';
Promoted = true;
PromotedCategory = Process;
PromotedOnly = true;
PromotedIsBig = true;
ApplicationArea = All;
trigger OnAction()
begin
end;
}
action("fetch")-----------------------------------------here am using fetch button where i can use your code
{
caption = 'Fetch';
Promoted = true;
PromotedCategory = Process;
PromotedOnly = true;
PromotedIsBig = true;
ApplicationArea = All;
trigger OnAction()
begin
end;
}
}
}
}
}
If each form has different table, you just have to select the other table and get their values.
You have to add onAfterValidate() trigger on the Batch name field and you select the table values from there. See code below.
field("Batch Name", "Batch Name")
{
onBeforeValidate()
begin
Table.SetRange(<Field>, <value>);
Table.FindFirst();
Billcode := Table.BillCode;
License := Table.License;
end;
}
Hello christelle m ,
actually my requirement is how to read (fetch data ) from one table to another table . So here
Requirement is below
I have 2 pages-> Page 1 & Page 2.
Now I need to Page 1 field value in Page 2.
To Achieve this, create a function in Page 2
Based on data create param & Variable.
Now in Page one declare a variable of Page2 and Call this function,Please find below screenshot when i push to fetch event should be read data from cutbackbatch table to cutback process table
Hi, where would you like to pass parameter from? what object to another object?