Hi Sir/Madam,

Please tell me how to send values from landing pages to custom form fields.

Regards

Raghu Ram

Like 0

Like

3 comments

Hello.

Please find the instruction below:

https://academy.bpmonline.com/documents/marketing/7-12/how-set-mapping-…

Best regards,

Matt

Hi Sir/Madam,

Is it possible to map landing page fields to custom sections fields, other than lead section.

Regards

Raghu Ram

Raghu Ram,

Sure it is! 

The instruction is below:

https://academy.bpmonline.com/documents/marketing/7-12/how-set-landing-…

Matt

Show all comments

Hello Team,

                  I need to text change event / drop down select index change event in a section wizard page. is there any possibility through section wizard page or any possibility(client/server side).Please help me how to do change events in a page.

Thank you.

 

Like 0

Like

3 comments

Dear Sekhar, please describe your business task

Peter Vdovukhin,

Same as https://www.zipcodeapi.com/Examples (enter zipcode then automatically populated state and city while text change event like example functionality)  functionality in the section wizard page.

 

 

  •  

 

Read this article to see how dependencies work

Show all comments

   

 Dear Team,

                   Here I can add multiple values using detail wizard.Detail wizard is redirect to another page but our requirement is detail wizard like popup in same section wizard page.is it possible (detail wizard as popup).Please demonstrate how to do this.

 

Thanks in advance,

Sekhar.

                       

       

 

 

 

 

Like 0

Like

1 comments

Dear Sekhar,

There is no such option to edit a detail using a pop-up window. Thought, you can make your detail with an editable list. In this case you will not be redirected to a new page every time you want to add or edit a record. You will be able to do so right in the detail on the page.

Please see the article on how to implement such functionality:

https://academy.bpmonline.com/documents/technic-sdk/7-12/adding-detail-editable-list

Regards,

Anastasia

Show all comments

Dear Team,

                  How to do text change event in section wizard page.Please can you demonstrate how to do.Our functionality is when enter the zipcode then i call web service then fill corresponding state and city. My functionality similar to https://www.zipcodeapi.com/Examples  

 

Thanks in Advance,

Sekhar.

 

 

Like 0

Like

1 comments

Hello!

You will not be able to achieve the following through the section wizard, but it looks like this task can be handled perfectly by the webservice indeed. Please find more information about how to execute it in the following articles:

https://academy.bpmonline.com/documents/studio/7-12/integration-web-services

https://academy.bpmonline.com/documents/technic-bpms/7-12/call-web-service-process-element

Best regards,

Matt

Show all comments

There are onInit and onRender methods available in client modules but neither of them runs after the page has rendered completely. Is there a method that is called after the DOM tree is ready?

Like 0

Like

14 comments

Unfortunately, there is no method that runs after everything on a page  is rendered. Please consider investigating the element that you need to use and find the way to process it after appearing.

Eugene Podkovka,

Ok, thanks for the info. Follow up question - is it fine to do something like in the code snippet below or do you think it's possible that afterRenderMethod will be called when DOM tree is not ready yet? Are parts of pages rendered after AJAX for example?

onRender: function() {
	this.callParent(arguments);
	setTimeout(afterRenderMethod);
}

 

Dear Carlos,

I would rather recommend using following events to listen for page load: DOMContentLoaded or load:

http://javascript.info/onload-ondomcontentloaded

Also,  as for your code snippet, you can achieve your goal in such way. Though, please keep in mind, that you trigger the function not based on the last element rendered, but approximate time of timeout function taken to fully render the page. Give it around 10 seconds for the timeout, so to make sure all elements have rendered.

Regards,

Anastasia

Anastasia Botezat,

Hi Anastasia,

Have the same problem here, can you show me how to use DOMContentLoaded or load in BPM client side code

Thanks

Dear Fulgen,



First of all, if your page is based on some entity, we highly recommend to use onEntityInitialized method

onEntityInitialized: function() {
    this.callParent(arguments);
    // some code
},

This method is guaranteed that not all the HTML is already loaded, but all the data is loaded to the inputs too.

In case your card is not based on the entity, and don't have onEntityInitialized method running, please use the http://javascript.info/onload-ondomcontentloaded approach provided, by writing this subscription in the init method. Something like that:

....methods block...
 
init: function() {
    this.callParent(arguments);
    document.addEventListener("DOMContentLoaded", this.htmlLoadedCallBackMethod);
},
 
htmlLoadedCallBackMethod: function() {
   alert("html loaded");
// some code here
}

Regards,

Anastasia

Dear Anastasia,

