I have a string field that is being populated in this format, "myfielddata-data". I need to parse the data after the "-" to use in a business process.

Like 0

Like

1 comments

Hello Justin,

 

string myString="myfielddata-data";

int indexRetrieved=myString.LastIndexOf("-");

 

string result= myString.SubString(indexRetrieved);

 

other way:

string myString="myfielddata-data";

string arMyString[] = myString.Split("-");

 

string result = arMyString[1];

 

 

Show all comments

Hi Team,

We have an OOTB feature introduced to set the field values using Business Rule.

There are function options provided while setting the field values if the Source(Target field) is numeric.

 

a)The OOTB feature shows formula and it has an in-built date function along with operators to write a formula and set values to a field.

b)But when a String field is selected there were no options for formula. It would be nice to have string functionalities such as,

strcat - concatenate two strings
strcmp - compare two strings
strcpy - copy a string
strlen - get the string length
String.Remove - Remove specified part of string





Best regards,

Bhoobalan Palanivelu.

1 comments

Hello Bhoobalan,



Thank you so much for your idea. We've registered it in our R&D team backlog for consideration and implementation in future application releases. Thank you for helping us to improve our product. 

 

Best regards,

Bogdan

Show all comments

I have created 3 new sections using section wizard and changed name of the UsrName field in all of them because I wanted different names.

But now whenever I publish any new object or compile items, I get this error. Is there any way to sort it out.

I am using demo environment.

Thank you

Like 0

Like

6 comments

Creatio does not like it when the UsrName is changed. You will need to change it back. You can change the title, but you cannot change the Name. You can, however, not use it. If you create a new String, you can change the Displayed Value in the Advanced Settings for the object to the new String you made. This changes the blue links to the new string instead of the UsrName.

 

Reid Burger,

 

Thanks for clarification.

I also would like to know if I can change the Required - At application level to No for UsrName.

RAMNATH SHARMA,

 

It is fine to change properties like required at application level to no. If the field is being used as the display value (like the name field) then having it blank would mean nothing would show in a lookup (if its used as a lookup somewhere). 

 

BTW it's usually a good idea to not rename column or object names and only change the titles once they're created. 

 

Ryan

Ryan Farley,

