Monday, April 4, 2016

Error executing code: The field with ID '0' does not exist in table 'SysExtensionSerializerExtensionMap'.

If you ever get "Error executing code: The field with ID '0' does not exist in table 'SysExtensionSerializerExtensionMap'." error in CIL, it may happen it is the table extension framework + the standard buf2buf function to blame.


Somehow, if you pass a Map instead of a table to buf2buf function, the following line fails:

_to.(fieldId) = _from.(fieldId);


However, if you replace this line with:


fieldName = fieldId2name(_from.TableId, fieldId);
 _to.setFieldValue(fieldName, _from.getFieldValue(fieldName));


everything is fine both in X++ and in CIL.


P.S. I didn't dare to change the standard buf2buf method. Istead, I created another method and used it in the table extension framework logic, which failed because of the issue (\Data Dictionary\Maps\SysExtensionSerializerMap\Methods\copyExtensionTableData)


P.P.S. There are a couple of other SysExtensionSerializerMap methods that should be fixed, as they call buf2buf too.


3 comments:

  1. hi
    i have this error and i don't know how to solve it any help

    ReplyDelete
  2. Hi Atef
    Could you tell me the method name and line number, where the exception is thrown. Also, which AX version do you use?

    ReplyDelete
  3. Hello Blog Administrator,
    I just want to leave this message here on your blog to let anyone know about a financial support Mr Pedro offers me during the time of covid-19 because that time was really a bad and hard time for me after country lockdown I almost lost my business before Pedro Jerome a loan officer who helped me with a loan at the rate of 2% in return to finance my business I'm so grateful and showing gratitude to his support will testify how grateful I'm to his service and his working team as well after visiting their office at my location then I knew he was a good man with a grate heart.
    I would like anyone here going through financial conditions to contact Mr Pedro Jerome on his E-mail pedroloanss@gmaill.com whatsapp text +1-863-231-0632. and he will help you with any type of loans,Home loan,car loan,construction loan,business loans,personal loan, as long as you are honest enough to make a return.

    ReplyDelete