Hello fellow creators! I have problems with extending BaseSectionV2 schema. I want to disable View button , so I  created a replacing module of BaseSectionV2 and wrote some code, but it's not working. Any advice would be much appreciated

 define("BaseSectionV2",[],function(){
	 return {
		 entitySchemaName:"Base",
		 details:/**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,
		 attributes:{},
		 methods:{
			 checkIsAdmin:function() {
				 var user = Terrasoft.SysValue.CURRENT_USER;
				 var name = user.displayValue;
				 if(name==='Supervisor')
					 return true;			 
				 		return false;
			 }
		 },
		 diff:/**SCHEMA_DIFF*/[
				{
					"operation": "merge",
					"name": "AnalyticsModeViewOptionsButton",
					"parentName": "AnalyticsModeActionButtonsRightContainer",
					"propertyName": "items",
					"values": {
						"itemType": Terrasoft.ViewItemType.BUTTON,
						"caption": { "bindTo": "Resources.Strings.ViewOptionsButtonCaption"},
						"enabled": { "bindTo": "checkIsAdmin"},
					 }
				}
 
		 ]/**SCHEMA_DIFF*/
	 };
  });
File attachments
Like 0

Like

2 comments
Best reply

Hi,

You need to override shema BaseDataView and modify the button SeparateModeViewOptionsButton:

  define("BaseDataView",[],function(){
	 return {
		 details:/**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,
		 attributes:{},
		 methods:{
			 checkIsAdmin:function() {
				 var user = Terrasoft.SysValue.CURRENT_USER;
				 var name = user.displayValue;
				 if(name==='Supervisor')
					 return true;			 
				 		return false;
			 }
		 },
		 diff:/**SCHEMA_DIFF*/[
			 {
				"operation": "merge",
				"name": "SeparateModeViewOptionsButton",
				"values": {
					"enabled": { "bindTo": "checkIsAdmin"}
				}
			}
		 ]/**SCHEMA_DIFF*/
	 };
  });

 

Hi,

You need to override shema BaseDataView and modify the button SeparateModeViewOptionsButton:

  define("BaseDataView",[],function(){
	 return {
		 details:/**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,
		 attributes:{},
		 methods:{
			 checkIsAdmin:function() {
				 var user = Terrasoft.SysValue.CURRENT_USER;
				 var name = user.displayValue;
				 if(name==='Supervisor')
					 return true;			 
				 		return false;
			 }
		 },
		 diff:/**SCHEMA_DIFF*/[
			 {
				"operation": "merge",
				"name": "SeparateModeViewOptionsButton",
				"values": {
					"enabled": { "bindTo": "checkIsAdmin"}
				}
			}
		 ]/**SCHEMA_DIFF*/
	 };
  });

 

Dmytro Vovchenko,

Thanks a lot! It worked!

Show all comments

Hello!

 

I have these 3 buttons that I want to hide or remove on a condition.

 

This is the code that removes them. 

 

If the Ownership Status (added in the attributes) is 'Inactive', then these buttons should dissapear.

 

Does anybody know how I can do this on a condition in diff?

Like 0

Like

2 comments
Best reply

First of all, rather than using operation: remove, change that to operation: merge, which will let you modify the properties of the element. Then, you'll bind the visible property of them to an attribute. To show or hide them, you'll set the attribute to true or false. See this article here for more details: https://customerfx.com/article/how-to-enable-or-disable-a-field-on-a-pa…

Also, to set the attribute to true or false, you'll either need to add that to a change event for whatever fields use the conditions or when the page opens, using the onEntityInitialized function. To base it on the selection of fields, you can wire a change event as shown here: https://customerfx.com/article/triggering-an-event-when-a-field-is-chan…

Info on the onEntityInitialized function and other basic info on working with page code here: https://customerfx.com/article/getting-started-with-writing-code-for-bp…

Hope this helps get you started.

Ryan

First of all, rather than using operation: remove, change that to operation: merge, which will let you modify the properties of the element. Then, you'll bind the visible property of them to an attribute. To show or hide them, you'll set the attribute to true or false. See this article here for more details: https://customerfx.com/article/how-to-enable-or-disable-a-field-on-a-pa…

Also, to set the attribute to true or false, you'll either need to add that to a change event for whatever fields use the conditions or when the page opens, using the onEntityInitialized function. To base it on the selection of fields, you can wire a change event as shown here: https://customerfx.com/article/triggering-an-event-when-a-field-is-chan…

Info on the onEntityInitialized function and other basic info on working with page code here: https://customerfx.com/article/getting-started-with-writing-code-for-bp…

Hope this helps get you started.

Ryan

Show all comments