I changed back the names to UsrName using section wizard (which I later realized shouldn't have changed them back). Then I compiled the current workspace from Advanced settings to see if still any error occurs. 

Here are some screenshots

Now The errors are because I changed back the name to UsrName, it says that the old Name - UsrClaimant don't exist.

I also opened the source code where these errors were pointing to - 

 

 

But I can not edit the source code in Cloud demo instance.

Is there any way to change the source code or any process to correct these source codes?

 

Ramnath

Hi Ramnath,



As Reid mentioned, we do not recommend to change the name after the section being created.



If such an issue appears you can simply generate source code for all objects that are mentioned in compilation errors and compile modified items. If all necessary items were not removed this should fix the issue



Thank you.

Bohdan Zdor,

Thanks. I will definitely try this out.

Show all comments

I attempted to get a lookup value in an email body, however it came through as the Id of the lookup value.

I tried to create a text process parameter and use a formula: [#Read PCR Data.First item of resulting collection.PCR Change Type#].ToString()

I expected the result to look like thisL reason: "Proactive Break/Fix"

however the result looked like this: reason: "ec15074d-4b35-4191-ae85-5bf01144101a"

How can I get the text value instead of the id?

Like 0

Like

2 comments

Mitch, 

You will have to read the lookup within the PCR Data, in your example not only do you have to "Read PCR Data" but you should also read the "PCR Change Type" lookup (in another element) which is in the object you are already reading.



The filtration will be something like 'ID = Read PCR Data.PCR Change Type'.



Extra** The reason you got your result (and why it is still technically true) is because you are only reading the UID value of the lookup and not the Name value - there is some magic that happens to connect the UID.Name in the view. So what your code is doing is casting the UID 'type' to string 'type'.



Hope this helps!

Philip Wierciszewski,

Perfect! thanks so much!

Show all comments

Hi community,

I would like to know more about the amount of space next fields take in database (cloud version):

For example, Text(250) field holds a string of 70 characters. How much space would it take in bytes? 

What if the value is null?

If we have 20 custom Text columns for Contact object, how much do they affect the performance? For table of 10K-30K rows. And if they are null for bigger amount of contacts?

For the section table (Account, Contact) of 10K-30K rows, what should be... hmm... the strategy of creating new custom fields for better performance? As an option, instead of adding the columns to Contact object we may add them to a separate detail object, but that increases complexity.

Should we consider much about that?

Thank you.

Like 0

Like

1 comments

Dear Yuriy, 

We haven't performed such precised tests, however, the size of the string field is approximately 2 bytes per character. You can perform tests yourself populating columns in sql and evaluating the difference in size of the table. However, the value of the field itself doesn't affects the performance of the system. The amount of columns may affect the performance of the system depending on how often and in which volume you get the data (how many records and how many columns) as it loads an sql to the certain extent. However, 20 text fields shouldn't cause much trouble. There are some ways of optimizing this based on what's said above, e.g. when you use Read Data element in the Business process we recommend to read only columns that are further used in the system. 

Show all comments



Hi community!



Contact has a colmn called "ContactPhoto" which returns System.Byte[].

I need this to be a string for a view that I'm creating.



this is what I tried:

 

SELECT Id, ContactPhoto,
	cast('' as xml).value('xs:base64Binary(sql:column("ct.ContactPhoto"))', 
	'varchar(max)') AS UsrContactPhoto
	FROM contact ct

which returns me an empty string:

https://prnt.sc/po1qe8

 

Any idea how I can convert it?



Thanks in advance!

File attachments
Like 0

Like

0 comments
Show all comments
  1. Get the Usr code of the field.
    1. Open the section wizard for the section.
    2. Double click on the field.
    3. Note the Name in DB of the field.
    4. Close the section wizard.
  2. Open the Schema for the edit page.
  3. Backup the current Schema by copying and pasting it to a Notepad file.
  4. Find the DIFF section of the insert operation for the Usr code of the field.
  5. If there is a labelCofig section, delete the content of labelConfig
    "labelConfig": {}
  6. Add a comma after "enabled": true
    "enabled": true,
  7. After enabled add:
    "showValueAsLink": true,
    "href": {
            "bindTo": "UsrCodeOfTheField",
            "bindConfig": {"converter": "getUsrCodeOfTheField"}
             },
    "controlConfig": {
             "className": "Terrasoft.TextEdit",
             "linkclick": { bindTo: "onUsrCodeOfTheFieldClick"}
             }

     

  8. In methods add:
    getUsrCodeOfTheField: function(value) {
       return {
           "url": value,
           "caption": value
       };
    },
    onUsrCodeOfTheFieldClick: function(url) {
       if (url != null) {
            window.open(url, "_blank", "height=" + this.get("WindowHeight") + ",width=" + this.get("WindowWidth"));
            return false;
       }
    }

     

  9. Click the Code Validation button to verify that there are no errors on the page.
  10. Click the Save button.

Refresh the edit page to see the field appear as link.

Like 2

Like

Share

5 comments

You can add mixins "CommunicationOptionsMixin" and update the field as following:

	{
	    "operation": "insert",
	    "name": "...",
	    "values": {
	        "layout": {
	            // ...
	        },
	        "bindTo": "UsrDocumentLink",
	        "className": "Terrasoft.BaseEdit",
	        "showValueAsLink": "true",
	        "href": {
	            "bindTo": "UsrDocumentLink",
	            "bindConfig": {
	                "converter": "getLinkValue"
	            }
	        },
	        "linkclick": {
	            "bindTo": "onOpenWindowClick"
	        }
	    }
	    //...
	}

 

If I want to have multiple string fields as hyperlinks, how do I do this in 'methods'? Do I add this whole section of code in again for the next field but replacing the 'UserCodeOfTheField with the 2nd string field name?

getUsrCodeOfTheField: function(value) {
   return {
       "url": value,
       "caption": value
   };
},
onUsrCodeOfTheFieldClick: function(url) {
   if (url != null) {
        window.open(url, "_blank", "height=" + this.get("WindowHeight") + ",width=" + this.get("WindowWidth"));
        return false;
   }
}

 

Julie cooper,

 

you need to add a separate method for the second string field and bind it to your second string field. So there should be 

getUsrCode1OfTheField

and

getUsrCode2OfTheField

as well as

 

onUsrCodeOfTheField1Click

and

onUsrCodeOfTheField2Click

methods and they should be bound to each string field accordingly.

 

Best regards,

Oscar

Oscar Dylan,

Hi ,

Here my doubt was in column setup its showing like a normal filed.How to setup same text filed as an hyperlink in column setup also.

 

Regards,

Praveen

Dear praveen n,

 

Unfortunately, there is no easy way to do the same it in the grid aside from using http/https (or other link-type strings like email, etc.) You can do it by extending or overriding class Terrasoft.Grid (you can find it in the web console, you won't be able to find it in configuration) and changing the method formatCellContent to call formatCellLink when you need it to aside from cases when it is called by default. You can debug method formatCellContent and see how it works in OOB version and create your own based on that. Unfortunately, we don't have examples of such implementation. 

Please see the following articles on how to override modules: 

https://community.creatio.com/questions/substitutionreplacing-modules

https://community.creatio.com/questions/change-task-displayed-fields

 

Best regards, 

Dennis 

Show all comments

How do you use the Modify data action to set a String field to null or empty string?  I've tried entering "" and String.Empty in the Notes formula and neither worked.

Like 0

Like

5 comments

Dear Janine,

To do that you need to specify "String.Empty" value for this string as a formula in "Modify data" element (like on the screenshot http://prntscr.com/nfh32l).

Best regards,

Oscar

I did that and it ignored it, like "".

The only thing that I've found that works is creating a dummy String Parameter that has nothing in it, i.e., Blank Text, then setting the Modify data field that I want to be empty to the dummy parameter.

Janine White,

I personaly tested "String.Empty" formula value and it removed the value of the string field to an empty value and it should work on your side either.

As for paramter set for the string field as an empty text parameter - it also works and you can also use this parameter if needed.

Best regards,

Oscar 

Oscar Dylan,

When I put String.Empty, not in quotes, in the formula, it displayed "String.Empty", not an empty string, for the field.

Janine White,

Please email us to support@bpmonline.com and provide us with the link to the application and with the name of the section where you try to implement this logic and we will take a look closer. We can't reproduce this behavior on our side so we need to see the field you are trying to change and the process that was created on your side that should change this field.

Best regards,

Oscar

Show all comments

I have  string text field, I want to pop up look up upon hitting [enter] or [tab] keys

Like 0

Like

1 comments

It will be hard to catch the [tab] click event. The problem is that the [tab] key is reserved for changing an active element in a browser.

The [Enter] key will be easy to catch. I would do the following:

define("ContactPageV2", [], function() {
	return {
		entitySchemaName: "Contact",
		attributes: {},
		modules: /**SCHEMA_MODULES*/{}/**SCHEMA_MODULES*/,
		details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,
		businessRules: /**SCHEMA_BUSINESS_RULES*/{}/**SCHEMA_BUSINESS_RULES*/,
		methods: {
			onEntityInitialized: function() {
				this.callParent(arguments);
			},
			onPhoneClick: function(e) {
				if (e && e.keyCode === 13) {
					console.log("show popup");
				}
			}
		},
		dataModels: /**SCHEMA_DATA_MODELS*/{}/**SCHEMA_DATA_MODELS*/,
		diff: /**SCHEMA_DIFF*/[
			{
				"operation": "merge",
				"name": "AccountPhone",
				"values": {
					"layout": {
						"colSpan": 24,
						"rowSpan": 1,
						"column": 0,
						"row": 4
					},
					"keyup": {
						"bindTo": "onPhoneClick"
					}
				}
			}
		]/**SCHEMA_DIFF*/
	};
});

 

Show all comments