journal voucher

surisuri Member Posts: 123
hi all
i have question,Stop posting of a JV(journal voucher) if that posting document No. already exisits in G/L entries.

how can i solve this question can any one can give suggestion please.
thank you

Comments

  • ChinmoyChinmoy Member Posts: 359
    Can you elaborate on your question some more?
  • surisuri Member Posts: 123
    hi all,

    we have a g/l entry table ,in that we have document no field...
    coming to forms we have general journal in this we have document no
    when we are entering document no in the forms of general journal....if it was already exists in document no of g/l entry table ...
    it must need to throw an error ,document no already exists....
    this my actual question,can any one can give suggestion
    thank you
  • surisuri Member Posts: 123
    hi all
    i have written this code

    document no onvalidate();
    glentry.INIT;
    IF "Document No." <>glentry."Document No." THEN
    glentry.INSERT
    ELSE
    ERROR('document no already exists');

    i am not getting the error
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    Why are you inserting entry into G/L Entry table?

    You just have to check whether Document No. is already existing or not.

    You have put filter on G/L Entry Document No. field with Current Document No. and if it found then show error message..
  • surisuri Member Posts: 123
    thanks for giving reply
    mohana

    even though i am not getting ...what you have suggested i have done
    thank you....
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    suri wrote:
    even though i am not getting ...what you have suggested i have done
    Can you show us please..
  • surisuri Member Posts: 123
    in g/l entry we have document no
    document no
    100
    200
    300

    in general journal form we have document no field
    if we are again entering the same values
    let us consider with the number 300..then it was inserting into the g/l entry document no field
  • surisuri Member Posts: 123
    i have also tried like this
    onvalidate()
    if document.no=g/lentry.document no then
    begin
    message('document no already exists');
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    suri wrote:
    let us consider with the number 300..then it was inserting into the g/l entry document no field
    If we enter value in Document No. then it wont insert entry in G/L Entry table..when we post the lines then it will insert entries in G/L Entry.
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    suri wrote:
    i have also tried like this
    onvalidate()
    if document.no=g/lentry.document no then
    begin
    message('document no already exists');

    Where did you get glentry table?
    You need to either use GET/SETRANGE/FINDFIRST to get the G/L Entry..
  • surisuri Member Posts: 123
    when we are posting i am getting error like this,can you suggest me in detail please
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    You must have set "No. Series" in General Journal Batches..which will check for Next No. each time and it will not allow duplicate no.
  • surisuri Member Posts: 123
    we have a batch name:cash and default
    i kept batch name:cash and no.series=gen journal
    i have checked like this i am getting the same error
    can you briefly explain what the process is going on
    why we have to keep batch name:cash/default and as well as no series
    thank you
Sign In or Register to comment.