I am using 4.0SP3 25143 build and Sql server 2008 as back end. I have created field Production BOm in Purchase order and written following code to get the data in purchase line by creating menuitem in " Order Command Button"
ProductionBOMLine.RESET; ProductionBOMLine.SETRANGE(“Production BOM No.”,“Production BOM”);
IF PurchLine.FINDLAST THEN
Lno:=PurchLine.“Line No.”
ELSE
Lno:=0;
IF ProductionBOMLine.FINDSET THEN REPEAT
PurchLine.INIT;
PurchLine.VALIDATE(“Document Type”,“Document Type”);
PurchLine.VALIDATE(“Document No.”,“No.”);
PurchLine.VALIDATE(“Buy-from Vendor No.”,“Buy-from Vendor No.”);
PurchLine.VALIDATE(Type,PurchLine.Type::Item);//ProductionBOMLine.Type); when i keep this line it is taking as glacc not item
PurchLine.VALIDATE(“No.”,ProductionBOMLine.“No.”); Lno+=10000;
PurchLine.VALIDATE(“Line No.”,Lno);
IF ProductionBOMLine.“Purchase Quantity”<>’’ THEN
EVALUATE(PurchLine.Quantity,ProductionBOMLine.“Purchase Quantity”);
PurchLine.INSERT(TRUE); UNTIL ProductionBOMLine.NEXT=0;
COMMIT;
It is sucess fully inserting but while deleting the lines i am getting following error
Another user has changed the definition of the Field table after the activity was started.
I am only the person who is accessing the that db
sorry for the double post accidentaly posted but cancelled first one but it posted, I
Since you are writing code I assumed you were a partner, if you are an end user, I would discuss this with your partner, they are trained and know how to do this.
I have recently joined the company which is gold certified partner . It is mainly into AX and CRM. They want to enter in NAV. They are not partner in NAV that’s why I posted in this forum
If the COMMIT command it was never to be used, then I’m sure that the command had already been removed.
When that has been said then I agree that the COMMIT command is something that must be used with care. A lot of care! Because if you don’t then you might end breaking the consistency of NAV transactions.
One of the great things with NAV is it’s ability to roll back a whole transaction (in fact a whole stream of transactions) generated for example by posting a whole journal. If the system while posting the journal finds an error, then the whole journal is rolled back and nothing is posted. If a commit had been done for example after each line, then your system could end up in an inconsistency state, if the line that was posted was part of a multi-line transaction (ie. debit vs credit lines).
There are many other situations where a COMMIT serves a good purpose. But it’s still a command that I would call an ADVANCED COMMAND to be used with care and only by developers who really knows 100% what the function they use it in is doing.