Skip to Content

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

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,

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Dec 13, 2017 at 05:07 AM

    Hi Motaz,

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

    Regards,

    Senthil

    Add comment
    10|10000 characters needed characters exceeded

    • 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.