cancel
Showing results for 
Search instead for 
Did you mean: 

Using elementsof Custom BO in standard business object makes elements read-only

former_member535186
Participant
0 Kudos

Hi experts,

am creating instances of Custom BO, from standard business object beforesave event,

var Root :  elementsof CustomLG ;

Root.InternalID = "1" ;
  Root.LgStatus = "Requested"  ;
  Root.LgAmountData.content = this.LgAmount.content ;
  Root.LgAmountData.currencyCode = this.LgAmount.currencyCode ;

while the standard BO definition is

[DeploymentUnit(Financials)]  businessobject CustomLG raises MsgRequest 

on assigning elements to Root

Errorex : Identifier InternalID is read-only and cannot be changed.

Regards,

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Motaz,

Is your Custom BO(CustomLG) has the same deployment unit(Financials) as the standard one?

Regards,

Senthil

former_member535186
Participant
0 Kudos

Hello Senthil,

No the Standard BO'S is Opportunity, Sales Order

While trying to add Instances to Custom BO from "Opportunity-BeforeSave Event", it was working fine before adding the Notation [DeploymentUnit], but regarding the requirements i had to create journal entry voucher based on data in the created instance though action in the standard Bo.

Regards,

Former Member
0 Kudos

Hello Motaz,

Since Opportunity and Journal Entry are in different deployment units, write access would be disabled.

Perhaps, PID (Internal Communication) can be used as below,

Opportunity --> CustomBO --> PID --> DummyBO(Deployment unit of Journal Entry & logic to create journal entry) --> Journal Entry

Regards,

Senthil

former_member535186
Participant
0 Kudos

Dear Senthil,

Thank you, your solution is perfect, could you please send me FI posting ABSL code Sample, since i can't not add entries to AccountingEntry Bo using that code,

var header :elementsof AccountingEntry;
  header.CompanyID = "AREEGY" ;
  header.AccountingDocumentTypeCode = "00047" ;
  header.BusinessTransactionTypeCode = "601" ;
  header.TransactionCurrencyCode = "EGP" ;
  header.AccountingClosingStepCode = "010" ;
  var newJV = AccountingEntry.Create(header);

  // Create Debit
  var newJVGL : elementsof AccountingEntry.Item ;
  newJVGL.DebitCreditCode = "1";
  newJVGL.ChartOfAccountsItemCode.content = "100001000";
  newJVGL.TransactionCurrencyAmount.content = 500;
  newJVGL.TransactionCurrencyAmount.currencyCode = "EGP" ;
  newJV.Item.Create(newJVGL);

  // Create Credit
  var newJVGL1 :  elementsof AccountingEntry.Item;
  newJVGL1.DebitCreditCode = "2";       
  newJVGL1.ChartOfAccountsItemCode.content = "105100000";
  newJVGL1.TransactionCurrencyAmount.content = -500;
  newJVGL1.TransactionCurrencyAmount.currencyCode = "EGP";
  newJV.Item.Create(newJVGL1);

Regards,

Thank you.