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 :
Service | Customer Service, Contact Center, Fie...
Suggested answer

PCF-reports general questions regarding development and problem updating solution

(0) ShareShare
ReportReport
Posted on by 115

I installed the reporting solution in the field service app according to the instructions, then downloaded the example project, modified it and uploaded it as an additional solution with a modified component name.
Then I assigned this custom solution to the report form and published it. I can see my custom report.
What is the procedure for making further changes to the component? It doesn't seem possible to include the WebAPI data locally, so "npm run start" isn't really helpful for pcf-reports. What would be the best way to store static JSON objects locally instead of API responses in order to be able to adjust the layout with data at least locally.

So which variable (process.env does not seem to be available there) may i check to determine if i am running in dev/local context so i could do something like this?

    public getBookingData = async (): Promise => {
        let booking;
        
        if(SOME_VAR_I_DONT_KNOW){
            const data = MY_TEST_JSON_BOOKING_OBJECT;
        }else{
            const data = await this.context.webAPI.retrieveRecord(
                "bookableresourcebooking",
                this.bookingID,
                "?$expand=Resource($select=name)"
            )
    
            if (data) {
                booking = {
                    name: data.name,
                    starttime: data.starttime,
                    endtime: data.endtime,
                    duration: data.duration,
                    resourcename: data?.Resource?.name,
                    formattedStarttime: data['starttime@OData.Community.Display.V1.FormattedValue'],
                    formattedEndtime: data['endtime@OData.Community.Display.V1.FormattedValue']
                };
            }
        }
        return booking;
    }

Another problem i am facing is that after my initial upload of that custom solution i cannot update it anymore. I changed the name of the component in

  • ControlManifest
  • index.ts
  • css/viewer.css
  • ControlManifestInput (this one was not mentioned in readme)

as mentioned in the readme of example project. After that i build the component with npm run build and created the solution by executing msbuild /t:build /restore

The solution is created again and i can upload it to the crm without any errors but the component wont reflect my changes. I tried to delete it from the form, reassing it, publish everything and so on but it seems to ignore my new uploaded files. I even tried to change the version of the uploaded solution in solution.xml (of the solution) and in ControlManifest.xml (of the component) before uploading/building.

What should be the optimal order here?

And finally i am wondering how to generate the PDF in desktop crm? In the mobile app there seem to be an extra button but on desktop it is only possible to use "save to timeline"? By the way i am getting an error like "cannot save due to no dirty changes" if i do that and nothing is created atm (but saw it working before).

Image-15.png

I have the same question (0)
  • AndreasB83 Profile Picture
    115 on at
    RE: PCF-reports general questions regarding development and problem updating solution

    It seems that manually updating the component version in the ControlManifest.Input.xml file will force to update the pcf component.

  • Suggested answer
    Thomas David Dayman Profile Picture
    11,323 on at
    RE: PCF-reports general questions regarding development and problem updating solution

    You will need to update the ControlManifest version number and also the solution version number the control is in.

    As for the dirty changes. Make sure that there is no Business rules or JavaScript on the booking form causing the booking to be unsaved.

  • AndreasB83 Profile Picture
    115 on at
    RE: PCF-reports general questions regarding development and problem updating solution

    Thx for your input - figured that out meanwhile but still wondering how to efficiently develop a pcf report with data. I cannot pull it from the api locally so i would have to put some static data in there for developing, simulating the api responses. Any best practice for that?

    To update the componente in crm after each modification seems odd

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
MVP-Daniyal Khaleel Profile Picture

MVP-Daniyal Khaleel 60

#2
Tom_Gioielli Profile Picture

Tom_Gioielli 17 Super User 2025 Season 2

#3
CU29080825-0 Profile Picture

CU29080825-0 16

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans