Happy Business Starts Here

Highlighted
New Student

ProductSelector Javascript plugin

Hi,

I have been trying to use the ProductSelectorPlugin to make a few changes in the Quote flow process. I am using the zuora for salesforce managed package. I am using the sample code given in the knowledge centre. I tried creating a small alert message(which says 'hello') using the structure of the product selector plugin. But the alert doesn't show up at any stage of the quote flow process(adding products and rateplans, editing rate plan charges etc). What might be going wrong? 

 

P.S. i am using the right version(7.0 and later)

 

https://knowledgecenter.zuora.com/CA_Commerce/I_Development_Resources/C_Component_Library/E_Product_...

2 REPLIES 2
Highlighted
Zuora Alumni

Re: ProductSelector Javascript plugin

Hi.

 

Could you please let us know how did you upload the js file? Did you use PC or Mac?

we have recently identified an issue, when the file is uploaded from PC.

It works fine when uploaded From Mac. We are working with our Engineering team on this.

 

Thank you
Doyeli






If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √

Highlighted
Student

Re: ProductSelector Javascript plugin

There is an issue with managed package javascript loading static resources whose MIME type is not text/javascript.  When you upload your js file as a static resource in Salesforce, the MIME type can vary based on your platform and even browser used during the upload.  I found that the following MIME types will be set for the js file based on the browser type on a Windows platform.

 

Chrome: application/javascript

Firefox: application/x-javascript

IE: application/octect-stream

 

The issue is the MIME type must be text/javascript for your javascript static resource to be loaded by the Zuora managed package javascript.  You have two options to accomplish this:

 

1)  As support suggested, you can upload the static resource into Salesforce using a Mac.

2) You can pull down the metadata and edit the static resource's xml file to set the type.

 

I used the second method since I did not have access to a Mac.  I use MavensMate with Sublime, but you can also use the Force.com IDE.