Skip to Content
avatar image
Former Member

Extension Field Name

Hi All,

I am not able to fetch the name of an Extension Field which is in Company object. I am able to get the value with below code.

compRef = doc.getCompanyRef();

compHome = IBeanHomeLocator.lookup(session, compRef);

comp = compHome.find(compRef);

PriceIfc smallValuePrice=comp.getExtensionField("EXT_SMALL_VALUE").get();

but I need to get the name of the Extension Field. Can you please help me to get it.

Thanks,

Naresh.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Apr 13, 2016 at 03:21 PM

    Hi Bogdan,

    Thanks for the reply.

    There are three extension fields in company object. I need to give an error message as chain exception saying that "XXX, YYY, ZZZ fields are empty" if they are empty. For that I need to fetch field name and use it in displaying my error message.

    Thanks,

    Naresh.

    Add comment
    10|10000 characters needed characters exceeded

    • Unfortunately you'll not be able to do that.

      Only alternative is to show an exception message next to each field and a generic message at the header-level (this last part is done automatically btw):

      ae = new ApplicationException(session);

      ae.chainAtEnd(doc.createApplicationException("FIELD_1" ...

      ae.chainAtEnd(doc.createApplicationException("FIELD_2" ...

      ae.chainAtEnd(doc.createApplicationException("FIELD_3" ...

      if (ae.getChain() != null)

      throw ae.getChain();

  • Apr 13, 2016 at 02:51 PM

    Hi Naresh,

    Can you detail why you need to fetch the name of the extension field?

    Technically, you will not be able to fetch it, because the name is only bound to the UI, not the backend.

    Additionally, the name itself is not defined system-wide. You could change it via PageCustomization and make it different for every document, so even fetching from ExtensionDefinition will not be a valid approach.


    Bogdan

    Add comment
    10|10000 characters needed characters exceeded