cancel
Showing results for 
Search instead for 
Did you mean: 

Extension Field Name

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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.

former_member190023
Contributor
0 Kudos

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();

Answers (1)

Answers (1)

former_member190023
Contributor
0 Kudos

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