Error during Creation or Updating

TOMTEFARTOMTEFAR Member Posts: 8
Hello,

I'm trying to update a SalesHeader and keep getting error messages.

It works if I only set the NO. filed. But as soon as I try to set any other data I get an error.

Navision communication exception: 1011 21: The field called <Sales Header> or
with Number <> does not exist in table 36.

Since I'm new to Navision and don't have access to any documentation its a bit tricky.

Also if I try to create the entry with any other data than no data or NO. I get the following error:

Navision communication exception: 1011 21: The Sales Header does not exist.
Identification fields and values:
Document Type='Quote',No.=''

Do you have any idea what I might be doing wrong?
Do you know what the errors mean?

Comments

  • kapamaroukapamarou Member Posts: 1,152
    Can you show us your code?
  • jannestigjannestig Member Posts: 1,000
    Tjena tjena

    What is your code attempting to update on the sales header, you should be able to update most things on the sales header depending what status the lines are at EG invoiced shipped etc,

    If you can explaining the purpose of the update we can understand your code and desired results
  • NaviDevNaviDev Member Posts: 365
    TOMTEFAR wrote:
    Navision communication exception: 1011 21: The Sales Header does not exist.
    Identification fields and values:
    Document Type='Quote',No.=''

    This error means that you are trying to modify something that isnt on the Sales Header. For example you trying to modify a record without poiting to a certain record.

    Create a codeunit and declare a variable recSalesHeader for record Sales Header. Then place a code in the OnRun like this.
    recSalesHeader.MODIFY;
    

    Then save your codeunit. Run the codeunit. Then it would give the same error you are encountering.

    To avoid this error. You must point your pointer to a certain record. You can use the filtering then use the find('-') command.
    recSalesHeader.RESET;
    recSalesHeader.SETRANGE("No.", FilteringValue);
    IF recSalesHeader.FIND('-') THEN BEGIN
      //do what ever you want modification on fields here
      recSalesHeader.MODIFY; 
    END;
    
    Navision noob....
  • TOMTEFARTOMTEFAR Member Posts: 8
    Thankyou for your input. The problem was actually a framework bug in our Celenia integration.
Sign In or Register to comment.