web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Supply chain | Supply Chain Management, Commerce
Suggested answer

Extend Custom Control method with COC

(0) ShareShare
ReportReport
Posted on by 743

Hello everyone,

I am trying to extend Formcontrol method with extension class but it's not working. By the way the control is custom control. And the coc is not hitting this point.

I am attaching code below if anyone have an idea i ll be glad to hear 

I am trying to work with PCRuntimeConfigurator Form object  this have a 

[Control("Custom")
class PCRuntimeControl and this control have a method named  public PCAttributeDetailsContract getAttributeDetails(int64 _recId)

Here is  my extension class header 

[ExtensionOf(formControlStr(PCRuntimeConfigurator,PCRuntimeControl))]
final class PRXPCRuntimeConfigurator_Extension
{

    public PCAttributeDetailsContract getAttributeDetails(int64 _recId)
    {
        EcoResCategoryAttribute  categoryAttribute;
        ImageReference imageReference;
        PCAttributeDetailsContract ret;
        EcoResProductImage ecoResProductImage;
        ret = next getAttributeDetails(_recId);

        categoryAttribute = EcoResCategoryAttribute::find(_recId);


        imageReference = ecoResProductImage::attributeImage(categoryAttribute,EcoResProductImageSize::Thumbnail);
        ret.parmImageType(imageReference.parmImageType());
        ret.parmImageData(imageReference.parmImageData());

        return ret;

    }

}

The code not hitting this extension class, when i was trying other formcontrol's  i am not facing this problem. I did not find any other method which i can extend it. 

  • Suggested answer
    Muratvzr Profile Picture
    743 on at
    RE: Extend Custom Control method with COC

    Dear All,

    I spent so many hours and I finally found solution about this. some how you can not apply coc extension on a custom control, so you have to duplicate resource on web page and javascript and add your new method to this items and, then you have to extend your Formcontrol base class and add your custom logic over there. 

    I hope this will be helpfull to anybody if anyone has a further question about this case can be contact me

  • WillWU Profile Picture
    22,342 on at
    RE: Extend Custom Control method with COC

    Hi partner,

    When will the getAttributeDetails() method be invoked?

    Please provide more details about it.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 16th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
Jahanvi Profile Picture

Jahanvi 20

#2
Radhika Kundanagurthi Profile Picture

Radhika Kundanagurthi 6

Featured topics

Product updates

Dynamics 365 release plans