Quantcast
Channel: SCN : Popular Discussions - SAP Business ByDesign
Viewing all articles
Browse latest Browse all 2194

Create a Transaction such as Opportunity or Activity associated with custom BO

$
0
0

Hi All,

 

I have created a custom BO.

 

[DeploymentUnit(CustomerRelationshipManagement)] businessobject Sy_Trade {

 

  [AlternativeKey] [Label("Trade Id")] element tradeid : BusinessTransactionDocumentID;

  [Label("Building Name")] element buildingidname : LANGUAGEINDEPENDENT_EXTENDED_Text;

  [Label("Building ID")] element buildingid : BusinessPartnerInternalID;

  [Label("Account")] element account : BusinessPartnerInternalID;

  [Label("Tender ID")] element tenderid :  LANGUAGEINDEPENDENT_EXTENDED_Text;

  [Label("Reference Flag")] element ReferenceFlag : Indicator;

  [Label("Additional Information")] element AdditionalInformation : LANGUAGEINDEPENDENT_EXTENDED_Text;    

 

  node RelatedOpportunities [0,n]{

  element BusinessTransactionDocumentReference : BusinessTransactionDocumentReference;

  element BusinessTransactionDocumentRelationshipRoleCode : BusinessTransactionDocumentRelationshipRoleCode;

     association RelatedOpportunity[0,1] to Opportunity;

  }

}

 

Now As you can see I want to create opportunities against it....

So in action...

1. Creating an Oppportunity

elOpportunity_Root.Name.content = "MainOpporunity";

instOpportunity = Opportunity.Create(elOpportunity_Root);

instOpportunity.ProspectParty.PartyKey.PartyID.content = this.account;

 

2. Creating an Instance of node RelatedOpportunity

 

HeaderOpputInst = this.RelatedOpportunities.Create();

3. Need to assign Opportunity to association Related Opportunity.

 

HeaderOpputInst.RelatedOpportunity= instOpportunity;

I am also paasing the data in Business Transaction Document Refrence and RelationshipRolecode.

 

HeaderOpputInst.BusinessTransactionDocumentReference.ID.content = HeaderOpput_ID;

HeaderOpputInst.BusinessTransactionDocumentReference.TypeCode = "Opportunity";

HeaderOpputInst.BusinessTransactionDocumentReference.UUID = instOpportunity.UUID;

HeaderOpputInst.BusinessTransactionDocumentRelationshipRoleCode = "Successor";

 

Still i am not able to LINK Opportunity to My Custom BO

 

Please help!!

 

Thanks in advanced!


Viewing all articles
Browse latest Browse all 2194

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>