I created a harmony of data which comes from external web services. For example, I retrieved dataA for ColumnA, dataB for ColumnB, dataC for ColumnC etc. I want to INSERT this data to section object table which section page based on.



How can i bind these things?

Like 0

Like

1 comments

Hello,

 

You can create a business process in which you will fill in the required fields received from the web service.

 

Details on the academy website:

https://academy.creatio.com/docs/user/bpm_tools/process_elements_refere…

Show all comments

Hello community,



Can you please advise me how to run the server code (C#) from a client page (JS).

The business process has a delay when launching, so this method is not the best solution in my case.

 

Thank you in advance.

Mariia

Like 0

Like

2 comments
Best reply

Hello,

 

Please check the following link https://academy.creatio.com/docs/developer/back-end_development/configu…;



Best Regards,

Tetiana Bakai

Hello,

 

Please check the following link https://academy.creatio.com/docs/developer/back-end_development/configu…;



Best Regards,

Tetiana Bakai

As Tetiana mentioned, how this is typically done in Creatio is by creating a configuration web service that you call from your client-side js code. It's actually one of my favorite parts of Creatio and makes for a very powerful development experience and allows you to keep the UI very quick by passing things between the client and the server and performing operations on the server rather than the client. Along with the Academy article Tetiana shared, I also have a write up of how to create a configuration web service and call it from client-side code here: https://customerfx.com/article/creating-a-web-service-and-consuming-it-…

Ryan

Show all comments

I have read this article regarding adding multiple value to a detail.

Link - https://academy.creatio.com/documents/technic-sdk/7-15/adding-multiple-records-detail

 

 

But I do not understand these variable values. The opportunity and contact are the sections that are already created in the system. I want to know what values should I put in custom detail schema.

 

Details of Objects (every object is custom) -

  1. Client section with a detail of Partners
  2. Partners detail is made from Partner section

I want to change the Partner detail in Client to add multiple records. But I do not understand what should be the values of rootEntitySchemaName, rootColumnName, relatedEntitySchemaName, relatedColumnName.

 

Can anyone please help in this matter?

 

Thanks 

Ram

Like 0

Like

4 comments
Best reply

Hello Ramnath,

 

rootEntitySchemaName is the name of the parent object. This is likely the object for the page where the detail is located, so if the detail is on the Account page, this would be Account

 

rootColumnName is the name of the column on the detail object that relates it to the parent object. In the example of being on the Account page, this would be the name of the column on the detail object that is the account lookup, such as UsrAccount

 

relatedEntitySchemaName is the name of the object you're looking up to add to the detail. So, if the lookup is looking up contacts, this would be Contact

 

relatedColumnName is the name of the column on the detail object that the result from the lookup is stored in. So in the example of looking up contacts, this would be a contact lookup on the detail object, such as UsrContact.

 

Maybe this article will help? https://customerfx.com/article/adding-to-a-detail-from-a-lookup-in-crea…

 

Ryan

Hello Ramnath,

 

rootEntitySchemaName is the name of the parent object. This is likely the object for the page where the detail is located, so if the detail is on the Account page, this would be Account

 

rootColumnName is the name of the column on the detail object that relates it to the parent object. In the example of being on the Account page, this would be the name of the column on the detail object that is the account lookup, such as UsrAccount

 

relatedEntitySchemaName is the name of the object you're looking up to add to the detail. So, if the lookup is looking up contacts, this would be Contact

 

relatedColumnName is the name of the column on the detail object that the result from the lookup is stored in. So in the example of looking up contacts, this would be a contact lookup on the detail object, such as UsrContact.

 

Maybe this article will help? https://customerfx.com/article/adding-to-a-detail-from-a-lookup-in-crea…

 

Ryan

Ryan,

 

Thanks for helping me out.

 

Please guide me in this situation more.

Overview of whole scenario

I created a custom detail in a custom section.  I have created a Section Contacts (neither base object nor replacing object, It is custom made) and Clients Section. Clients section has a detail Contacts. The detail's object name is the Contacts section.

 

Section Page - UsrClients

Detail object - UsrContacts (has lookup of UsrClient for connecting record to UsrClients with other inherited columns present in UsrContacts)

 

Now the name will be

rootEntitySchemaName - UsrClients (section page object name)

rootColumnName - UsrClient  (the referencing lookup present in UsrContacts)

relatedEntitySchemaName - UsrContacts (Section page from where records will be read)

relatedColumnName - UsrContact (lookup present in detail)

 

Now the problem is how can I create a lookup pointing to the same object on which detail is build.

Lookup points to UsrContacts and detail is also created on UsrContacts.

 

RAMNATH SHARMA,

 

The detail should be a separate object. Like in the example on the academy, OpportunityContact object on which the detail is built on contains Opportunity and Contact columns. In your case, you would need to create a separate object for the detail that would contain UsrClients and UscrContacts columns, and build the detail on this object. 

Dennis Hudson,

 

Yes, you are right. I have created a new object with 2 looks fields to add this functionality. And it works.

Thanks

Show all comments

Hey

I am using calculated fields to convert inches to cm and vice versa on a lot of different measurements. I am just wondering if I am able to put a variable name when called the methodName so I wouldn't need to create a bunch of methods for each separate one.

Example

			"UsrLengthCM": {
				dataValueType: Terrasoft.DataValueType.FLOAT,
                dependencies: [
                    {
                        columns: ["UsrLengthInches"],
                        methodName: "calculateInchesToCM"
                    }
                ]
			},

do something like this is what I want

			"UsrLengthCM": {
				dataValueType: Terrasoft.DataValueType.FLOAT,
                dependencies: [
                    {
                        columns: ["UsrLengthInches"],
                        methodName: calculateInchesToCM("UsrLengthCM")
                    }
                ]
			},

to make it easier when using this.set

Like 0

Like

3 comments

The method will get passed two parameters, the second parameter is the field that triggered the event. You could use something like this:

calculateLength: function(sender, field) {
    switch(field) {
        case "UsrLengthCM":
            // ...
        case "UsrLengthInches":
            // ...
        // etc
    }
}

Not sure if that's something that will help, but thought I'd mention it.

Ryan

Ryan Farley,

Exactly what I need thank you!

Ryan Farley,

 

Thanks Ryan, this is the only thread I have found that highlights the fieldname being passed from the Attribute dependency. V.Useful!

Show all comments

I have an requirement to change city lookup whenever zip code is changed so is there any event that will do my work?

Thanks

Like 0

Like

2 comments

If you have a ZIP code field or similar in City to filter it by, you can set up a business rule similar to this, with your field in place of Description:

If you require more complex logic, go to the edit page in the backend and add a dependency to the attributes section:

attributes: {
    "City": {
	dependencies: [
	    {
		columns: ["Zip"],
		methodName: "doSomething"
	    }
	]
    }
}

And include your logic in the doSomething method, which will be called every time Zip is changed.

Dear Agha,

Please check the example provided by Darian. For the simple business task it is recommended to use business rules. 

In case you need more complex logic, including if clause, or evaluation on Id, or any other logic, which cannot be implemented by business rules, please use attributes.

In order to add an attribute you need to go to Advanced settings --> create a new replacing module for your page --> add an attribute and save the schema --> clear browser cache. 

Please see articles on schema attributes:

https://academy.bpmonline.com/documents/technic-sdk/7-13/attributes-attributes-property

Regards,

Anastasia

Show all comments

I want to add elements such as tables, radiobutton, dropdownlist to a page in bpmp process, but in the page designer I can not find them.

Should these be added with code?

What language is used?

Greetings.

Like 0

Like

4 comments

Edgar,

What does your page designer look like?

Jordan Kincer,

 

 

Jordan Kincer,

Try the first image using the wizard, but when you can not get elements such as a combobox, I started using the creation in Advance Settings

So for Radio Buttons, you can code them in, but I had issues getting more than three options on the page. If you are restricting the seleciton to one option, I might recommend using a lookup field.

As for the table/detail, I can see that your pre-configured page is missing a 'Tabs' section at the bottom which is the only place a detail can be added. 

When you first create a pre-configured page, it prompts you to select a template. If you want it to have Details inside it, one of the 'Tabbed Page' templates need to be selected.

Are you having issues putting a lookup/dropdown on your page as well?

Show all comments

Hi Community,

Any idea how can I open a section in client code?

Like 0

Like

2 comments

You'll use PushHistoryState to navigate to a section in client code. The following will go to the Contacts section: 

this.sandbox.publish("PushHistoryState", {hash: "SectionModuleV2/ContactSectionV2"});

The "hash" parameter is what appears after the ViewModule.aspx# in the url. 

Ryan

Dear Fulgen,

You can achieve such task in two ways. The first one is described by Ryan. This is an elegant and easy way to manipulate navigation.

Other approach is to use window.location.assign method https://webplatform.github.io/docs/apis/location/assign/ using relative or full path to the page. This approach will save browser history.

Regards,

Anastasia

Show all comments

Hi Community,

Any Idea how can i do this, lets say in Current Case Edit Page, I want to know in client code if my previous screen before opening the Case edit Page is whether Case Section or Account Edit Page (referring to case section detail inside account edit page).

Thanks 

 

Like 0

Like

1 comments

See currentState from HistoryState

var state = sandbox.publish("GetHistoryState");

            var currentHash = state.hash;

            var currentState = state.state || {};                                           console.dir(currentState)

Show all comments