I don't see any let function TO run. ??
The use of self indicates that this is an auto-entered calculation.
When an auto-entered calculation references fields in another table or record, it will not automatically update when you modify the value in the referenced field.
The "Self" only works when FD::Set_By_Size = "Yes" rarely used!
The LET calculation field in the same table as the CASE calculation fields
Case( Get ( RecordNumber ) = 1;
$W =( M_Width);
$H =( M_Height);
$Mo = MBS("GMImage.New";$W & "x" & $H ;MFD::Swatch);
$Result = MBS("GMImage.WriteToPNGContainer"; $Mo);
$DestroyResult = MBS("GMImage.Destroy";$Mo)
Is there no way this will work?
Now that I can see the Calculation we can take a look at why it does not work as expected. Is this an auto-entered calculation or the expression for a field of type calculation?
Your calculation references numerous local variables. They aren't global as they don't have two $$ at the beginning. I doubt that your calculation can work correctly as I don't think any of these variables will have a value at the time the calculation evaluates.
Im not sure I understand!
The variables are created in the LET calculation.
The calculation itself works ok. it just doesnt fire when I modify (M_Width) (M_Height) which are from related table
As far as global variables are concerned I am trying to understand how they work.
If for example I set $$ =( M_Width) in this calculation will it then modify with field data changes?
Sorry, my mistake on the variables, but since none of the values set are for a global
fieldvariable, how do you know that it didn't since there is no visible change to see from it?
$$W = M_Width;
would assign the value of M_Width to the global variable $$W each time the Let function evaluates.
Is this a an auto-entered calculation or a calculation field?
PS. I'm not a big fan of using Let to assign values to a variable. It's a form of "side effect" programming that tends to hide where/when a variable got an assigned value. I much prefer to use a script in most cases.
Its a calculation field
Fixed a typo in my previous post.
Some developers put such an expression inside a conditional format expression on a layout in order to assign variable values.