Start Dataport and change Warnings in Sales&Receivable S

MarcelWMarcelW Member Posts: 46
Hello,

I have a dataport to fill the Sales Journal ( Table: Gen. Journal Line).
It starts by clicking a button in the Form "Sales Journal".
The database has set the Warnings in the Sales & Receivalble Setup to "both warnings". Thats works as long as i do not use a customer that have no overdue balance, because then the warnings starts and the process cancels with the message:

"The following C/AL functions can only to a limited degree during write transactions(because one or more tables will be locked)
...
Form.runmodal()...
Codunit.run()...
..."

How can i handle this constraint? I tried to change the warnings to "no warning", start the dataport and after that set warnings back.
But i have no writing access to the table when i use the dataport?!

Please help!

:D I wisch u all very nice christmas days

Comments

  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    I know the sales header and line table have a function that prevent this message from occuring when you set some parameter. Have you looked for this function in the general journal line?

    Otherwise you may want to make one.
  • kinekine Member Posts: 12,562
    I do not know about this warning on Gen. journal lines... may be some customization?
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • MarcelWMarcelW Member Posts: 46
    Thx for the answers,

    but cant find such method in gen. journal line or the sales header / line.
    Some other ideas to solve this problem?

    Marcel
  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    Look for this piece of code
    Journal Template Name - OnValidate()
    Amount := ROUND(Amount,Currency."Amount Rounding Precision");
    IF (CurrFieldNo <> 0) AND
       (CurrFieldNo <> FIELDNO("Applies-to Doc. No.")) AND
       ((("Account Type" = "Account Type"::Customer) AND
         ("Account No." <> '') AND (Amount > 0) AND
         (CurrFieldNo <> FIELDNO("Bal. Account No."))) OR
        (("Bal. Account Type" = "Bal. Account Type"::Customer) AND
         ("Bal. Account No." <> '') AND (Amount < 0) AND
         (CurrFieldNo <> FIELDNO("Account No."))))
    THEN
      CustCheckCreditLimit.GenJnlLineCheck(Rec);
    

    You can add a global variable HideValidationDialog

    And create this function to activate it
    SetHideValidationDialog(NewHideValidationDialog : Boolean)
    HideValidationDialog := NewHideValidationDialog;
    

    Then add the code to hide the thingy.
  • MarcelWMarcelW Member Posts: 46
    If i understand u correct i should activate or deaktivate the boolean var and if the status is true do not start CustCheckCreditLimit.GenJnlLineCheck(Rec);
    otherwise do.

    I did so, bit it doesnt work. The same message appears if i
    try to import the lines :cry:

    But thanks for all until now!

    Anyone with another idea?
  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    Can you please post the code? It should work.

    Have you tried debugging?
Sign In or Register to comment.