How to link a series no. to a field in a page

poppinspoppins Member Posts: 647
edited 2013-07-02 in NAV Three Tier
Hi everyone,

I am creating a page and I want the field No. to be generated by a series no.

I created a new series no. in the series no. page, I assigned it to my page in the setup page(I created it too) and I used the following code in the source table of my page:
OnInsert()
expMgtSetup.GET;
IF "No." = '' THEN BEGIN
      expenseMgtSetup.TESTFIELD(Number);
      NoSeriesMgt.InitSeries(expenseMgtSetup.Number,xRec."Series No.",0D,"No.","Series No.");


No. - OnValidate()

IF "No." <> xRec."No." THEN BEGIN
      exMgtSetup.GET;
      NoSeriesMgt.TestManual(expenseMgtSetup.Number);
      "Series No." := '';
END;

END;

but I got nothing, when I try to make a new page, the field No. shows as a textbox with no button to select the series no.....
I wonder what shall I do to link this particular series no. to my page...
What am I missing?

Thanks in advance :)

Answers

  • mohana_cse06mohana_cse06 Member Posts: 5,504
    You need to write code on No. - OnAssistEdit() trigger for selecting the No. Series.
    check page 42 for example..

    Did you try by pressing TAB/Enter...is it generating new number?
  • poppinspoppins Member Posts: 647
    You need to write code on No. - OnAssistEdit() trigger for selecting the No. Series.
    check page 42 for example..

    Did you try by pressing TAB/Enter...is it generating new number?
    It is not generating any number...
    I tried the following code:
    IF AssistEdit(xRec) THEN
    CurrPage.UPDATE;
    
    
    and got the following error message:
    You have specified an unknown variable.
    AssistEdit
    
    Define the variable under 'Global C/AL symbols'.
    
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    AssistEdit is a function..you need to add that function also..

    If it is not generating any number after pressing TAB/Enter then check the created No. Series properly..
    Debug the code..where you have missed the code/setup..
  • lvanvugtlvanvugt Member Posts: 774
    Let NAV be your guide, meaning: have a look in the standard objects how this is done. Note that most code is to be found on the table and not on the page/form.

    BTW: have a look at this post Tip #21 - Implementing No. Series.
    Luc van Vugt, fluxxus.nl
    Never stop learning
    Van Vugt's dynamiXs
    Dutch Dynamics Community
  • poppinspoppins Member Posts: 647
    AssistEdit is a function..you need to add that function also..

    If it is not generating any number after pressing TAB/Enter then check the created No. Series properly..
    Debug the code..where you have missed the code/setup..

    I added the AssistEdit function in the source table of my page and it worked...
    Thanks a lot :mrgreen:
  • poppinspoppins Member Posts: 647
    lvanvugt wrote:
    Let NAV be your guide, meaning: have a look in the standard objects how this is done. Note that most code is to be found on the table and not on the page/form.

    BTW: have a look at this post Tip #21 - Implementing No. Series.

    Thanks for the tip :)
Sign In or Register to comment.