this should go without an extra function. In Page 39, trigger OnOpenPage is this standard code:
BalAccName:='';OpenedFromBatch:=("Journal Batch Name"<>'') AND ("Journal Template Name"='');
IF OpenedFromBatch THEN BEGINCurrentJnlBatchName:="Journal Batch Name";GenJnlManagement.OpenJnl(CurrentJnlBatchName,Rec);
EXIT;END;GenJnlManagement.TemplateSelection(PAGE::"General Journal",0,FALSE,Rec,JnlSelected);
IF NOT JnlSelected THEN
ERROR('');GenJnlManagement.OpenJnl(CurrentJnlBatchName,Rec);
When you set the gen. jnl. batch name (and only this field) in the Gen. Jnl Line record before calling the page with it, then it should work. I would define the Gen. Jnl. Line as a local variable on the page action, though.
I want to open a custom page (similar to page id 39) thru a specific "Journal Template Name" & a "Journal Batch Name" too.
Please look the Code of OnOpen Page (Custom Page)...
OnOpenPage()BalAccName:='';
IF IsOpenedFromBatch THEN BEGINCurrentJnlBatchName:="Journal Batch Name";GenJnlManagement.OpenJnl(CurrentJnlBatchName,Rec);SetControlAppearance;
EXIT;END;GenJnlManagement.TemplateSelection(PAGE::"General Journal",0,FALSE,Rec,JnlSelected);
IF NOT JnlSelected THEN
ERROR('');GenJnlManagement.OpenJnl(CurrentJnlBatchName,Rec);SetControlAppearance;
Due to above function called "IsOpenedFromBatch" in the SourceTable 81, I am not able to execute the same.
The Code of "IsOpenedFromBatch" is given below.
IsOpenedFromBatch():BooleanBatchFilter:= GETFILTER("Journal Batch Name");
IF BatchFilter<>'' THEN BEGINTemplateFilter:= GETFILTER("Journal Template Name");
IF TemplateFilter<>'' THEN
GenJournalBatch.SETFILTER("Journal Template Name",TemplateFilter);GenJournalBatch.SETFILTER(Name,BatchFilter);GenJournalBatch.FINDFIRST;END;
EXIT((("Journal Batch Name"<>'') AND ("Journal Template Name"='')) OR (BatchFilter<>''));
I have tried to achieve my goal thru different ways but I can't get the positive result.
Please suggest the best solution for the same without hampering standard code/code blocking..
Comments
ArcherPoint, Inc http://www.archerpoint.com
Blog: http://www.navisionworld.com
skkulla
this should go without an extra function. In Page 39, trigger OnOpenPage is this standard code:
When you set the gen. jnl. batch name (and only this field) in the Gen. Jnl Line record before calling the page with it, then it should work. I would define the Gen. Jnl. Line as a local variable on the page action, though.
with best regards
Jens
I want to open a custom page (similar to page id 39) thru a specific "Journal Template Name" & a "Journal Batch Name" too.
Please look the Code of OnOpen Page (Custom Page)...
Due to above function called "IsOpenedFromBatch" in the SourceTable 81, I am not able to execute the same.
The Code of "IsOpenedFromBatch" is given below.
I have tried to achieve my goal thru different ways but I can't get the positive result.
Please suggest the best solution for the same without hampering standard code/code blocking..
Thanks,
Navuser1