Thursday, October 10, 2013

Function: @Return

@Return is one of the very useful function that is introduced in 11x. I have been using it more frequently now and some of the cases are listed below:
Syntax:

@RETURN ("ErrorMessage", ERROR)

1. In custom Workforce planning when business need to add TBH (To be Hired) with basic information such as Start Date, Grade, salary. While adding, system need to validate that date and salary is provided and this is where @return comes handy. If validation fails, one can use @Return function with appropriate message.

2. In one of the requirements, there was a need to archive existing projects to dummy members (user selected) and if required restore back to existing available project member. system must not allow user to move project to a member that already has data. So, it was necessary to give appropriate message to the user. I used the following command in case the validation fails:


@RETURN(@CONCATENATE
(
@CONCATENATE
(
            @CONCATENATE("ERROR: Failed to archive selected project [", @NAME({Project})),
@CONCATENATE("] under Entity [", @NAME(@CURRMBR("Entity")))
)
,
@CONCATENATE
(
@CONCATENATE("]. The target project [", @NAME({Archive_Project_to})),
"] is already in use. Try using another new / archived project."
)
)
, ERROR);

The message looks as follows:

"ERROR: Failed to archive selected project [Project1] under Entity [Entity1]. The target project [Temp_Proj1] is already in use. Try using another new / archived project."

Thursday, October 3, 2013

Using Custom Defined Function @HspConcat() and @HspNumToString()

Many times we use smart-list for mapping purposes. We store ids that directly or indirectly match with member names so that we can perform calculations. I had similar requirement and wanted to get the smart list value for example (1001) to concatenate with “ENT” (to get ENT1001) and perform calculation. So, I was looking for a function that will convert numeric to String and then which concatenate. I achieved by using @HspConcat() and @HspNumToString() functions as follows:

@MEMBER(@HspConcat(@LIST("ENT",@HspNumToString(<Account Member>))))

Composite rule v/s ruleset

Recently, I was working extensively on developing business rules in calculation manager. Wherever necessary I have an habit of using variables. In one instance, I wanted to run 2 rules on a save of a web-form. So what I did was created a new rule and added the required 2 rules. I was not expecting any issues as both these rule were running as expected. But when I compiled, it threw an error of duplicate declaration of variable....I used / defined same variables in both the forms.


I was initially surprised but later realized that it considers it as one rule and so the problem.

I then created a rule-set, added the required rules and worked.

Web-form: Substitution variable error

One of my colleagues was trying to use a substitution variable in a web-form and he got the following error message:

“A substitution variable required for this calculation is undefined. Variable: Years_Act

He defined new substitution variable in planning and assigned the value as “FY10:FY13”.

There is nothing wrong here as this can easily be used in calculation script or business rules but when using this in Web-form, we can only have single valid value not range as shown above.

So, few points to note when using substitution variable in web-form are as follows:

1. Make sure you define substitution variable.
2. Make sure value is not blank
3. Make sure you have assigned a valid member name (value) (not range)

Calculation Manager: Lexical Error. Encountered

In calculation manager, I was specifying the member name in “Member Range” manually and for one member I incorrectly included in a single quote instead of double quote. On validating I got an error with the message that includes:

Lexical Error. Encountered: <EOF> after: “”



Hyperion Planning - Default View

In Planning Version 11.1.2.2.300 onward one can set default views. This is basically the view that a user will see upon login.

This can be set by

1. going to Administration->Application->Properties
2. under the Property Name assign "HOME_PAGE"
3. Property Value can be any one of the following:
    "Forms", "Approvals" or "TaskList"
4. Restart the planning web application server

Note: At many places it is mentioned to use "Task List" but that doesn't work; its "TaskList".