Hello Everyone,

I have this button, which is suppose to save data on clicking, on clicking the button is executing Query but it is always using Update Query, I want to execute insert query in case it is new entry.

Can any one guide me on how to do this?

{
                "operation": "insert",
                "name": "SaveButton",
                "values": {
                    "layoutConfig": { "column": 1, "row": 4 },
                    "type": "crt.Button",
                    "caption": "Save",
                    "color": "primary",
                    "clicked": {
                        "request": "crt.SaveDataRequest",
                        "params": {
                            "dataSourceName": "UsrConfigDS",
                            "parameters": [
                                { type: "primaryColumnValue", value: Terrasoft.generateGUID() } 
                            ],
                            "config": {
                                "silent": "true", 
                                "payload": {
                                    "UsrRegion": "$Region",  
                                    "UsrKey": "$Key" 
                                }
                            }
                        },
                    },
                },
                "parentName": "GridContainer_da9zpnz",
                "propertyName": "items",
                "index": 3
            }

Like 0

Like

2 comments
Best reply

Hello Madhav,

 

Page designer allows you to add Save button to your page easier by adding a button and setting its Action to Save data value.

 

Page Designer

 

The system will identify automatically if it's a new record or existing one and will call InsertQuery or UpdateQuery accordingly.

 

In the source code the button will look as following

 

{
	"operation": "insert",
	"name": "Button_xx1i3cp",
	"values": {
		"type": "crt.Button",
		"caption": "#ResourceString(Button_xx1i3cp_caption)#",
		"color": "primary",
		"disabled": false,
		"size": "large",
		"iconPosition": "only-text",
		"visible": true,
		"clicked": {
			"request": "crt.SaveRecordRequest"
		},
		"clickMode": "default"
	},
	"parentName": "MainHeaderTop",
	"propertyName": "items",
	"index": 1
}

Hello Madhav,

 

Page designer allows you to add Save button to your page easier by adding a button and setting its Action to Save data value.

 

Page Designer

 

The system will identify automatically if it's a new record or existing one and will call InsertQuery or UpdateQuery accordingly.

 

In the source code the button will look as following

 

{
	"operation": "insert",
	"name": "Button_xx1i3cp",
	"values": {
		"type": "crt.Button",
		"caption": "#ResourceString(Button_xx1i3cp_caption)#",
		"color": "primary",
		"disabled": false,
		"size": "large",
		"iconPosition": "only-text",
		"visible": true,
		"clicked": {
			"request": "crt.SaveRecordRequest"
		},
		"clickMode": "default"
	},
	"parentName": "MainHeaderTop",
	"propertyName": "items",
	"index": 1
}

@Iryna Oriyenko, got it. Thank you !!

Show all comments

Hey Community,
I'm trying to save a business process and on saving i'm facing the below error.How do i resolve this?Attaching the picture below.

Like 0

Like

3 comments

I understand that it has to do something with language and dates,but i don't have anything else except a timer in the bp

Hello!

 

Unfortunately, this is a bug of Creatio platform.

This error is occuring when you try to read column "Caption" in the collection of records.
For now, please use this temporary solution.
Inside the "Read Data" element for the collections:
1) Select What record data should the process read? -> Read data from selected columns only
2) Click "Add Column"
3) Select all the needed columns except "Caption"

 

Have a nice day!

Arsenii Ostapyk,

Hey , thank you for the prompt reply ,yes i am using the collection of records in read element , but i don't have a Caption column .This is a base lookup Is there something else that i can do ?

Show all comments