Hello Team,

I have a requirement that I need solution for.

Is there any possibility to populate the detail having same lookup field value as that of this record as soon as the lookup value is populated and thee record  is still not saved i.e. whenever I click on new and fill a value in a perticular lookup than all the records having the same lookup value should show in self-detail(detail of its own section) without clicking on the save button.

If any body knows solution to this problem then please let me know 

 

Like 0

Like

2 comments

That sounds like something you'd have to implement with code, as it's a bit of a specific requirement to have them showing as being updated before you've actually saved the parent record. Something using the HandleViewModelAttributeChangeRequest handler, which fires every time you change a field value including lookups. You'd probably have to deal with all the records becoming seen as edited by Creatio though, and the code to modify the visible records wouldn't modify the ones that hadn't yet been loaded but are still associated with the parent record, so it seems like there are quite a few pitfalls of doing this to watch out for.

 

If you're updating every child record anyway, is there a reason for storing this value on the child records as well? Seems like it could just be used by the reference that exists on the child entity to the parent, using Creatio's related entity stepping ability when showing/using fields?

Is there any possibility that you can provide a sample code for resolving above issue?

Show all comments

Hi Community,

 

I've created a detail in FreedomUI that adds attachments to the SysFile table. But upon upload, I can see the newly added file in the detail only after reloading the whole page. 

 

 

I tried to reload the detail on upload using the following code but it didn't work:

 



{

                request:"crt.UploadFileRequest",

                handler:async (request, next) =>{

                    console.log("new record");

                    await next?.handle(request);



                    const handlerChain = sdk.HandlerChainService.instance;

                    for(var i = 0;i<2;i++)

                    {

                        await handlerChain.process({

                                                    type: "crt.LoadDataRequest",

                                                    $context: request.$context,

                                                    config: {

                                                        loadType: "reload"

                                                    },

                                                    dataSourceName: "DataGrid_0b46u59DS"

                                                });

                    }



                }

},

 

I would like to see the file in the detail as soon as its uploaded. 

 

Thanks in advance for any help!

 

Regards,

Abilash.S

 

 

 

 

Like 1

Like

2 comments

Hello,

Please try reloading using this code

setInterval(async ()=&gt;{
                                const handlerChain = sdk.HandlerChainService.instance;
                                await handlerChain.process({
                                    type: 'crt.LoadDataRequest',
                                       $context: request.$context,
                                    config: {
                                        loadType: 'reload'
                                    },
                                    dataSourceName: '{Your Data Source}'
                                });                        
                            }, 1000);

 

Hello,

You can still use that approach, or you can add a standard attachment component.

Show all comments

Hi community,

I made a custom button in the product in order detail action menu.

In this button onClick event, I called a business process and had to pass the order's id to it.

How do I get the order id from within the product in order detail schema so that I can pass it to the business process?

 

Thank you!

Like 0

Like

2 comments
Best reply

Hi,

 

You can use:

this.get("MasterRecordId")

to get the master record Id value and use it in the click handler method.

Hi Andrew,



1. You can pass OrderProductId to the process and read OrderId from OrderProduct



2. You can call process from OrderProductDetailV2 with such a code:



            runMyBusinessProcessAll: function() {

                ProcessModuleUtilities.executeProcess({

                    "sysProcessName": "UsrMyProcess",

                    "parameters": {

                        "OrderId": this.get("MasterRecordId")

                    }

                });

            },

Hi,

 

You can use:

this.get("MasterRecordId")

to get the master record Id value and use it in the click handler method.

Show all comments

Hi community,

 