Curiously, i have tried to get "ServicePact" lookup value just calling a simple function doing : 



        methods: {

            onEntityInitialized: function() {

                this.callParent(arguments);

                this.getSlaExpertCenterId();

                document.addEventListener("DOMContentLoaded",         this.getSlaExpertCenterId());

            },

......

            getSlaExpertCenterId: function() {

                console.log(this.get("ServicePact"))

            }    

 

In each cases, console returns me "undefined"

But as you can see in picture below the input field is filled in...

 

Dear Maxime,

The reason you are getting undefined is that you haven't saved the record. In this case you have no record in the DB and SLA respectively.

Please add validation to check for empty SLA field and run your custom method in case you have SLA indicated.

If you would open already existing record, you would see the following in the browser console:

Regards,

Anastasia

Anastasia Botezat,

Ok, i still dont understand why the ServicePact is filled and we cant get is value.

Anastasia Botezat,

Hi Anastasia, I am facing the same issue, however, even when adding the listener to the init function, I am not getting my function to be called. Any thoughts?

 

Thanks.

Maxime.o,

In the example above in the screenshot I am retrieving ServicePact from already existing record. When you open a new record onEntityInitialized method runs, triggers getSLlaExpertCenterId, which tries to get ServicePact from non-existing record. The code you shared above works fine for existing records.

Danilo Lage,

It is hard to tell what exactly goes wrong without seeing the schema code itself. Please consider debugging step-bu-step your code using the developers console of your browser. There you can spot the call stack and determine where function goes wrong way.

If you will have difficulties, please share the full page code.

Anastasia Botezat,

 

 This function,

document.addEventListener("DOMContentLoaded", this.htmlLoadedCallBackMethod);

able to call from onEntityInitialized. When I am trying to call the same function in  "onRender function" (Activity Section Page) it's not been called.

How to call this function in the onRender function ?

Any ideas or thoughts over it.



Regards,

Adharsh S

Adharsh,

 

please specify your business task and also please tell us why you cannot use the base onRender or onEntityInitialized so to achieve it and need to use DOMContentLoaded additionally.

 

Thank you in advance!

 

Best regards,

Oscar

Oscar Dylan,

It appears the technique is to initialise a variable to a lookup value using an entity schema query during the 'onEntityInitialized' call and following that when the lookup value is changed 'this.get("LookupName")' returns an object with the 'Id' (the 'value' property) and 'Name' ('displayValue' property) values of the lookup.

 

For example, querying a Case object record for the initial Contact lookup value and the initial UstSubCategory lookup value:

            onEntityInitialized: function(){
                this.callParent(arguments);
                this.getSubCategoryAndContact();
            },
            getSubCategoryAndContact: function() {
				var esq = Ext.create("Terrasoft.EntitySchemaQuery", {
				    rootSchemaName: "Case"
				});
				esq.addColumn("UsrSubCategory");
				esq.addColumn("Contact");
                window.console.log("Case Id: " + this.get("Id"));
				esq.getEntity(this.get("Id"), function (result) {
				    if (result.success) {
				        this.set("PreviousSubCategory", result.entity.values.UsrSubCategory);
				        this.set("PreviousContact", result.entity.values.Contact);
						window.console.log("result.entity.values.UsrSubCategory: " + JSON.stringify(result.entity.values.UsrSubCategory));
						window.console.log("result.entity.values.Contact: " + JSON.stringify(result.entity.values.Contact));
					}
					else {
						throw new Error("System error, unable to read 'Case' data, function 'getSubCategoryAndContact'");
					}
				}, this);
            },

After this initial code has run when the page has loaded, when the value of a lookup changes, you can then retrieve the value with 'this.get("LookupName")', for example:

		attributes: {
			"FieldChange": {
    			dependencies: [{
      				columns: ["UsrSubCategory", "Contact"],
      				methodName: "onFieldChange"
    			}]
			}
			onFieldChange: function() {
				window.console.log("In function 'onFieldChange'.");
				const field = arguments[1];
				window.console.log("'field'. " + field);
				switch (field) {
					case "UsrSubCategory":
						window.console.log("'UsrSubCategory': " +  JSON.stringify(this.get("UsrSubCategory")));
						break;
					case "Contact":
						window.console.log("Contact: " + JSON.stringify(this.get("Contact")));
						break;
					default:
						throw new Error("System error, non valid value for 'field', function 'onFieldChange'.");
				}
			},

Ref. Triggering a Client-Side Event When a Field is Changed on a Page in Creatio (formerly bpm’online)

Show all comments

Hi everyone,

I need to call a sub-process from a C# script task, I found this code:

var showAdressProcessUId = new Guid("abfbf7ee-e499-45e9-9d22-b9e91a46683d");
var manager = UserConnection.ProcessSchemaManager;
var schema =  (ProcessSchema)manager.GetInstanceByUId(showAdressProcessUId);
var moduleProcess = schema.CreateProcess(UserConnection);
moduleProcess.SetPropertyValue("PageInstanceId", PageInstanceId);
moduleProcess.SetPropertyValue("ActiveTreeGridCurrentRowId", ActiveTreeGridCurrentRowId);
moduleProcess.SetPropertyValue("TreeGridSelectedRowsIds", TreeGridSelectedRowsIds);
moduleProcess.SetPropertyValue("SchemaName", "Contact");
moduleProcess.SetPropertyValue("RouteMode", false);
moduleProcess.Execute(UserConnection);

From ShowContactAddressOnMapProcess

If I use it for my process:

var _sendMailId = new Guid("84e96844-b0ae-4edc-8b5e-20d1ba13fb8b");
var _manager = UserConnection.ProcessSchemaManager;
var _schema = (ProcessSchema)_manager.GetInstanceByUId(_sendMailId);
var _moduleProcess = _schema.CreateProcess(UserConnection);
_moduleProcess.SetPropertyValue("Test1", "Something");
_moduleProcess.Execute(UserConnection);

Throws this exception :

Terrasoft.Common.InvalidObjectStateException: missing property "Test1" of type "ProcessComponentSet".

 

I would need to know how it works or another way to do it, I need to call a sub-process inside a for loop.



Thanks.

Like 0

Like

6 comments

Dear Ezequiel,

It is nor recommended to use sub-processes and the processes in general for such purpose. Technically you can call a business process from a business process. But if you correct the code above and execute it  the system will freeze and the processes will block each other. All users meanwhile will not be able to use the system properly.

Please adjust the business-purpose you want to achieve in order to avoid using business-processes or find another architecture solution.

Oliver

Hi, 

I see, I'm trying to send an email inside the loop, but I can't find in any of the existing process how to send an email with a template though a script task.

If someone knows how to do it or has an example, I would appreciate it if you could explain it or show it to me.

Thanks.

Dear Ezequiel,

There is "Send email" BP element you can use to reach your goal. Just select in a message input "Template message" and you will be able to choose what template to use.

 

 

Peter Vdovukhin,

Yes I know, but like I said I need to use it in a for loop, with that I could use it if I had the code to call a sub-process from a script task.

Dear Ezequiel,

As you wrote to bpm'online support, let's continue our conversation there. After resolving your task I will post an answer here.

Here is a simple example I have successfully tested:

A first business process contains only script task with such code:

for(int i = 0; i < 2; i++) {

    var _sendMailId = new Guid("cc1b3e27-4d11-4957-ac40-b22ff5b11aff");

    var _manager = UserConnection.ProcessSchemaManager;

    var _schema = (ProcessSchema)_manager.GetInstanceByUId(_sendMailId);

    var _moduleProcess = _schema.CreateProcess(UserConnection);

    _moduleProcess.SetPropertyValue("UsrTestParameter", "Letter number " + i);

    _moduleProcess.Execute(UserConnection);

}

A second business process with GUID = cc1b3e27-4d11-4957-ac40-b22ff5b11aff contains only Send email element that has a text parameter UsrTestParameter and use this parameter for email subject. The second business process HAS to be compiled to be called from the first business process.

Show all comments

How to select the multiple options in dropdown list in bpm online

Like 0

Like

6 comments

The main question is what you're going to do with the selected data. You will not be able to insert multiple values into a field on a page. A field is just a cell in a table. In order to process multiple values you need either write your own JS code or use a detail.

Anyway, you can open a multiple selection lookup page with the "LookupUtilities" module. There is an "OpenLookup" method there. Specify the "multiSelect" property and you'll be able to select multiple values. 

http://prntscr.com/k72fh6

Eugene Podkovka,

selected options in dropdown  are stored in database in bpm online tool

 

Eugene Podkovka

http://jsfiddle.net/pmrotule/w7aakdbb/

see the link same functionality i want to implement in bpm online and data is store in database.

Can you please guide me how to approach 

kishore,

The detail with the multiple selection would be the closest thing you can get:

https://academy.bpmonline.com/documents/technic-sdk/7-12/creating-detai…

You will be able to place a detail on a page and  select multiple enties.

Matt

Matt Watts,

my output not like that 

my output see below link

http://jsfiddle.net/pmrotule/w7aakdbb/

kishore,

Ok. Let's imagine that you have created the field and selected the following values:

http://prntscr.com/k7j47u

What will you do with them next?

Again. You will not be able to insert multiple values into a lookup field on a page because a lookup field on a page is a cell in a database. The connection is "one-to-one" and you need "one-to-many".

The only place that allow inserting multiple values related to a single record that called "one-to-many" - is a detail. Please consider using a detail functionality for that. 

Show all comments

Is it possible to put a button (or custom link) on the side bar, where sections are? If it's not possible with the current framework - do you think it would break something if such button was placed there using jQuery?

Like 0

Like

2 comments

Dear Carlos,

You may try add a usual custom section, put it at any workplace you want and then override init function in section module:

init: function() { window.location.href = "http://bpmonline.com"; }

After clicking on this section http://bpmonline.com page will be opened.

If everything works fine you can delete all unnecessary code created by Section Wizard leaving only the needed one to your section work properly.

You may add everything on the page using jquery but you should be careful with it. Of course you can break something if do it in a wrong way but it's related to any code that developers write.

Thank you very much, it worked.

Show all comments

When running an example.

We are getting errors like 

'Alert' not defined.

Please suggest.

Like 0

Like

4 comments

Hello,

There are various reasons for the error like that to appear.For us to be able to assist you with finding the root cause of it, specify the steps taken and attach the screenshot of the error message. 

Lisa

Lisa Brown,

venkata,

Hope you are doing great today!

I have picked a couple of articles that should help you: https://stackoverflow.com/questions/8173364/alert-is-not-defined-when-r…

https://stackoverflow.com/questions/8173364/alert-is-not-defined-when-r…

Have same errors on code saving. But code executes correctly.

Don't worry. Just save it and try to open your module directly with URL: http://[your server name]/0/Nui/ViewModule.aspx#ExampleStandartModule

Show all comments
Hi Sir/Madam,
I request you to please check, below validation code for data control(if age < 18, error message should be  displayed) I have added localized string given name(InvalidDOBFormat) and value(Incorrect) but error message is not displayed
    methods: {            

                this.addColumnValidator("UsrDateofbirth", this.dobValidator);            

     },
     dobValidator: function(value) {

                var invalidMessage = "";

                var isValid = true;

                var number = value || this.get("UsrDateofbirth");

                

                var nd = number.substr(0, 2);

                var nm = number.substr(3, 2);

                var ny = number.substr(6, 2);

                var cnumber = "";

                cnumber = nm + "-" + nd + "-" + ny;

                

                var today = new Date();

                var birthDate = new Date(cnumber);

                        

                //day

                var tdate = today.toString();

                var td = tdate.substr(8, 2);

                td = parseInt(td, td);

                var bd = number.substr(0, 2);

                bd = parseInt(bd, bd);

                var d = bd - td;

                        

                //year

                var age = today.getFullYear() - birthDate.getFullYear();

                

                //month

                var todayMonth = today.getMonth() + 1;

                var getMonthName =  birthDate.toString();

                var monthName = getMonthName.substr(4, 3);

                var bdmonthnumber;

                

                todayMonth = parseInt(todayMonth, todayMonth);

                

                if (monthName === "Jan") {

                    bdmonthnumber = 1;

                } else if (monthName === "Feb") {

                    bdmonthnumber = 2;

                } else if (monthName === "Mar") {

                    bdmonthnumber = 3;

                } else if (monthName === "Apr") {

                    bdmonthnumber = 4;

                } else if (monthName === "May") {

                    bdmonthnumber = 5;

                } else if (monthName === "Jun") {

                    bdmonthnumber = 6;

                } else if (monthName === "Jul") {

                    bdmonthnumber = 7;

                } else if (monthName === "Aug") {

                    bdmonthnumber = 8;

                } else if (monthName === "Sep") {

                    bdmonthnumber = 9;

                } else if (monthName === "Oct") {

                    bdmonthnumber = 10;

                } else if (monthName === "Nov") {

                    bdmonthnumber = 11;

                } else if (monthName === "Dec") {

                    bdmonthnumber = 12;

                }

        

                var m = todayMonth - bdmonthnumber;

                //console.log("m"+m);

                if ((age === 18) && (m === 0) && (d === 0)) {

                    isValid = true;

                } else if ((age === 18) && (m === 0) && (d < 0)) {

                    isValid = false;

                } else if ((age === 18) && (m === 0) && (d > 0)) {

                    isValid = true;

                } else if (age < 18) {

                    isValid = false;

                } else if (age > 18) {

                    isValid = true;

                }

                

                if (!isValid) {

                    invalidMessage = this.get("Resources.Strings.InvalidDOBFormat");

                }

                // Object which properties contain validation error messages.

                // If the validation is successful, empty strings are returned to the object.

                return {

                    invalidMessage: invalidMessage

                };

          }



Regards

Raghu Ram
Like 0

Like

3 comments

Dear Raghu,

In order for the functionality to start working, you need to either place an event listener, which will be listening for the column value change, or call the parent implementation of basic validator method. You can do that in two ways.

First approach is based on our basic functionality: addColumnValidator() method. I can see, that you have chosen this way, though, you need to call addColumnValidator inside the setValidationConfig method. This is due to the fact, that the parent implementation of the setValidationConfig() method must be called before calling the addColumnValidator() method to correctly initialize validators of the base page fields.

setValidationConfig: function() {
   // Calls the initialization of validators for the parent view model.
   this.callParent(arguments);
    // The dobValidator() validate method is added to the [UsrDateofbirth] column.
    this.addColumnValidator("UsrDateofbirth", this.dobValidator);
}

Second approach does not use basic validator functionality. You can write a validation method (like dobValidator()) and add change event listener to the onEntityInitialized function. In such way you indicate, that once the column value gets changed(inserted), the system will run the custom validator method. In the method block, please add the following:

onEntityInitialized: function() {
   this.callParent(arguments);
   //which [column] should trigger a validation [method]
   this.on("change:[column]", this.[method], this);
}

Regards,

Anastasia

Anastasia Botezat,

Hi Sir/Madam,

I have called addColumnValidator inside the setValidationConfig method still I'm not getting the error message

 

  methods: { 
 
        setValidationConfig: function() {                
                this.callParent(arguments);
                this.addColumnValidator("UsrDOB", this.dobValidator);                
        },   
 
        dobValidator: function(value) {
                var invalidMessage = "";
                var isValid = true;
                var number = value || this.get("UsrDateofbirth");
 
                var nd = number.substr(0, 2);
                var nm = number.substr(3, 2);
                var ny = number.substr(6, 2);
                var cnumber = "";
                cnumber = nm + "-" + nd + "-" + ny;
 
                var today = new Date();
                var birthDate = new Date(cnumber);
 
                //day
                var tdate = today.toString();
                var td = tdate.substr(8, 2);
                td = parseInt(td, td);
                var bd = number.substr(0, 2);
                bd = parseInt(bd, bd);
                var d = bd - td;
 
                //year
                var age = today.getFullYear() - birthDate.getFullYear();
 
                //month
                var todayMonth = today.getMonth() + 1;
                var getMonthName =  birthDate.toString();
                var monthName = getMonthName.substr(4, 3);
                var bdmonthnumber;
 
                todayMonth = parseInt(todayMonth, todayMonth);
 
                if (monthName === "Jan") {
                    bdmonthnumber = 1;
                } else if (monthName === "Feb") {
                    bdmonthnumber = 2;
                } else if (monthName === "Mar") {
                    bdmonthnumber = 3;
                } else if (monthName === "Apr") {
                    bdmonthnumber = 4;
                } else if (monthName === "May") {
                    bdmonthnumber = 5;
                } else if (monthName === "Jun") {
                    bdmonthnumber = 6;
                } else if (monthName === "Jul") {
                    bdmonthnumber = 7;
                } else if (monthName === "Aug") {
                    bdmonthnumber = 8;
                } else if (monthName === "Sep") {
                    bdmonthnumber = 9;
                } else if (monthName === "Oct") {
                    bdmonthnumber = 10;
                } else if (monthName === "Nov") {
                    bdmonthnumber = 11;
                } else if (monthName === "Dec") {
                    bdmonthnumber = 12;
                }
 
                var m = todayMonth - bdmonthnumber;
                //console.log("m"+m);
                if ((age === 18) &amp;&amp; (m === 0) &amp;&amp; (d === 0)) {
                    isValid = true;
                } else if ((age === 18) &amp;&amp; (m === 0) &amp;&amp; (d &lt; 0)) {
                    isValid = false;
                } else if ((age === 18) &amp;&amp; (m === 0) &amp;&amp; (d &gt; 0)) {
                    isValid = true;
                } else if (age &lt; 18) {
                    isValid = false;
                } else if (age &gt; 18) {
                    isValid = true;
                }
 
                if (!isValid) {
                    invalidMessage = this.get("Resources.Strings.InvalidDOBFormat");
                }
                // Object which properties contain validation error messages.
                // If the validation is successful, empty strings are returned to the object.
                return {
                    invalidMessage: invalidMessage
                };
        }
}

Regards

Raghu Ram

Dear Raghu,

The error message does not appear, because of the errors in the validation function. Please consider rewriting the birthDay variable, since it passes date to new Date() method in a wrong format.

Sincerely,

Anastasia Botezat

Show all comments