Options

Open job journal from job card

dabba23dabba23 Member Posts: 77
Hey,

I need to open Job Journal from the Job Card.

I have already made a function in the job journal form with a parameter to take the Job No. when I run the Job Journal from the Job Card.
I then set a global variable equal to the parameter and on the trigger OnNewRecord I set Job No. equal to the global variable.

But how do I get it to set the filter for the Journal Template Name field in the job journal line.

Anyone tried this before?

Thanks Ann

Comments

  • Options
    DenSterDenSter Member Posts: 8,304
    Turn on the debugger and open the Job Journal from the menu. There is some code in there that sets those filters, and from there you should be able to figure out how to set those filters in your own code.
  • Options
    dabba23dabba23 Member Posts: 77
    I realise I can use the code from the codeunit JobJnlManagement, but I am confused on how to also pass the Job No. over to the journal!

    Able to guide me?

    Thanks Ann
  • Options
    DenSterDenSter Member Posts: 8,304
    I'd probably add the JobNo as a global of the form (let's say a Code20 variable called MyJobNo), and create a public function called 'SetJobNumber', with a code variable as a parameter, and pass the job number into the form that way.
    SetJobNumber(parJobNo : Code[20])
    MyJobNo := parJobNo;
    
    and from there on out you can use the value of the MyJobNo variable throughout the form.

    Does that make sense?
  • Options
    dabba23dabba23 Member Posts: 77
    Thats what I believe I wrote in my first post.

    I have from the job card menu written this to pass on the job no:


    JobJournalForm.SetJobNo("No.");
    JobJournalForm.RUN;

    This code will pass on the Job No. from the Job Card to the Job Journal.

    But again, not sure how to combine this with the filters for the template.

    Thanks Ann
  • Options
    DenSterDenSter Member Posts: 8,304
    I guess I don't understand how you want to use the Job number in the filtering for templates. Maybe you should consider adding the template to the Job Card and get it from there.
Sign In or Register to comment.