I followed this link https://academy.bpmonline.com/documents/technic-sdk/7-12/adding-detail-…; to try adding a detail with lookup.. Acceptable Certificates under delivery tab of Order section.
Attached are the screenshot. I don't see the + sign next to the detail to get the look up pop up.
What am I missing?
Like
Dear Kumar,
It isn't quite possible to understand what exactly was done incorrectly without the actual code you have used. There is one merge for AddRecordButton, perhaps you have made changes to it?
In any case, the best option will be sending an email to support@bpmonline.com along with more details and changes done by you. You can also try to send this information here.
With best regards,
Oliver
Dear Kumar,
Indeed, archives are blocked for receiving. You can either copy everything to txt file send it, or download it to any shared space/Gdrive etc. and send a link for downloading.
With best regards,
Oliver
// Define schema and set its dependencies from other modules. define("UsrCourierCertDetail", ["ConfigurationEnumsV2"], function(configurationEnumsV2) { return { // Detail object schema name. entitySchemaName: "UsrCourierCertInOrder", // Detail schema methods. methods: { //Returns columns, which were selected by query. getGridDataColumns: function() { return { "Id": {path: "Id"}, "UsrDocument": {path: "UsrDocument"}, "UsrDocument.Number": {path: "UsrDocument.Number"} }; }, //Configures and displays lookup modal window. openDocumentLookup: function() { //Configuration object var config = { // Object schema name, whose records are displayed in lookup. entitySchemaName: "Document", // Indicates whether multiple selection is available. multiSelect: true, // Columns that will be used in lookup (e.g., for sorting). columns: ["Number", "Date", "Type"] }; var OrderId = this.get("MasterRecordId"); if (this.Ext.isEmpty(OrderId)) { return; } // Instance of the [EntitySchemaQuery] class. var esq = this.Ext.create("Terrasoft.EntitySchemaQuery", { // Root schema setup. rootSchemaName: this.entitySchemaName }); // Adding the [Id] coluln. esq.addColumn("Id"); // Adding the [Id] column of the [Document] schema. esq.addColumn("Document.Id", "UsrDocumentId"); // Creating and adding filters to the query collection. esq.filters.add("filterOrder", this.Terrasoft.createColumnFilterWithParameter( this.Terrasoft.ComparisonType.EQUAL, "Order", OrderId)); // Getting the whole collection of records and displaying it in the lookup modal window. esq.getEntityCollection(function(result) { var existsDocumentsCollection = []; if (result.success) { result.collection.each(function(item) { existsDocumentsCollection.push(item.get("UsrDocumentId")); }); } // Ading filter to configuration object. if (existsDocumentsCollection.length > 0) { var existsFilter = this.Terrasoft.createColumnInFilterWithParameters("Id", existsDocumentsCollection); existsFilter.comparisonType = this.Terrasoft.ComparisonType.NOT_EQUAL; existsFilter.Name = "existsFilter"; config.filters = existsFilter; } // Call lookup modal window this.openLookup(config, this.addCallBack, this); }, this); }, // Event handler for saving edit page. onCardSaved: function() { this.openDocumentLookup(); }, // Opens document lookup if the order edit page was saved earlier. addRecord: function() { var masterCardState = this.sandbox.publish("GetCardState", null, [this.sandbox.id]); var isNewRecord = (masterCardState.state === configurationEnumsV2.CardStateV2.ADD || masterCardState.state === configurationEnumsV2.CardStateV2.COPY); if (isNewRecord === true) { var args = { isSilent: true, messageTags: [this.sandbox.id] }; this.sandbox.publish("SaveRecord", args, [this.sandbox.id]); return; } this.openDocumentLookup(); }, // Adding selected documents. addCallBack: function(args) { // Instance of the BatchQuery batch request class. var bq = this.Ext.create("Terrasoft.BatchQuery"); var OrderId = this.get("MasterRecordId"); // Collection of documents selected in the lookup. this.selectedRows = args.selectedRows.getItems(); // Collection passed to query. this.selectedItems = []; // Copying necessary data. this.selectedRows.forEach(function(item) { item.UsrOrderId = OrderId; item.UsrDocumentId = item.value; bq.add(this.getDocumentInsertQuery(item)); this.selectedItems.push(item.value); }, this); // Executing batch request if it is not empty. if (bq.queries.length) { this.showBodyMask.call(this); bq.execute(this.onDocumentInsert, this); } }, //Returns query for adding current object. getDocumentInsertQuery: function(item) { var insert = Ext.create("Terrasoft.InsertQuery", { rootSchemaName: this.entitySchemaName }); insert.setParameterValue("Order", item.UsrOrderId, this.Terrasoft.DataValueType.GUID); insert.setParameterValue("Document", item.UsrDocumentId, this.Terrasoft.DataValueType.GUID); return insert; }, //Method called when adding records to the detail list. onDocumentInsert: function(response) { this.hideBodyMask.call(this); this.beforeLoadGridData(); var filterCollection = []; response.queryResults.forEach(function(item) { filterCollection.push(item.id); }); var esq = Ext.create("Terrasoft.EntitySchemaQuery", { rootSchemaName: this.entitySchemaName }); this.initQueryColumns(esq); esq.filters.add("recordId", Terrasoft.createColumnInFilterWithParameters("Id", filterCollection)); esq.getEntityCollection(function(response) { this.afterLoadGridData(); if (response.success) { var responseCollection = response.collection; this.prepareResponseCollection(responseCollection); this.getGridData().loadAll(responseCollection); } }, this); }, // Method called when deleting selected detail records. deleteRecords: function() { var selectedRows = this.getSelectedItems(); if (selectedRows.length > 0) { this.set("SelectedRows", selectedRows); this.callParent(arguments); } }, // Hide the [Copy] menu item. getCopyRecordMenuItem: Terrasoft.emptyFn, //Hide the [Edit] menu item. getEditRecordMenuItem: Terrasoft.emptyFn, // Returns default column name for filter. getFilterDefaultColumnName: function() { return "Document"; } }, // Array of modifications. diff: /**SCHEMA_DIFF*/[ { // Operation type — merge. "operation": "merge", // НName of the schema element, with which the action is performed. "name": "DataGrid", // Object, whose properties will be combined wuth the shema element properties. "values": { "rowDataItemMarkerColumnName": "Document" } }, { // Operation type — merge. "operation": "merge", // Name of the schema element, with which the action is performed. "name": "AddRecordButton", // Object, whose properties will be combined wuth the shema element properties.. "values": { "visible": {"bindTo": "getToolsVisible"} } } ]/**SCHEMA_DIFF*/ }; } );
This is UsrCourierCertDetail
define("OrderPageV2", [], function() { return { // Name of the edit page object schema. entitySchemaName: "Order", // List of edit page details being added. details: /**SCHEMA_DETAILS*/{ "UsrCourierDetail": { "schemaName": "UsrCourierDetail", "entitySchemaName": "UsrCourierInOrder", "filter": { "detailColumn": "UsrOrder", "masterColumn": "Id" } }, "UsrCourierCertDetail3a15b5f3": { "schemaName": "UsrCourierCertDetail", "entitySchemaName": "UsrCourierCertInOrder", "filter": { "detailColumn": "UsrOrder", "masterColumn": "Id" } }, "UsrSchema2Detail6ec92d86": { "schemaName": "UsrSchema2Detail", "entitySchemaName": "UsrCourierInOrder", "filter": { "detailColumn": "UsrOrder", "masterColumn": "Id" } } }/**SCHEMA_DETAILS*/ , // Array of modifications. modules: /**SCHEMA_MODULES*/{}/**SCHEMA_MODULES*/ , diff: /**SCHEMA_DIFF*/[ { "operation": "merge", "name": "Amount", "values": { "layout": { "colSpan": 11, "rowSpan": 1, "column": 12, "row": 0 } } }, { "operation": "merge", "name": "Client", "values": { "layout": { "colSpan": 12, "rowSpan": 1, "column": 0, "row": 0 } } }, { "operation": "move", "name": "Client", "parentName": "Header", "propertyName": "items", "index": 1 }, { "operation": "merge", "name": "PaymentAmountInfoButton", "values": { "layout": { "colSpan": 1, "rowSpan": 1, "column": 23, "row": 1 } } }, { "operation": "move", "name": "PaymentAmountInfoButton", "parentName": "Header", "propertyName": "items", "index": 2 }, { "operation": "merge", "name": "PaymentAmount", "values": { "layout": { "colSpan": 11, "rowSpan": 1, "column": 12, "row": 1 } } }, { "operation": "merge", "name": "Status", "values": { "layout": { "colSpan": 12, "rowSpan": 1, "column": 0, "row": 1 } } }, { "operation": "merge", "name": "DeliveryType", "values": { "layout": { "colSpan": 12, "rowSpan": 1, "column": 0, "row": 0 } } }, { "operation": "merge", "name": "PaymentType", "values": { "layout": { "colSpan": 12, "rowSpan": 1, "column": 12, "row": 0 } } }, { "operation": "insert", "name": "Currencyf79dae8f-cee6-494d-9727-91536d2a4a21", "values": { "layout": { "colSpan": 12, "rowSpan": 1, "column": 0, "row": 1, "layoutName": "OrderDeliveryInformationBlock" }, "bindTo": "Currency" }, "parentName": "OrderDeliveryInformationBlock", "propertyName": "items", "index": 2 }, { "operation": "insert", "name": "CurrencyRate1e7dece5-a6f0-4a4d-b1f8-f66a44e006de", "values": { "layout": { "colSpan": 12, "rowSpan": 1, "column": 12, "row": 1, "layoutName": "OrderDeliveryInformationBlock" }, "bindTo": "CurrencyRate" }, "parentName": "OrderDeliveryInformationBlock", "propertyName": "items", "index": 3 }, { "operation": "merge", "name": "ContactNumber", "values": { "layout": { "colSpan": 12, "rowSpan": 1, "column": 0, "row": 0 } } }, { "operation": "merge", "name": "ReceiverName", "values": { "layout": { "colSpan": 12, "rowSpan": 1, "column": 0, "row": 1 } } }, { "operation": "merge", "name": "Comment", "values": { "layout": { "colSpan": 12, "rowSpan": 1, "column": 0, "row": 2 } } }, { "operation": "insert", "name": "UsrCourierCertDetail3a15b5f3", "values": { "itemType": 2, "markerValue": "added-detail" }, "parentName": "OrderDeliveryTab", "propertyName": "items", "index": 3 }, { "operation": "insert", "name": "UsrSchema2Detail6ec92d86", "values": { "itemType": 2, "markerValue": "added-detail" }, "parentName": "OrderDeliveryTab", "propertyName": "items", "index": 4 }, { "operation": "merge", "name": "DeliveryTypeResult", "values": { "layout": { "colSpan": 12, "rowSpan": 1, "column": 0, "row": 0 } } }, { "operation": "merge", "name": "PaymentTypeResult", "values": { "layout": { "colSpan": 12, "rowSpan": 1, "column": 12, "row": 0 } } }, { "operation": "merge", "name": "ContactNumberResultsBlock", "values": { "layout": { "colSpan": 12, "rowSpan": 1, "column": 0, "row": 0 } } }, { "operation": "merge", "name": "ReceiverNameResultsBlock", "values": { "layout": { "colSpan": 12, "rowSpan": 1, "column": 0, "row": 1 } } }, { "operation": "merge", "name": "CommentResultsBlock", "values": { "layout": { "colSpan": 12, "rowSpan": 1, "column": 0, "row": 2 } } }, { "operation": "merge", "name": "Number", "values": { "layout": { "colSpan": 12, "rowSpan": 1, "column": 0, "row": 0 } } }, { "operation": "merge", "name": "Date", "values": { "layout": { "colSpan": 12, "rowSpan": 1, "column": 12, "row": 0 } } }, { "operation": "merge", "name": "Opportunity", "values": { "layout": { "colSpan": 12, "rowSpan": 1, "column": 0, "row": 1 } } }, { "operation": "move", "name": "Opportunity", "parentName": "OrderPageGeneralInformationBlock", "propertyName": "items", "index": 2 }, { "operation": "merge", "name": "SourceOrder", "values": { "layout": { "colSpan": 12, "rowSpan": 1, "column": 12, "row": 1 } } }, { "operation": "merge", "name": "DueDate", "values": { "layout": { "colSpan": 12, "rowSpan": 1, "column": 0, "row": 2 } } }, { "operation": "merge", "name": "ActualDate", "values": { "layout": { "colSpan": 12, "rowSpan": 1, "column": 12, "row": 2 } } }, { "operation": "merge", "name": "PaymentStatus", "values": { "layout": { "colSpan": 12, "rowSpan": 1, "column": 0, "row": 3 } } }, { "operation": "merge", "name": "DeliveryStatus", "values": { "layout": { "colSpan": 12, "rowSpan": 1, "column": 12, "row": 3 } } }, { "operation": "merge", "name": "Owner", "values": { "layout": { "colSpan": 12, "rowSpan": 1, "column": 0, "row": 4 } } } ]/**SCHEMA_DIFF*/ , methods: {}, rules: {} }; });
This is OrderPageV2
I uploaded the files to wetransfer.com and sent to support@bpmonline.com
Dear Kumar,
It seems you have wrong dependencies in the UsrCourierCertDetail. Check that you have the following parent object in your detail:
First, I tried to select "Base detail schema" as a parent object and "+" sign really didn't appear. This sign appears only after setting the right parent object. Also you have some errors in the code like writing:
define("UsrCourierCertDetail", ["ConfigurationEnumsV2"], function(configurationEnumsV2) {
instead of
define("UsrCourierCertDetail", ["ConfigurationEnums"], function(configurationEnums) {
But these are don't have any influence on "+" sign. Such errors are seen in a browser console and you are able to fix it by yourself.