Sales order problem with C/AL code

johnson_alonso
Member Posts: 690
Dear all,
I have a problem relate to C/AL code. the problem is when I create Sales Order and insert the item in the line along with qty of item to a certain customer, then fill the requested delivery date, afterwards shipment date, where both of them is in the same date, but when I change shipment date earlier than delivery date or vice versa, this message windows come:
the following C/AL functions can be used only to a limited degree during write transactions
(because one or more tables will be locked)
Form.RunModal() is not allowed in write transactions.
CodeUnit.Run() is allowed in write transactions only if the return value is not used. For example, 'OK :=CodeUnit.RUn()' is not allowed.
Report.RunModal() is allowed in write transactions only if 'RequestForm = FALSE'.
For example,'Report.RunModal(...,FALSE)' is allowed.
DataPort.RunModal() is allowed in write transactions only if 'RequestForm = FALSE'.
For example, 'DataPort.RunModal(...,FALSE)' is allowed.
Use the COMMIT function to save the changes before this call, or structure the code differently.
Pls let me know how to cope with this problem. I never find this problem before and I never change the codeunit, and add anything else.
#-o ](*,) :-k
tku for your atttention
rgds,
Johnson "the greatest Danish" Alonso
I have a problem relate to C/AL code. the problem is when I create Sales Order and insert the item in the line along with qty of item to a certain customer, then fill the requested delivery date, afterwards shipment date, where both of them is in the same date, but when I change shipment date earlier than delivery date or vice versa, this message windows come:
the following C/AL functions can be used only to a limited degree during write transactions
(because one or more tables will be locked)
Form.RunModal() is not allowed in write transactions.
CodeUnit.Run() is allowed in write transactions only if the return value is not used. For example, 'OK :=CodeUnit.RUn()' is not allowed.
Report.RunModal() is allowed in write transactions only if 'RequestForm = FALSE'.
For example,'Report.RunModal(...,FALSE)' is allowed.
DataPort.RunModal() is allowed in write transactions only if 'RequestForm = FALSE'.
For example, 'DataPort.RunModal(...,FALSE)' is allowed.
Use the COMMIT function to save the changes before this call, or structure the code differently.
Pls let me know how to cope with this problem. I never find this problem before and I never change the codeunit, and add anything else.
#-o ](*,) :-k
tku for your atttention
rgds,
Johnson "the greatest Danish" Alonso
subscribe to:
sea-navision-community-subscribe@yahoogroups.com
detail in:
http://sea-navision-community.blogspot.com
sea-navision-community-subscribe@yahoogroups.com
detail in:
http://sea-navision-community.blogspot.com
0
Comments
-
you have several options. Either not validate the fields.
The second option is find where
ItemCheckAvail.SalesLine is called and comment out in the following codeIF ((CalledByFieldNo = CurrFieldNo) OR (CalledByFieldNo = FIELDNO("Shipment Date"))) AND GUIALLOWED AND ("Document Type" IN ["Document Type"::Order,"Document Type"::Invoice]) AND (Type = Type::Item) AND ("No." <> '') AND ("Outstanding Quantity" > 0) AND ("Appl.-to Job Entry" = 0) AND ("Job Applies-to ID" = '') AND NOT (Nonstock OR "Special Order") THEN ItemCheckAvail.SalesLineCheck(Rec);
this line needs to be changed
(CalledByFieldNo = FIELDNO("Shipment Date")) in above.
Third option is to create a functionon sales line let say skipItemavailcheck
call this function before validation and set a global boolean (SKIPITEMAVAILBILITY) to true in that function. Then add the boolean to the above if statement
NOT (Nonstock OR "Special Order")
//Start mod
AND NOT SKIPITEMAVAILBILITY
//End mod
THEN
ItemCheckAvail.SalesLineCheck(Rec);[/code]0 -
I think the third option will not be concerned, the second option also not affect it yet.
I still got the problem.subscribe to:
sea-navision-community-subscribe@yahoogroups.com
detail in:
http://sea-navision-community.blogspot.com0 -
turn on the debugger and see where it stops. Basically you have write code to not open any form what ever form it might be.0
-
Debugger is the final option will be used, but it's really difficult to me to do that, because it's related to client. I can use Esc button to avoid the message and the shipment date is changed anyway in the sales line, but the item availability confirmation skipped automatically.
8)
nevertheless, tku.
rgds,subscribe to:
sea-navision-community-subscribe@yahoogroups.com
detail in:
http://sea-navision-community.blogspot.com0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions