cancel
Showing results for 
Search instead for 
Did you mean: 

Use of Duration - Custom BO - Action

former_member232970
Participant
0 Kudos

Hi All,

I'm facing an issue which is not clear at all to me.

I was wondering whether someone could explained it to me.

I created a custom BO and defined an action.

On this action, I want to create a Duration however I get the following error message when I call "Create" method (Same for method "ParseFromSting"):

Error4Static reuse services cannot be called instance-based.

==> Btw: this code works fine on an event of a standard BO (E.g: BeforeSave).

Here is my coding:

thanks in advance.

kind regards,

Andres

Accepted Solutions (1)

Accepted Solutions (1)

former_member200567
Active Contributor
0 Kudos

Hi Andres,

Please use ABSL namespace instead of AP.Common.GDT.

import ABSL as absl;

var duration= abls:Duration.Create(0,0,0,0,20,0);

Best Regards,

Fred

former_member232970
Participant
0 Kudos

Hi Fred,

Small question: Is that the same as doing the following:

duration = Library::Duration.Create(0, 0, 0, 0, 120, 0); // 120 Minutes

kind regards,

Andres

former_member200567
Active Contributor
0 Kudos

Hi Andres,

Library is an object type.

It seems namespace ABSL is automatically selected when Library is declared as object type.

My guess is they are the same.

Best Regards,

Fred

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Fred, et al.,

The very first statement is

import ABSL;

What do you think is it used for?

As long as you do not define explicit another usage (like Library) the namespace is taken.

So:

ABSL::      means a data type from the ABSL namespace

Library::    means a function

The "::" are important.

HTH,

  Horst

Answers (0)