Skip to main content

Hi,

 

Was trying out the default value from page designs. Rebate Type is a text field. According to the documentation functions are supported. So my idea was to automatically generate a key. by concatenating the RB_ with the number of records (2) + 1. Expectation would be that RB_3 is generated. But it's just giving back the text. 

 

As the documentation mentions https://docs.ifs.com/techdocs/24r2/040_tailoring/225_configuration/200_client_configurations/330_conditional_default_values/#attributes_of_default_value_case_items “The expression that determines the field's value. This value can either be a hard-coded value, a reference to another field, a CSV value or an expression that returns a value compatible with the field's data type. For details about the expression syntax, see Condition Syntax.”

i also tried just using the function; count(<"*"]). Expecting a 2. But also just the text ‘count(n"*"])’ is shown. Also #TODAY# gives back the text ‘#TODAY#’ instead of the date. 
 

Am i doing something wrong? Or is this not supported?

@MiLeNL the syntax for text fields is slightly different - see https://docs.ifs.com/techdocs/24r2/040_tailoring/225_configuration/200_client_configurations/330_conditional_default_values/#text

Anything you enter is treated as a literal, which is why you see what you type coming back. If you want to have a literal string and a function, the right syntax is something like: RB_${count(RebateType)}

However, this too will not work in your case because the “context” of the expression is the current row that you’re creating, so you cannot do a count on a row, and what you’re seeking to do is not directly supported.

Perhaps you can try creating a Custom Field that is calculated via a PL\SQL block to have the next sequence value (assume it’s called CF_RebateTypeCount), then you might be able to do something like RB_${CF_RebateTypeCount}.

I haven’t tried it myself though, so not 100% sure if it will work.

Best regards,

Rukmal


@MiLeNL the syntax for text fields is slightly different - see https://docs.ifs.com/techdocs/24r2/040_tailoring/225_configuration/200_client_configurations/330_conditional_default_values/#text

Anything you enter is treated as a literal, which is why you see what you type coming back. If you want to have a literal string and a function, the right syntax is something like: RB_${count(RebateType)}

However, this too will not work in your case because the “context” of the expression is the current row that you’re creating, so you cannot do a count on a row, and what you’re seeking to do is not directly supported.

Perhaps you can try creating a Custom Field that is calculated via a PL\SQL block to have the next sequence value (assume it’s called CF_RebateTypeCount), then you might be able to do something like RB_${CF_RebateTypeCount}.

I haven’t tried it myself though, so not 100% sure if it will work.

Best regards,

Rukmal

Hi Rukmal,

 

Thanks for the quick reply. It's a shame it's not working as i intended to do it. But makes sense as well. Was hoping to make it work without a Custom Attribute. However your suggestion did work 🙂.

 

Created a Custom Attribute which selects the nextval of a sequence. Calling that in the RebateType Default Value will generate the value.

 

It also helps to provide the right syntax, thanks for that as well!

 

Regards,

Mitchel


@MiLeNL great to hear and thanks for sharing the solution!

Best regards,

Rukmal


@Rukmal Fernando good to see that is possible in 24R2.

 

@MiLeNL in previous versions of cloud we accomplished this with a workflow


@Rukmal Fernando good to see that is possible in 24R2.

 

@MiLeNL in previous versions of cloud we accomplished this with a workflow

As far as i'm aware workflow never had the capability to set default values for values which are not updateable . Hence it never worked for setting up default key values. Reference topic;  https://community.ifs.com/framework%2Dexperience%2Dinfrastructure%2Dcloud%2Dintegration%2Ddev%2Dtools%2D50/pre%2Dfilling%2Dof%2Dvalues%2Dwith%2Dbpa%2D36748 

Or was this solved in later versions?

 

With the page designer it now is possible.


@Rukmal Fernando you’re correct, I missed that detail. Thanks for the clarification!


@PhillBronson it was ​@MiLeNL who made that last clarification 😉


Reply