Dimension update in the record

memula
Member Posts: 30
The task is:
I have new created form-card with 2 glob. dimensions. Also i've made
code in those triggers onValidate() to get descriptions of the dimensions.
When i change them dirctly on the form it's work ok, but when i try to update them from "default dimensions" form onValidate() triggers dose not
work and descriptions stay empty. Maybe somebody knows how can i solve this problem.
pre Thanx.
I have new created form-card with 2 glob. dimensions. Also i've made
code in those triggers onValidate() to get descriptions of the dimensions.
When i change them dirctly on the form it's work ok, but when i try to update them from "default dimensions" form onValidate() triggers dose not
work and descriptions stay empty. Maybe somebody knows how can i solve this problem.
pre Thanx.

0
Comments
-
Hi,
How do you update the values in "default dimensions"?
Do you use the VALIDATE function?0 -
I use the function in the form "Default Dimension 352"
UpdateGlobalDimCode(GlobalDimCodeNo : Integer;"Table ID" :
Integer;"No." : Code[20];NewDimValue :
Code [20])
I've added a block:
//
DATABASE::"Road Vehicle": BEGIN
IF RoadVehicle.GET("No.") THEN BEGIN
CASE GlobalDimCodeNo OF
1:RoadVehicle."Global Dimension 1 Code" := NewDimValue;
2:RoadVehicle."Global Dimension 2 Code" := NewDimValue;
END;
RoadVehicle.MODIFY(TRUE);
END;
END;
//
first i try to do in such way
...
..
1:RoadVehicle.VALIDATE("Global Dimension 1 Code",
NewDimValue);
2:RoadVehicle.VALIDATE("Global Dimension 2 Code",
NewDimValue);
....
..
..
but my SQL server speak that , somebody change my dimension when i
start activity ! bla bla bla bla bla bla
now i do not know what to do...0 -
Could you please post the code of the OnValidate function of one of your global dim fields in the roadvech... table?0
-
//
RoadVeh table
Global Dimension 1 Code - OnValidate()
ValidateShortcutDimCode(1,"Global Dimension 1 Code");
ClM.GetDimDesription(1,"Global Dimension 1 Code",Dim1Caption);
MODIFY;
CLM - that is Code unit where i get dim name , but there only reading
tables , no any modification at all.
//
ValidateShortcutDimCode(FieldNumber : Integer;VAR ShortcutDimCode :
Code[20])
DimMgt.ValidateDimValueCode(FieldNumber,ShortcutDimCode);
DimMgt.SaveDefaultDim(DATABASE::"Road
Vehicle","No.",FieldNumber,ShortcutDimCode);
DimMgt -> that is "Dimension Management CU 408
//
and there is a error message , when i try to change dimension in "Default Dimension form"
But I don't now how you can get it , because I first time on this forum.
May be i can send you an e-male ?
And sorry for wrong name in subject of first reply, I had friend called Athens and i've typed it automaticly.0 -
You should delete the modify call from one of the functions, the error you get from sql is that you try to modify a rec two times...
I suggest you delete the MODIFY from the OnValidate routine and call the Validate from the default dimension...0 -
Sorry Arhontis, but i've made just like you suggest and i still have
the same error.
I sand it to you.0 -
What have you in OnModify trigger on your table ""RoadVehicle"?
Don't you call the function ValidateShortcutDimCode?0 -
Maybe you haven't closed and open the form so that it would load the new version of the object??
Just in case, close the app and reopen it...
If that doesn't work then look and replicate the code that is in the:UpdateGlobalDimCode(GlobalDimCodeNo : Integer;"Table ID" : Integer;"No." : Code[20];NewDimValue : Code[20])
0 -
Hi Kine !
I have nothing in the OnModify(), it is empty.
I think that trouble is when server attempt to execute code in Dimension
Management CU.
But i can't find it due to debugger.0 -
What is debugger doing? Where stop? Why you are not able to catch the point?0
-
I've reconnect to the server , it dosn't work.
Sorry Arhontis, but my english is poor , what do you mean
"replicate code" ?0 -
I'm just a beginner in Navision Developing.
It very strange it work on my local DB , but didn't work on the server,
now i try to get a developing license to work on the server directly.
It let me debug the problem.0 -
It is normal: On Native DB (local DB) is it working and on MS SQL server you have error "Another user changed etc." - it is because different locking type (optimistic vs. recordlocking)0
-
Now i will know , thanx Kine0
-
Guys , you can congradulate me. I found a problem.
But anyway i should say big thanx to you all for helping me.
first i could not to debug my code on the server.
Now i'v got a license to do it.
The problem was:
function wich read Dimension Names from a table should not be executed
while SQL make changes in default dimension table. That is whay i could not find a problem a long time. I thought that it only read table with dimension , but i forgot that at the same time SQL try to save it. And
the reason is
SQL DETECTS A DEADLOCK !
I decide do not make reading dim. names in function Global dim Code OnValidate() in my table RoadVeh and
made it in table Default Dimension before it save .
Greetings from Latvia0
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