Add product catalogue to new details of object "product in order

Dear Community,

 

I want to add multiple details of the same object "product in order" to the order section. My problem is that the product catalogue of the original detail does not appear when adding products in the newly created details.

Does anyone have the code to adjust this?

 

 

Like 0

Like

6 comments

Hello Markus,

 

First of all, we don't recommend adding the same details on the page more than once as they may not behave correctly.

 

The "Product in Order" detail is quite specific, and is meant to be used in one section only. You can make it visible it two different tabs. 

 

To add the same detail twice, you can create a new detail based on this object, and then add it to the page. So the detail should work correctly.

 

Regards,

Gleb.

Gleb,

Thanks for answering! If I create a detail based on the same object, unfortunately the selection page (in the screenshot above) is not transferred. Any idea how I could copy this functionality to the new detail?

Hello Markus,

 

honestly, it is quite difficult to understand where you have the issue without looking at it. You can try the following:



1. Open this detail's settings in "Order" section

2. Go to the second section where you need this detail, open Wizard, Add new detail

3. Than you can just copy the relation from the first one (like Object, columns etc.)

4. Give you detail another Name and Code, then Save.

5. Now you have the same detail as in "Orders" which is working correctly.

 

If you will still have some questions, I recommend creating a case for our support team so my colleagues will be able to help you resolve the problem as quick as possible.

 

Regards, 

Gleb.

Markus Kumpfmüller,



To begin with, you should create a new object and set  Parent Object: BaseProductEntry.



Please follow the below steps for Product Catalogue.

 

 

 

 The following dependency and code to the edit page where the detail is added. (Ex: OpportunityPageV2)

 

            Dependency: ProductSalesUtils

 

            /**Opens the catalogue page**/

            openCardInChain: function(config) {

                 if (config && !config.hasOwnProperty("OpenProductSelectionModule")) {

                     return this.callParent(arguments);

                 }

                 return ProductSalesUtils.openProductSelectionModuleInChain(config, this.sandbox);

            },

Inside the Detail Schema you need to subscribe the following messages.

                       /**

                   * @message ProductSelectionInfo

                   * ########### ######### ###### ####### ########

                   * @return {Object}

                   */

                  "ProductSelectionInfo": {

                        mode: Terrasoft.MessageMode.PTP,

                        direction: Terrasoft.MessageDirectionType.SUBSCRIBE

                  },

                  

                  /**

                   * @message ProductSelectionSave

                   * ############ ####### ######## ###### ####### #########

                   */

                  "ProductSelectionSave": {

                        mode: Terrasoft.MessageMode.PTP,

                        direction: Terrasoft.MessageDirectionType.SUBSCRIBE

                  },

 

            init: function() {

                this.callParent(arguments);               

                this.subscribeOnProductSelectionInfo();

                           },

subscribeOnProductSelectionInfo: function() {

    this.sandbox.subscribe("ProductSelectionSave", this.onProductsSelected, this, [this.sandbox.id + "_ProductSelectionModule"]);

    this.sandbox.subscribe("ProductSelectionInfo", function() {

           return {

                masterRecordId: this.get("MasterRecordId"),

                masterEntitySchemaName: this.get("DetailColumnName"),

               masterProductEntitySchemaName: this.entitySchemaName

             };

      }, this, [this.sandbox.id + "_ProductSelectionModule"]);

},

 

Important Note: You need to change the schema detail parent to "Base detail - Products". And the schema detail page to "Base edit page - Products detail".

Bhoobalan Palanivelu,

 

Trying to create "Product in Lead" detail with product catalogue. Using your hints, I've created new object PrbProductInLead (parent: BaseProductEntity) with Lead lookup column, added PrbProductInLeadDetail schema (parent: Base detail - Products) and PrbProductInLead1Page schema (parent: Base edit page - Products detail). Changed LeadPageV2 so it contains:

define("LeadPageV2", ["ProductSalesUtils"], function(ProductSalesUtils) {
 
...
 
            openCardInChain: function(config) {
                if (config && !config.hasOwnProperty("OpenProductSelectionModule")) {
                    return this.callParent(arguments);
                }
                return ProductSalesUtils.openProductSelectionModuleInChain(config, this.sandbox);
            },

Also I added code to PrbProductInLeadDetail:

...
		messages: {
			"ProductSelectionInfo": {
				"mode": Terrasoft.MessageMode.PTP,
				"direction": Terrasoft.MessageDirectionType.SUBSCRIBE
			},
			"ProductSelectionSave": {
				"mode": Terrasoft.MessageMode.PTP,
				"direction": Terrasoft.MessageDirectionType.SUBSCRIBE
			},
		},
...
		methods: {
			init: function() {
				this.callParent(arguments);
				this.subscribeOnProductSelectionInfo();
			},
			subscribeOnProductSelectionInfo: function() {
				this.sandbox.subscribe("ProductSelectionSave", this.onProductsSelected, this, [this.sandbox.id + "_ProductSelectionModule"]);
				this.sandbox.subscribe("ProductSelectionInfo", function() {
					var answer = {
						masterRecordId: this.get("MasterRecordId"),
						masterEntitySchemaName: this.get("DetailColumnName"),
						masterProductEntitySchemaName: this.entitySchemaName
					};
					console.log("subscribeOnProductSelectionInfo");
					console.log(answer);
					return answer;
				}, this, [this.sandbox.id + "_ProductSelectionModule"]);
			},

But when I push the AddRecordButton on Lead page, I get loading mask that won't come off until I close the page. Browser console says:

Error while sending request - InvalidTypeCastException (Column must be lookup).

What am I doing wrong? Please, help.

 

Regards,

Oleg.

Bhoobalan Palanivelu,



Could you please clarify whether we should create a detail (which will result in Creatio adding an object, detail, and page to the configuration) or if we must add a custom section?

"To begin with, you should create a new object and set  Parent Object: BaseProductEntry."

Show all comments