Skip to main content
1-Visitor
December 24, 2014
Question

How to create an Object soft-type via API (Static Factory Method)

  • December 24, 2014
  • 2 replies
  • 1597 views

Hi All,


I have some code that creates an Change Requestvia static factory method in a Workflow Expression Robot. I am trying to adapt to create a soft-type of Change Request. I thought that disbaling OIR's for the parent type (or setting the instantiable checkbox in the type and attribute manager would do the trick, butno luck. Any ideas?

2 replies

1-Visitor
December 24, 2014
You have to set the type identifier via API before persisting it. Easier to
just look at LWCNormalizedObject then doing with code from the older days
unless you are still on 9.1. I can share if you need.

On Wed, Dec 24, 2014 at 1:03 PM, Keir Pritchard <->
wrote:

> Hi All,
>
> I have some code that creates an Change Request via static factory method
> in a Workflow Expression Robot. I am trying to adapt to create a soft-type
> of Change Request. I thought that disbaling OIR's for the parent type (or
> setting the instantiable checkbox in the type and attribute manager would
> do the trick, but no luck. Any ideas?
>
10-Marble
December 26, 2014

Hi, you can use the "unsupported" method I used to create a subtype of WTChangeActivity2 (see attached snipped code)


See statement


((Typed)ca).setTypeDefinitionReference(TypedUtilityServiceHelper.service.getTypeDefinitionReference(targetType));


where targetType is defined as String.


I am sure it should work for ChangeRequest.


Regards,


Vittorio