apps-infra

    Forum Stats

  • 3,873,872 Users
  • 2,266,625 Discussions
  • 7,911,648 Comments

Discussions

OnDemand Rule

JanGLi
JanGLi Member Posts: 650 Bronze Badge
edited Sep 28, 2017 11:58AM in Financial Consolidation

Hi,

We have created two simple calculate rules

Rule1

Sub OnDemand_test123(bLog)

  'ID:442

  'PROPERTIES:logging=false;timer=false;disabled=false;CalcType=Calculate

  'STARTCOMPONENT:FORMULA

  'ID:-317

  'NAME:Template-1-317

  'PROPERTIES:logging=false;timer=false;disabled=false;CalcType=Calculate

  '

  If 1 = 1 Then 'NEWBLOCKCOND

  HS.Exp "A#10101002.I#[ICP None].Material#[None].Future1#[None].Region#[None].Funct_Area#Opening Balance = 90000"

  End If

  'ENDCOMPONENT

End Sub

Rule2

Sub OnDemand_testing(bLog)

  'ID:444

  'PROPERTIES:logging=false;timer=false;disabled=false;CalcType=Calculate

  'STARTCOMPONENT:FORMULA

  'ID:-314

  'NAME:Template-1-314

  'PROPERTIES:logging=false;timer=false;disabled=false;CalcType=Calculate

  '

  If 1 = 1 Then 'NEWBLOCKCOND

  HS.Exp "A#10101001.I#[ICP None].Material#[None].Future1#[None].Region#[None].Funct_Area#Opening Balance = 8000"

  End If

  'ENDCOMPONENT

End Sub

Which i am able to calculate if i use calculate/force calculate option

Rule Calculated

pastedImage_0.png


But when i use ondemand option i am getting error.

Executing OnDemand rule

pastedImage_7.png

Error

pastedImage_10.png

Kindly guide what to do? or am i using it wrong?

Regards

i,

We have created simple calculate rule which i am able to excecute when i use calculation option on web from. But when i do the same for on_demand rule... it is getting errored out.
Kindly find the attached word document stating the issue in detail with screen shots.

Regards

Best Answer

  • CBarbieri
    CBarbieri Member Posts: 1,011 Gold Trophy
    edited Sep 18, 2017 9:11AM Answer ✓

    I assume these rules come from Calc Manager, and that you have displayed the script to make the posting here easier for everyone to read. If my guess is correct, the issue lies with Calc Manager, not your rules. Notice that each time we create a new rule object in calc manager, a variable 'blog' is attached to the subroutine. This is used by Calc Manager to enable or disable logging. The issue however, is that On Demand rules can't accept a parameter since they need to run independently. Sub On Demand works just fine with classic script rules, but because of Calc Manager's design to automatically insert the variable, OnDemand rules can't run for applications using calc manager.

    My advice to you is to find a way to simply use Sub Calculate instead and give up on using OnDemand for this application. When I explained this issue to Oracle last year I was under the impression that they knew about it, but did not have a fix forthcoming.

    If anyone on this forum has found a clever workaround for OnDemand with Calc Manager, I'm eager to learn.

    - Chris

Answers

  • CBarbieri
    CBarbieri Member Posts: 1,011 Gold Trophy
    edited Sep 18, 2017 9:11AM Answer ✓

    I assume these rules come from Calc Manager, and that you have displayed the script to make the posting here easier for everyone to read. If my guess is correct, the issue lies with Calc Manager, not your rules. Notice that each time we create a new rule object in calc manager, a variable 'blog' is attached to the subroutine. This is used by Calc Manager to enable or disable logging. The issue however, is that On Demand rules can't accept a parameter since they need to run independently. Sub On Demand works just fine with classic script rules, but because of Calc Manager's design to automatically insert the variable, OnDemand rules can't run for applications using calc manager.

    My advice to you is to find a way to simply use Sub Calculate instead and give up on using OnDemand for this application. When I explained this issue to Oracle last year I was under the impression that they knew about it, but did not have a fix forthcoming.

    If anyone on this forum has found a clever workaround for OnDemand with Calc Manager, I'm eager to learn.

    - Chris

  • JanGLi
    JanGLi Member Posts: 650 Bronze Badge
    edited Sep 23, 2017 4:27AM

    Hi,

    Sorry for late reply. Yes i have created these rules in calc mgr. Can't i just remove the 'blog' from the script that calc mgr creates? (i did tried it though calc manager puts it back)

    "Sub On Demand works just fine with classic script rules" by this i am guessing that we can create VB scripts without the help of calc mgr and execute them?

    Is it possible?

    Regards

  • ericerikson
    ericerikson Member Posts: 608 Bronze Trophy
    edited Sep 23, 2017 6:06AM

    Hi. Yes, you can edit the rules without Calculation Manager with a text editor. This is called “Classic” script. There is an addin for Notepad++ that can help with this, although it is not required. If you do this then you’ll have to do without things like member lookup, function lookup, etc. But there are advantages too. If you look at the sample apps that come with HFM you’ll see some examples.

    I would not try to alternate between CM and Classic. If you make the switch, then stick with Classic.

    Eric

    JanGLi
  • JanGLi
    JanGLi Member Posts: 650 Bronze Badge
    edited Sep 28, 2017 11:58AM

    Thanks for help.

    Since i am using ondemand i will stick to classic vb scripts.

    Regards

This discussion has been closed.
apps-infra