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!
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 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!
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.
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...!
"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!
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?
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"));
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.
Comments
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
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
(Software Engineer)
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
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
(Software Engineer)
I think you better create another post for this, because it is a completely different problem.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
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
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
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.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
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
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
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
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