I read the article (https://community.creatio.com/questions/add-action-detail) in Creatio community and added a button in the action menu of our order product detail.

But the visibility seems not working. May you help me to adjust the code below? What I

need is to show the button when some detail records are selected, and hide the button otherwise.

 

                     addToolsButtonMenuItems: function(toolsButtonMenu) {

                             this.callParent(arguments);

                             toolsButtonMenu.addItem(this.getButtonMenuSeparator());

                             toolsButtonMenu.addItem(this.getButtonMenuItem({

                               Caption: this.get("Resources.Strings.UsrBtnBatchUpdate"),

                               Click: {"bindTo": "OnButonClick"},

                               Visible: {"bindTo": "IsSelectRecord"}

                             }));

                     },

 

Thanks a lot!

Like 0

Like

2 comments
Best reply

Hi Andrew,

 

Please use the following approach:

methods: {
				addToolsButtonMenuItems: function(toolsButtonMenu) {
					this.callParent(arguments);
					toolsButtonMenu.addItem(this.getButtonMenuSeparator());
					toolsButtonMenu.addItem(this.getButtonMenuItem({
						Caption: {"bindTo": "Resources.Strings.CustomButton"},
						Click: {"bindTo": "onButonClick"},
						Visible: {"bindTo": "getCustomButtonVisible"},
					}));
				},
				getCustomButtonVisible: function() {
					return this.isSingleSelected();
				},
				onButonClick: function() {
					console.log("Clicked!");
				}
			},

there is no IsSelectRecord base attribute that will make the button visible or invisible, thus there are basic methods to make "Edit" or "Copy" buttons enabled\disabled so I've used the logic behind them as an example to make the custom button visible.

Hi Andrew,

 

Please use the following approach:

methods: {
				addToolsButtonMenuItems: function(toolsButtonMenu) {
					this.callParent(arguments);
					toolsButtonMenu.addItem(this.getButtonMenuSeparator());
					toolsButtonMenu.addItem(this.getButtonMenuItem({
						Caption: {"bindTo": "Resources.Strings.CustomButton"},
						Click: {"bindTo": "onButonClick"},
						Visible: {"bindTo": "getCustomButtonVisible"},
					}));
				},
				getCustomButtonVisible: function() {
					return this.isSingleSelected();
				},
				onButonClick: function() {
					console.log("Clicked!");
				}
			},

there is no IsSelectRecord base attribute that will make the button visible or invisible, thus there are basic methods to make "Edit" or "Copy" buttons enabled\disabled so I've used the logic behind them as an example to make the custom button visible.

Oleg Drobina,

Thank you for your guid!. It works for a single detail record selected, like the behavior of "Edit" or "Copy".

What I want is the like the behavior of "Delete", and I found the solution in the academy.

In summary, I just adjusted the code below to approach the behavior like "Delete" action.

 

getCustomButtonVisible: function() {

    var selectedRows = this.get("SelectedRows");

    return selectedRows ? (selectedRows.length > 0) : false;

},

 

Thank you!

Show all comments

I have a button on a detail that I want to use to filter the records in the said detail upon clicking it. The Apply filter option doesn't seem to be there. Quick filters seem to be working for a section but not on a detail. 

 

Anyone knows a possible solution ?

 

Regards,

Abilash

Like 0

Like

2 comments

hi Abilash,



Have you checked by refreshing the page?

Did you debug to see the execution of the Detail button event?



If the execution of the event is successful, then Grid data must be refreshed and published by applying the latest filter data.

(OR)

It is possible to implement the quick filter module following this article https://academy.creatio.com/documents/technic-sdk/7-13/adding-quick-filter-block-section





BR,

Bhoobalan Palanivelu

Hi Bhoobalan Palanivelu,

 

Thanks for your reply.

 

First part of your question, applying the filter on the detail upon clicking the button is the issue for me.  As for the second part, I've tried implementing the quick filter on the detail but to no avail. It's not throwing an error but nor am I getting the required output.

 

Regards,

Abilash.S

 

Show all comments

Hi all,

 

I wanted to add a mini page to add a record to a detail that does not exist as a section. It is created based on a new object. How can we achieve this?

 

Thank you.

Geeviniy

Like 0

Like

1 comments

Hello Geeviniy, 

 

You can add and configure a mini page for the section. In case you have a custom object and there is obviously no oob section created based on such object, you can create such section from your side, configure mini page and further hide this section from the workplace. This way you'll have the mini page for a detail created based on this custom object and section won't bother you as it's not added to any workplace, therefore not available for users from UI.



Adding mini page to the detail without creating a section based on it's object can be achieved only with a help of additional development.

 

We've also registered a corresponding query for our responsible R&D team to consider implementing the requested functionality in the upcoming versions of a system.



Best regards,

Anastasiia

Show all comments

Hi, community.

 

Is there a way to make a "Detail" read-only on mobile?

I need to hide the "Add" and "Delete" buttons in "Detail" according to some rules.

I know that in the web version we can do this with the code below:

 



 

getAddRecordButtonVisible: function() {return false; },          

editCurrentRecord: () => false,

getEditRecordMenuItem: Terrasoft.emptyFn,

getCopyRecordMenuItem: Terrasoft.emptyFn,

getDeleteRecordMenuItem: Terrasoft.emptyFn,

 





 

Thanks,

Tiago Pierine.

Like 0

Like

7 comments

Hi Tiago,

 

There is a getChangeModeOperations method for each page\view\gird controller and is specified in the following manner in the base page controller:

 

	getChangeModes: function() {
		var changeMode = this.getChangeMode();
		return Terrasoft.DataUtils.getChangeModeOperations(changeMode);
	},
 
	/**
	 * Returns change mode operations.
	 * @protected
	 * @return {Object} Change mode operations.
	 */
	getChangeModeOperations: function() {
		return this.getChangeModes();
	},
 
	/**
	 * Returns change mode bit mask.
	 * @protected
	 * @virtual
	 * @return {Number} Change mode bit mask.
	 */
	getChangeMode: function() {
		var detailConfig = this.getDetailConfig();
		var changeMode;
		if (detailConfig) {
			changeMode = detailConfig.changeMode;
		} else {
			changeMode = Terrasoft.sdk.Module.getConfig(this.self.Model).changeMode;
		}
		return Ext.isNumber(changeMode) ? changeMode : Terrasoft.ChangeModes.All;
	},

So you need to create a controller for your page and extend the method in the way like below (it's an example, should be tested and debugged):

 

getChangeModeOperations: function() {
   var detailConfig = this.getDetailConfig();
   if (detailConfig) {
      var parentRecord = detailConfig.parentRecord;
      if (parentRecord.get("IsNonActualEmail") === false) {
         return {
            canCreate: false,
            canUpdate: false,
            canDelete: false
         };
      }
   }
   return this.callParent(arguments);
}

Best regards,

Oscar

Oscar Dylan,

Hi Oscar, thank you very much for the answer, would you have any examples of how to create a controller of this type? The section that I am using on mobile for this case is "Account".

Hi Tiago,

 

Unfortunately we don't have any instructions on this matter, you need to study how base controllers are created and create one for your section.

 

Best regards,

Oscar

Oscar Dylan,

Hi Oscar, 

 

This code below is it only works for standard details?

 

Terrasoft.sdk.Details.setChangeModes("Contact", "ActivityDetailV2StandartDetail", [Terrasoft.ChangeModes.Read]);

 

I am trying to do it work for Embedded Detail but it is not working like the example below:

 

Terrasoft.sdk.Details.setChangeModes("UsrTributRetPortDetail", "UsrSchemad37cf1aeDetailEmbeddedDetail", [Terrasoft.ChangeModes.Read]);



 Terrasoft.sdk.Details.setChangeModes("AccountAddress", "AccountAddressDetailV2EmbeddedDetail", [Terrasoft.ChangeModes.Read]);

 

 

Hi Tiago Martins Pierine, did you find the way to make the control with this functinoality?

 

Oscar can you tell us in what file you find the base code?

Federico Buffa ?,

Hi Federico, no, I couldn't get this to work.

Show all comments