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
IF ProductionBOMLine.FINDSET THEN REPEAT
PurchLine.VALIDATE(“Document Type”,“Document Type”);
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
IF ProductionBOMLine.“Purchase Quantity”<>’’ THEN
PurchLine.INSERT(TRUE); UNTIL ProductionBOMLine.NEXT=0;
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
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.