cancel
Showing results for 
Search instead for 
Did you mean: 

How to use CreateWithReference

former_member200567
Active Contributor
0 Kudos

Hi, experts,

   

      1. Can somebody please explain what is the usage of CreateWithReference in studio and how to use it? I still can't figure out how to use it.

    

      2. Does the target BO need to have a CreateWithReference BO Action to be able to use CreateWithRef feature?

      3.  In the repository explorer, I find some standarad BOs have CreateWithReference BO Action (e.g CustomerInvoice).

    

And I can see it in UI designer.

       

But some do not have CreateWithReference action (e.g InboundDelivery) .

           

But the UIs (QAF, OIF) have a CreateWithRef inport.

.

            

The inport fires an event handler that calls a BO Action ( I can't find which BO Action they call because it is not allowed)  with some action parameters.

             

          So, number 3  question, how can I use CreateWithRef for Inbound Delievery.

Thanks in advance.

Regards,

Fred

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Fred,

I can give you an example for my use case.

In this sample I used the createwithreference to create an email activity related to the activity task (you can see the generate email in the "related items" of the task



var act = Activity.Retrieve(ABSL:UUID.ParseFromString(this.actID));
var instEmail = Activity.CreateWithReference(act, "39");


instEmail.SubjectName = "Sample req n° " + act.ID.RemoveLeadingZeros() + " " + this.account;
[this.name filling]
elEmailParty.PartyName = this.name;
instEmail.MessageToParty.Create(elEmailParty);

[this.binaryObject filling]
//Create body
var elEmailTxtCollTxt : elementsof Activity.TextCollection.Text;

var instEmailTxtColl = instEmail.TextCollection.Create();
elEmailTxtCollTxt.TypeCode.content = "10002";
var instEmailTxtCollTxt = instEmailTxtColl.Text.Create(elEmailTxtCollTxt);
var elEmailTxtCollTxtCntnt.Text.content = this.binaryObject.ToString();
instEmailTxtCollTxt.TextContent.Create(elEmailTxtCollTxtCntnt);

instEmail.Send();

former_member200567
Active Contributor
0 Kudos

Hi, Alessandro.

           Thanks. Get the idea now.

           But what if the standard BO  does not have a CreateWithRef as I mentioned in No.3?

Regards,

Fred.

Former Member
0 Kudos

I think in this case there are two cases:

1) create with reference is not supported

2) you need to ask for a PSM release because the method exist but is not visible in the PDI

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello,

The Inbound Delivery BO does have a not-released CreateWithReference action.

HTH,

  Horst

Answers (0)