Navision error (10500): RECORDREF variable not initialized.

naimish_hitnaimish_hit Member Posts: 111
edited 2009-03-19 in Navision e-Commerce
Hi

What does this error mean and how to solve it ?

Navision error (10500): RECORDREF variable not initialized.

Regards,

Naimish Dave
Naimish Dave
(Software Engineer)

Comments

  • krikikriki Member, Moderator Posts: 9,112
    Somewhere in the program, the code uses a recordref-variable, but the program didn't initialise it. You can do that with for example MyRecordRef.OPEN(...) or MyRecordRef.GETTABLE(...) or MyRecordRef.DUPLICATE.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • naimish_hitnaimish_hit Member Posts: 111
    Hi,

    I am developing card web part, This wp is used to add new records in Employee Table (T5200).

    I have placed some of fields on my wp and created actions for Create New, Save, Delete etc.

    Now after filling all the fileds on my wp I am clicking on Create New button and receing Navision error (10500): RECORDREF variable not initialized. error.

    I am using Navision 4.0 SP1 with Cronus database.

    Now here how I can implement your suggestion ?

    Naimish
    Naimish Dave
    (Software Engineer)
  • krikikriki Member, Moderator Posts: 9,112
    Hi,

    I am developing card web part, This wp is used to add new records in Employee Table (T5200).

    I have placed some of fields on my wp and created actions for Create New, Save, Delete etc.

    Now after filling all the fileds on my wp I am clicking on Create New button and receing Navision error (10500): RECORDREF variable not initialized. error.

    I am using Navision 4.0 SP1 with Cronus database.

    Now here how I can implement your suggestion ?

    Naimish
    Before doing something with the recordref, you have to OPEN it, so Navision knows to which table you are refering.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • naimish_hitnaimish_hit Member Posts: 111
    Hi,

    Do you know what is the use of EP Temporary Filter?

    I have observed that Codeunit 6822 is inserting some data in this table, where does this table is used ?

    BTW Recordref error has been solved.

    Regards,

    Naimish
    Naimish Dave
    (Software Engineer)
  • krikikriki Member, Moderator Posts: 9,112
    Sorry, I don't know.
    I think you better create another post for this, because it is a completely different problem.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • IHateLinuxIHateLinux Member Posts: 223
    Hi,

    as already noted somewhere else here in this forum again:

    Whenever you want to
    - INSERT
    - MODIFY
    - DELETE

    ANY DATA FROM EP IN NAV

    then you have to add code in the following Codeunits:
    6822 EP Insert Head Data Mgt.
    6823 EP Insert Line Data Mgt.
    6824 EP Modify Head Data Mgt.
    6825 EP Modify Line Data Mgt.
    6826 EP Delete Head Data Mgt.
    6827 EP Delete Line Data Mgt.

    FIRST: Add your custom table to the CASE TableNo OF right in the first codeunit.
    Then you have to create a new function which will then do the modification.

    Why you have to do this?
    Because:
    a.) Primary Keys on insert actions
    Here you can decide how the primary key has to be generated. Sometimes it works with a simple INIT, but like in the SalesLine you have to calculate the next Line No!

    b.) Modify and record ref
    RecordRef do not call any CAL code beyond xRec comparissons (e.g. have a look in Customer table and the call to UpdateContFromCust)
    Therefore sometimes you have to call the code from inside this modification.

    HTH,
    Rainer
  • KalimeruhKalimeruh Member Posts: 12
    Hi there,

    Could you help me with this error? I'm trying to create a new employee in the table Employees of Cronus database... Am i get always the same error!
    I saw your post's and i dind't understood where do you use the code :

    "Somewhere in the program, the code uses a recordref-variable, but the program didn't initialise it. You can do that with for example MyRecordRef.OPEN(...) or MyRecordRef.GETTABLE(...) or MyRecordRef.DUPLICATE."

    I'm new using the Employee Portal, i started 4 days ago...!

    Could you help me?

    Best Regards,

    Afonso Correia
  • krikikriki Member, Moderator Posts: 9,112
    Kalimeruh wrote:
    "Somewhere in the program, the code uses a recordref-variable, but the program didn't initialise it. You can do that with for example MyRecordRef.OPEN(...) or MyRecordRef.GETTABLE(...) or MyRecordRef.DUPLICATE."

    It means you are using a recordreference with SETRANGE, VALIDATE,....
    But first you have to initialise it with OPEN.
    It is the same as with an automation.
    With automation you have to CREATE the variable before using it. Recordreference uses OPEN.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • KalimeruhKalimeruh Member Posts: 12
    Hi there,

    I get an error accessing database when i'm using table Employee Absence.
    I can create and insert a new Entry No. with IEP Insert Head Data Mgt., but when i use EP Modify Head Data Mgt. to save or modify the other data it says that there is another user accessing the database. what should i do?

    the code is here :


    ReturnCode := 0;

    FilterString :=
    STRSUBSTNO('WHERE(1=CONST(%1))',
    DecodeXML.GetValueByFieldIDFromHeadData(XMLDocInHead,EmployeeAbsence.FIELDNO("Entry No.")));

    HeadRecordRef.OPEN(DATABASE::"Employee Absence",FALSE);
    HeadRecordRef.SETVIEW(FilterString);

    xHeadRecordRef.OPEN(DATABASE::"Employee Absence",FALSE);
    xHeadRecordRef.SETVIEW(FilterString);


    IF xHeadRecordRef.FIND('-') THEN;

    IF SupportFunctions.CompareHashValues(DecodeXML.GetHashValue(XMLDocInHead),HeadRecordRef) THEN BEGIN
    EncodeXML.AddFieldToValidationDoc(XMLDocValField,EmployeeAbsence.FIELDNO("Entry No."));
    EncodeXML.AddFieldToValidationDoc(XMLDocValField,EmployeeAbsence.FIELDNO("Employee No."));
    EncodeXML.AddFieldToValidationDoc(XMLDocValField,EmployeeAbsence.FIELDNO("From Date"));
    EncodeXML.AddFieldToValidationDoc(XMLDocValField,EmployeeAbsence.FIELDNO("To Date"));
    EncodeXML.AddFieldToValidationDoc(XMLDocValField,EmployeeAbsence.FIELDNO("Cause of Absence Code"));
    EncodeXML.AddFieldToValidationDoc(XMLDocValField,EmployeeAbsence.FIELDNO(Description));
    EncodeXML.AddFieldToValidationDoc(XMLDocValField,EmployeeAbsence.FIELDNO(Quantity));
    EncodeXML.AddFieldToValidationDoc(XMLDocValField,EmployeeAbsence.FIELDNO("Unit of Measure Code"));

    DecodeXML.ModifyRecord(XMLDocInHead,HeadRecordRef,XMLDocValField,DATABASE::"Employee Absence",
    TRUE,FALSE,AdditionalValues[1],AdditionalValues[2]);

    HeadRecordRef.MODIFY(TRUE);

    END ELSE BEGIN
    ReturnCode := 20;
    END;

    HeadFieldRef := HeadRecordRef.FIELD(EmployeeAbsence.FIELDNO("Entry No."));
    tmpOption := HeadFieldRef.VALUE;
    tmptext := FormatFunctions.OptionToText(tmpOption);
    SupportFunctions.CreateTempHeadFilterTable(EmployeeAbsence.FIELDNO("Entry No."),tmptext,GUID);

    SupportFunctions.CreateTempHeadFilterKeys(EmployeeAbsence.FIELDNO("Entry No."),GUID);

    Best Regards,

    Afonso Correia.

    Sorry for my English
  • anandfssfssanandfssfss Member Posts: 10
    Hi all,

    While modify records through Employee portal i am getting "Navision error (10500): RECORDREF variable not initialized" message.

    ](*,)

    But same its working in customer card(i can able to modify records).

    Even i declared that table in the case statement. Below is my function to modify the record.



    ReturnCode := 0;

    FilterString :=
    STRSUBSTNO('WHERE(1=CONST(%1))',
    DecodeXML.GetValueByFieldIDFromHeadData(XMLDocInHead,"New Activity updation".FIELDNO("SegmentNo.")));

    HeadRecordRef.OPEN(DATABASE::"New Activity updation",FALSE);
    HeadRecordRef.SETVIEW(FilterString);

    xHeadRecordRef.OPEN(DATABASE::"New Activity updation",FALSE);
    xHeadRecordRef.SETVIEW(FilterString);
    IF xHeadRecordRef.FIND('-') THEN;

    IF SupportFunctions.CompareHashValues(DecodeXML.GetHashValue(XMLDocInHead),HeadRecordRef) THEN BEGIN
    EncodeXML.AddFieldToValidationDoc(XMLDocValField,"New Activity updation".FIELDNO("Salesperson Code"));
    EncodeXML.AddFieldToValidationDoc(XMLDocValField,"New Activity updation".FIELDNO("Report Date"));
    EncodeXML.AddFieldToValidationDoc(XMLDocValField,"New Activity updation".FIELDNO("Salesperson Code"));
    EncodeXML.AddFieldToValidationDoc(XMLDocValField,"New Activity updation".FIELDNO("Working City"));
    EncodeXML.AddFieldToValidationDoc(XMLDocValField,"New Activity updation".FIELDNO("Employee No."));
    EncodeXML.AddFieldToValidationDoc(XMLDocValField,"New Activity updation".FIELDNO("Contact No."));

    DecodeXML.ModifyRecord(XMLDocInHead,HeadRecordRef,XMLDocValField,DATABASE::"New Activity updation",
    TRUE,FALSE,AdditionalValues[1],AdditionalValues[2]);

    HeadRecordRef.MODIFY(TRUE);
    END ELSE BEGIN
    ReturnCode := 20;
    END;

    HeadFieldRef := HeadRecordRef.FIELD("New Activity updation".FIELDNO("SegmentNo."));
    tmpValue := HeadFieldRef.VALUE;

    SupportFunctions.CreateTempHeadFilterTable("New Activity updation".FIELDNO("SegmentNo."),tmpValue,GUID);

    SupportFunctions.CreateTempHeadFilterKeys("New Activity updation".FIELDNO("SegmentNo."),GUID);


    What to do afterthat?

    Thanks in advance ,
    regards
    Anand
  • mikmothmamikmothma Member Posts: 5
    I've the same problem....any idea?
  • IHateLinuxIHateLinux Member Posts: 223
    Hi,

    this can not be answered by just one hint, because there are many possible areas where the error can occur.

    Therefore please use the search in the forums to find my How To run a client as NAS and activate the debugger. Then you should be able to easily track down the error.
    Please post your
    - Current Code
    - and if succesful your solution
    in the forum so that other can learn from it.

    Thanks.

    KR
    Rainer
  • slavc007slavc007 Member Posts: 7
    Hello IHateLinux,

    i can not find your posto you have wrote. Can you post a link of that, please.
    I have serious problems with modify table 83 - Item Journal Line.

    please, help me.

    thank you,

    Best regards,

    Slavisa
Sign In or Register to comment.