HomeGuidesDeveloper HubRelease Notes
Get supportBook a chat
Guides

Advanced Features

How to change the Default Product object

Proof of Purchase has a functionality called Product Flexibility which enables you to change the Product object used by PRP By default, this Product obect used by Proof of Purchase is the object which comes with Salesforce (API Name: Product2). Here you will see how to use another object - a process which needs to be configured in both IAS and CMS.

For the purposes of explaning how to do this, we'll use an object called ExternalProduct__c (the __c stands for Custom) as an example of the replaced Proof of Purchase Product object.

Custom Settings

Both IAS and CMS use the same Custom Settings to discover which Product Object is being used. To change that, go to Setup and search Custom Settings on the Quick Find.
Click Manage on Public Settings (where Namespace Prefix is FieloPLT).

In the Default Organization Level Value section click Edit (or New if there is nothing defined).

3135

Product Lookup Field

In Product Lookup Field enter the API Name of the field that belongs to Invoice Items (FieloPRP InvoiceItem__c) that points to your custom Product object (in this case, (thec stands for Custom). Once ready, you can hit Save.

IAS

The field being used by the Invoice Item to reference the Product and the fieldsets of the Product Advanced Search are controlled by Page Settings. To get to the Invoice Page Settings, go to the Invoices tab and next to New, click on 🔽, then select Settings.

3145

Invoice Page Settings

Invoice New Page

Under New Settings, click on Invoice> New. A New page is a form which provides the controls for creating a new record - for example, the information needed to create a new Invoice.

In the Sections field, you'll find a JSON file that contains 4 sections:

Information: Controls the fields displayed in the Information section, such as Invoice Number, Date, etc.

"Name":"Information",
	"Rows":[
		[
			{"Name":"FieloPRP__Member__c","Type":"lookup"},
			{"Name":"FieloPRP__HasDetails__c","Type":"checkbox"}
		],
		[
			{"Name":"FieloPRP__InvoiceNumber__c","Type":"input"}
		],
		[
			{"Name":"FieloPRP__Amount__c","Type":"input"},
			{"Name":"FieloPRP__Date__c","Type":"input"}
		],
		[
			{"Name":"FieloPRP__Description__c","Type":"input"}
			,{"Name":"FieloPRP__Distributor__c","Type":"lookup"}
		]
	]

FieloPRP__Product: Controls the fields displayed in the Advanced Product Search section.

"FieloPRP_Product":[
[
{"Name":"Name","Type":"input"},
{"Name":"Family","Type":"picklist"},
{"Name":"ProductCode","Type":"input"}

Which looks like this:

3096

Advanced Product Search Section

FieloPRP__ProductRecent: Controls the fields displayed in the recent records results of the Advanced Product Search.

"FieloPRP_ProductRecent":[
[
{"Name":"Name","Type":"input"},
{"Name":"Family","Type":"picklist"},
{"Name":"ProductCode","Type":"input"}

Which looks like this:

3104

Advanced Product Search: Recent Records

FieloPRP__InvoiceItems: Controls the fields displayed in the Items section of the Invoice.

"FieloPRP_InvoiceItems":[
[
{"Name":"FieloPRP__Quantity__c","Type":"input"
"ClassName":fielosf-product_qty","onchange":
"refreshTotalPriceProxy_"},
{"Name":"FieloPRP__Product__c","Type":"lookup",
"ClassName":fielosf-product_name","onchange":
"refreshTotalPriceProxy_"},
{"Name":"FieloPRP__UnitPrice__c","Type":"input,
"ClassName":"fielosf-product_unit-price",
"onchange":refreshTotalPriceProxy_"},
{"Name":"FieloPRP__TotalPrice__c","Type":"input,
"ClassName":"fielosf-product_total-price",
"onchange":refreshTotalPriceProxy_")

Which looks like this:

3093

Invoice Items

We recommend using an advanced text editor tool to change the JSON. In order to input a new object, simply do the following:

"FieloPRP_Product":[
[
{"Name":"Name","Type":"input"},
{"Name":"Family__c","Type":"picklist"},
{"Name":"Description__c","Type":"input"}

Family__c and Description__c are fields from the new Product object.

"FieloPRP_ProductRecent":[
[
{"Name":"Name","Type":"input"},
{"Name":"Family__c","Type":"picklist"},
{"Name":"Description__c","Type":"input"}
]

Family__c and Description__c are fields from the new Product object.

"FieloPRP_InvoiceItems":[
[
{"Name":"FieloPRP__Quantity__c","Type":"input"
"ClassName":fielosf-product_qty","onchange":
"refreshTotalPriceProxy_"},
{"Name":"External__Product__c","Type":"lookup",
"ClassName":fielosf-product_name","onchange":
"refreshTotalPriceProxy_"},
{"Name":"FieloPRP__UnitPrice__c","Type":"input,
"ClassName":"fielosf-product_unit-price",
"onchange":refreshTotalPriceProxy_"},
{"Name":"FieloPRP__TotalPrice__c","Type":"input,
"ClassName":"fielosf-product_total-price",
"onchange":refreshTotalPriceProxy_")

External__Product__c is the lookup 🔎 field from Invoice Items for the new Product object.

Once you've saved your JSON file, go to the Libraries tab and click FieloPRP. Choose Invoice> New and Invoice> Edit from Page Settings.
Paste the content of the new JSON into the Sections field:

627

Pasting the new JSON

Save the changes in both Page Settings Types.

Invoice Landing Page

On the Invoices Landing Page, it is necessary to change the Products link (Tools > Products).
In Invoice > Landing page, go to Tools.

1920

Landing Page Settings, Tools

Change the Action URL string to the one corresponding to the new External Product list.

680

External Product List

1920

URL edited

After clicking the new Products link, you'll be able to see the custom Product (External Product) list.

CMS Settings

In order to use the custom Product object (i.e. External Product) in the CMS for your Site to show its information, you need to make the following settings:

Site Permissions

  1. From Setup, search Sites on the Quick Find bar.
  2. Choose Fielo Site to modify the Public Access Settings.
  3. Once you're in Public Access Settings, go to Apps and select Object Settings.
  4. For the new custom object (i.e. External Product) click Edit to enable all Object Permissions.
  5. Tick all Read Access and Edit Access (if available) checkboxes from Field Permissions.

Fielo Member Permissions

  1. From Setup, search Sites on the Quick Find bar.
  2. Choose the Fielo Member Site profile.
  3. Once you're in, go to Apps and select Object Settings.
  4. For the new custom object (i.e. External Product) click Edit and enable Read as the Object Permission.
  5. Tick all Read Access and Edit Access (if available) checkboxes from Field Permissions

Avoiding Products being shown as links

To prevent Products from displaying a link on the Invoice Detail page on the CMS Site.

  1. In the Invoice Item object, create a new Formula field.
  2. Assign it a label and a name, removing all the underlined characters from its Name field (CamelCase notation).
  3. Set the Formula Return Type to Text
  4. In the Formula field (Advanced Formula tab), click the Insert Field button, select the field as shown in the example below and click Insert.
804

Formula settings

On the next page, make it visible for all profiles. Click Next then Save.

New Component for the new object

Now you need to create a Component so that you can include show the information contained in the new object (i.e. External Product) in Pages.

  1. From Fielo CMS, go to the Plugins tab.
  2. Click 🔽 and select Local
  3. From the Components Library card, click New.
  4. Create the new Component as follows:

Component Type: List
Name: Component Name (i.e. External Product).
Layout: Table
Object: Custom object created to replace Product (i.e. External Product).
Data Class: FieloCMS.StandardAPI.
Fields: Here you can add the desired fields you want the Component to show as Default Fields, such as Product Family, Description, etc. and any other field from External Product - the new object that replaces Product.

Site settings

  1. From Fielo CMS, go to the Sites tab.
  2. Select the Invoice Upload Settings Page.
  3. Add the Component created before.
  4. Change its name as desired. Make sure to include in the fieldset the fields to be displayed for the products and *Save**.
  5. Still on the Invoice Upload Settings Page, edit the Invoice Items Component by changing the Product Name field to the corresponding field of the new object. Save it.
  6. Back to Sites, hit the Invoice Detail page.
  7. In the Invoice Items Component, replace the Product Name field with the previously created Formula field and save it.
  8. On the Invoice Upload Page, edit the widget component, changing the Product Source Component from the old list to the new one.

Did this page help you?