Skip to Content
0

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

Dec 12, 2017 at 11:34 AM

74

avatar image

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,

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Senthil Murugan Dec 13, 2017 at 05:07 AM
0

Hi Motaz,

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

Regards,

Senthil

Show 3 Share
10 |10000 characters needed characters left characters exceeded

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,

0

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

0

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.

0