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).
