Hello everyone,
I'm really enjoying using UDFs and UDTs, especially now that it's possible to place behavior functions in the formula bar. However, I'm encountering an error:
I have the following record:
{
Last: {Year: "xx", Quarter: "xx"},
This: {Year: "xx", Quarter: "xx"},
First: {Year: "xx", Quarter: "xx"},
Second: {Year: "xx", Quarter: "xx"},
Third: {Year: "xx", Quarter: "xx"}
}
tpQuarter := Type(
{
Year: Text,
Quarter: Text
}
);
tpNextQuarters := Type(
{
Last: tpQuarter,
This: tpQuarter,
First: tpQuarter,
Second: tpQuarter,
Third: tpQuarter
}
);
The tpQuarter
declaration doesn't return an error, but tpNextQuarters
does:
So, I moved the logic that was previously in an enhanced component property of type "Action" to the formula bar:
udfGetNextQuarters(ParamCurrentYear:Text, ParamCurrentQuarter:Text):Void =
{
// Calculate the next four quarters based on the parameters ParamCurrentYear and ParamCurrentQuarter
With(
{
SelectedYear: ParamCurrentYear,
SelectedQuarter: ParamCurrentQuarter
},
Set(voNextPeriod,
{
Last: {
Year: "xx",
Quarter: "xx"
},
This: {
Year: "xx",
Quarter: "xx"
},
First: {
Year: "xx",
Quarter: "xx"
},
Second: {
Year: "xx",
Quarter: "xx"
},
Third: {
Year: "xx",
Quarter: "xx"
},
Fourth: {
Year: "xx",
Quarter: "xx"
}
}
)
)
}
;
However, I still get the same error:
In other words, I can't add multiple properties to a record. I know that a temporary solution would be to create a table like this:
tpQuarter := Type(
{
Name: Text,
Year: Text,
Quarter: Text
}
);
tpNextQuarters := Type(
[tpQuarter]
);
Stay up to date on forum activity by subscribing.