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.
Comments
How do you update the values in "default dimensions"?
Do you use the VALIDATE function?
Arhontis
https://forum.mibuso.com/search
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...
Arhontis
https://forum.mibuso.com/search
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.
I suggest you delete the MODIFY from the OnValidate routine and call the Validate from the default dimension...
Arhontis
https://forum.mibuso.com/search
the same error.
I sand it to you.
Don't you call the function ValidateShortcutDimCode?
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Just in case, close the app and reopen it...
If that doesn't work then look and replicate the code that is in the:
Arhontis
https://forum.mibuso.com/search
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.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Sorry Arhontis, but my english is poor , what do you mean
"replicate code" ?
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.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
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 Latvia