How to add editable field to Item Ledger Entry

Hi all,

Suppose I have created a field Complain in Item Ledger Entry Table and want to store some data through the Form Posted Item tracking Lines ( which is available from Posted Sales Shipment —> Line----> Item tracking Entries )

suppose this form is editable.

How can I do this ??

You should have a look at the “Customer ledger entries” form.

In the “OnModify” trigger of the form you should run a codeunit with the current record (REC).

The codeunit must have sufficient permissions to modify the record.
See the CU 103 “Cust. Entry-Edit” to see how Navision does it in standard.

Make sure that you only set the fields you really want to modify.
Using the CU for any other purpose (changing wrong fields) could destroy the consistency of the item ledger entry table.

Dear Tomas,

Thanks for your Valuable reply. I’m not doing this with Item Ledger Entry Table.But the scenario is the same which I want to do !!

Actually I have Created a Functionlity Complian Logs in Nav 5.0 Sp1 [Native].I have taken two Objects one is Table Sales Complain Logs and a Form Complain logs.

The form is attached to the Posted Shipments and Posted Invoices in Sales Module.

The form Complain logs is populated when Someone click the Command buttam **Complain Log.**It’s populated temporary as same thing we can see Posted Item tracking Lines ( which is available from Posted Sales Shipment —> Line----> Item tracking Entries )

The form Complain Log is populated with taking



Document Type



Order No.



Line No.



Date



Item Code



Comment



Document Line No.



Serial No.

And the serial No. is retrieving from using the same functionlity as is in Posted Sales Shipment —> Line----> Item tracking Entries ……………

But user have to enter the Comment and it should be saved permanently

Yeap, no problem.
In the codeunit you need to “GET” the item ledger entry with the same number as in the temporary item ledger entry passed to the codeunit.
Then you assign the comment to the comment field of the real item ledger entry and call a modify on it. (Don’t forget to set the permission of the codeunit to “modify” for table 32).
Now it is permanently saved in the comment filed in the item ledger entry table.

The question is what is the Complain Log doing?

6102.CalinForm.bmp (255 KB)I’ll follow your suggestion.But first i want to show my work.

In codeunit 6500

1106.CalINCU.bmp (1.26 MB)

In Complain Log form (Comment field OnValiadte)

1805.CalinForm.bmp (255 KB)

And the system is currently not doing what you expect? The code does not look too bad - even though I would do it a little bit different:
But basically it should work properly.

Especially in the Comment - OnValidate():

InsertSalesComplainLogs := Rec;
InsertSalesComplainLogs.SETRECFILTER()
IF NOT InsertSalesComplainLogs.FINDFIRST THEN BEGIN
InsertSalesComplainLogs := Rec;
InsertSalesComplainLogs.INSERT;
END;
InsertSalesComplainLogs.Comment := Comment;
InsertSalesComplanLogs.MODIFY;

What exactly does the system NOT do?

Thanks Thomas…!

Complain Log

Client requires a detailed Complaint Management functionality. The Complaints lodged for the products, which are sold, will be mapped with the sold items. Management will review the Complaints logged.

Now your reply solve my question.But still i want to know from you to modify record what Option I have to choose

a) Call Codeunit or somethimg else into the form trigger

b) write the record modification code in the form OnValiadate trigger.

I would rather go for a codeunit and permitt that codeunit to change your table only.
This is safer as it does not allow changing fields which should not being changed otherwise.

And I would put this in the “OnModify” trigger of the form rather than using the “OnValidate” trigger of the field.
Anyway as long as it works for you it is OK. There are no definite “rules” for doing such things - maybe just a suggestion of “good practice”.
You should also consider to delete lines in your log when the user removes the comment.

Thanks Thomas!

I hv written the code in a Function EditSalesComplainLogs of a CU (ID 50000) & written the code for deletaion the CommnetLess Sales Complain Log entries.Call this Function in the “OnModify” trigger of the form .

To do this I hv chenged in the code which I want to show

Code for Edit/Delete Sales Complain Logs

In CU 6500 function LimRetrieveILEFromShpt

0753.CALCCU.bmp (1.43 MB)

Nice, but where is your problem now? What is not working as expected?

No problem.Now it is working fine.

Thanks for support and suggestion.

Cool, please do verify the solution(s) which helped you to solve your problem by clicking the “Verify Solution” button in the post(s).
This will earn you and the poster of the correct answer(s) points and will show other members that your problem has been solved.

And Subrata, also only verify the reply that actually contained the solution. Not Thomas replies where he ask you to verify the solution or if your problem was solved. I have removed the verification on those two.

The idea with the verification is two part:

  1. To credit the expert that helped you find THE SOLUTION that solved your problem.
  2. To help other members who have the same problem as you. If you have verified the correct answer, then they can easily see if the problem was solved and which reply did actually help you out.

Big Mistake[:P]

Remember it in future