Hi,

 

After login, show popup welcome message, it should be auto disappear after 10 seconds.

How to achieve this ?

 

Any help will be highly appreciable

 

Regards

Like 0

Like

1 comments

It's possible to implement the functionality by creating the replacing client module for "BaseIntroPageSchema" schema. Override the init method in the schema in order to show welcome message after login. Every time the IntroPage is loaded the message is shown. In order to show the message only after login please create the replacing object for "Contact" and add column that will save information about was message shown or not. Every time the user is logged in or logged out the column value should be changed.Please use client EntitySchemaQuery to check the column value and change it  when the message was shown.To change the column value when the user is logged out you can create a trigger on an update statement to the SysAdminUnit table the LoggedIn column.

Here is the example below:

define("BaseIntroPageSchema", ["BaseIntroPageSchemaResources", "MainMenuTileGenerator", "AcademyUtilities"],

    function(resources, MainMenuTileGenerator) {

        return {

            attributes: {},

        

            methods: {

                /**

                 * @inheritdoc Terrasoft.BasePageV2#onRender

                 * @override

                 */

                onRender: function() {

                    this.callParent(arguments);

                    

                },

                

                closeDialog: function(){

                    $(".t-btn-wrapper.t-btn-text.t-btn-style-blue").click();

                },

                /**

                 * @inheritdoc Terrasoft.BasePageV2#init

                 * @override

                 */

                init: function() {

                   

                    this.callParent(arguments);

                    this.showWelcomeMessage();

                },

                showWelcomeMessage: function(){

                    

                    let currentUserId = this.Terrasoft.SysValue.CURRENT_USER_CONTACT.value;

                    var esq = this.Ext.create("Terrasoft.EntitySchemaQuery", {

                        rootSchemaName: "Contact"

                    });

                    // Add column with name of main contact of accounts that refers to given contact.

                    esq.addColumn("UsrShowWelcomeMessage");

                

                    // Get one record from selection on the basis of [Id] of card object and display it 

                    // in an info window.

                    esq.getEntity(currentUserId, function(result) {

                        if (!result.success) {

                            // error processing/logging, for example

                            this.showInformationDialog("Data query error");

                            return;

                        }

                        if(!result.entity.get("UsrShowWelcomeMessage")){

                             this.showInformationDialog("Hello!");

                             setTimeout(this.closeDialog, 10000);

                             this.updateRecord(currentUserId);

                        }

                    }, this);

                  },

                  

                  updateRecord: function(contactId){

                      var update = Ext.create("Terrasoft.UpdateQuery", {

                        rootSchemaName: "Contact"

                    });

                     

                    update.filters.add("IdFilter", update.createColumnFilterWithParameter(

                        Terrasoft.ComparisonType.EQUAL, "Id", contactId));

                     

                    update.setParameterValue("UsrShowWelcomeMessage", 1, Terrasoft.DataValueType.BOOLEAN);

                    update.execute(function() {

                        // do any needed refreshing here etc

                    }, this);

                }

                

            },

            diff: []

        };

    });

 

Show all comments

Greetings,



I am trying to change the default value of the dropdown in a lookup minipage.

https://prnt.sc/q0igzs





Example: Whenever I open the Owner lookup, it defaults to "Full name" but I want to change it to Account.



Is there a way to change the default value?



Before: https://prnt.sc/q0iq0e



After: https://prnt.sc/q0iqgy



Thank you in advance.

Like 0

Like

1 comments

Dear Yosef,

Yes, it is possible to do either via hard additional development or by changing "Displayed value" in object advanced settings for the object that is represented by the lookup http://prntscr.com/q50jbe. Please note that it is not preferred option since this value will be changed everywhere in the system where lookups based on "Contact" object are used.

Please also note that account field cannot be selected there since account is another lookup, but the system allows using only "String" data type fields when specifying "Displayed value", but you can add your custom hidden field and create a process that will fill this field in with the value of an account that is chosen for the contact specified.

Best regards,

Norton

Show all comments

we need to customize the modal box shown when we need to select for example Account lookup, by adding fixed filters on the top then the search button gets Accounts based on this filter.

Also can we hide the New Button here ?

will this customization affect other lookup selection modal box? 

if this is not applicable is there any other approach ? 

 

Like 0

Like

6 comments

Dear Ayman,

You can add a fixed filter to the lookup page, however, this requires development skills. Please see this article with instructions: 

https://academy.bpmonline.com/documents/technic-sdk/7-13/adding-quick-filter-block-section

The schema you would need to modify is LookupPageViewGenerator. Please note, that applied changes would be displayed for all sections and each place where you use lookup page.

In order to remove New button, you need to override the getSelectionControlsConfig and getEditionControlsConfig methods on LookupPageViewGenerator schema and remove add button from there.

As an alternative approach, you can apply business rule on the field and in this case lookup would be automatically filtered. 

Regards,

Anastasia

Hi Anastasia,

I can't create "replacing client module" with parent is LookupPageViewGenerator. How can I "modify" it as you said? I found lookup Brand and Category in ProductPageV2 which hide button "New" when open its lookup modal. How can I see their source code?

Thanks

Anastasia Botezat,

Please help

Toan Mai,

Hello!



If you want to hide 'NEW' button you can simply add  "hideActions": true to your lookuplistconfig property of the attribute correspondent to lookup field.



Please see snippet below:

define("OrderPageV2", [], function() {
	return {
		entitySchemaName: "Order",
		attributes: {
			"Opportunity": {
				"lookupListConfig": {
					"hideActions": true
				}
			}
		},
		modules: /**SCHEMA_MODULES*/{}/**SCHEMA_MODULES*/,
		details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,
		businessRules: /**SCHEMA_BUSINESS_RULES*/{}/**SCHEMA_BUSINESS_RULES*/,
		methods: {},
		dataModels: /**SCHEMA_DATA_MODELS*/{}/**SCHEMA_DATA_MODELS*/,
		diff: /**SCHEMA_DIFF*/[]/**SCHEMA_DIFF*/
	};
});



It will however also hide actions drop down, but this drop down is also connected to crud operations within lookup field.



See result here:

https://prnt.sc/px04je

 

 

Dmytro Smishchenko,

This solution seems to work on lookup object in Order section. How can we implement the same on the Detail ?

hi ayman ,  can you send me code for this model box

Show all comments

I have problems with this Custom Lookup. I want to manage it through the pop-out window.

I have chenged the Access rights to match what I want. But the so called default page is not reacting to this at all. Do I need a custom page for New, Edit and Copy actions of the Lookup values?

How do I create a custom Lookup page? And do the New, Edit, Copy buttons require a custom lookup page?

I am having problems finding out how to do it. Even though I have done this before, I have forgotten.

I can't even find what I need in the academy. What I can't find does not seem to be enough https://academy.bpmonline.com/documents/administration/7-13/lookup-prop…

Lookup properties:

 

Like 0

Like

1 comments

Dear Julius,

The actions Edit, Copy, Delete are avaliable for those lookups, which are based on object with edit page. Therefore, in order to have such actions you need to create an edit page for your object.

In order to do so you need:

1. Create a new Schema of the Edit page View model

2. Indicate entitySchemaName property to the object of the lookup and create an edit page, you can take any other edit page as an example

3. Register your edit page in the SysModuleEdit table, where you indicate object - page relationship.

After this you will have the actions for the lookup. Another option to do so is to register a section for your custom object on which lookup is based. In this case edit page will be created automatically in the course of creating a section.

Regards,

Anastasia

Show all comments

Hi Community!

How are you?

I hope you can help me!

When I mouse over the name of a custom entity,

I want it to open a popup similar to the one opened when I mouse over the name of a contact.

 

I want to show information of several fields in that popup

How could I do it?

King Regards,

 

Ezequiel

 

 

Like 0

Like

2 comments

Dear Ezequiel,

This functionality is implemented via mini cards. Please follow this link tot check what it is used for: https://academy.bpmonline.com/documents/technic-sdk/7-12/mini-page

If you want to add it to your custom section, please check the articles in our development guide: https://academy.bpmonline.com/documents/technic-sdk/7-12/how-create-mini-page

Best regards,

Lily

Dear Lily!

Thanks for you response!

It was very helpful

Regards,

Ezequiel!

Show all comments
Question

Hello dears, 

I need show a popup to get a value when the action start. 

Can help me with that?

Regards, 

Like 0

Like

2 comments

Yeah, I would like to know that too!

If you're asking about calling a popup from a business process, then there is no such a functionality in the out-of-the-box system.

It's possible to create such a functionality with code. This is the way on how to call a page method from a business process.

The code in the process

 

//Usings
 
using Terrasoft.Configuration;
using Terrasoft.Messaging.Common;
using Newtonsoft.Json;
 
//Code
 
public void SendMessage() {
    string senderName = "TestPopup";
    string message = JsonConvert.SerializeObject(new {
        RecordId = Guid.NewGuid(),
        Name = "Some name"
    });
     
    // For all users
    //MsgChannelUtilities.PostMessageToAll(senderName, message);
     
    // For current user
    var userConnection = Get<UserConnection>("UserConnection");
    MsgChannelUtilities.PostMessage(userConnection, senderName, message);
     
    // For specific user with sysAdminUnitId
    /*IMsgChannel channel = MsgChannelManager.Instance.FindItemByUId(sysAdminUnitId);
    if (channel != null) {
        var simpleMessage = new SimpleMessage() {
            Id = sysAdminUnitId,
            Body = message,
            Header = {
                Sender = senderName
            }
        };
        channel.PostMessage(simpleMessage);
    }*/
}

Frontend

define("CommunicationPanel", ["terrasoft", "LookupUtilities"],
	function(Terrasoft, LookupUtilities) {
		return {
			messages: {
				"CardProccessModuleInfo": { "direction": "subscribe", "mode": "ptp" },
				"GetHistoryState": { "direction": "publish", "mode": "ptp" }
			},
			attributes: {},
			methods: {
				init: function() {
					this.callParent(arguments);
					Terrasoft.ServerChannel.on(Terrasoft.EventName.ON_MESSAGE, this.onMessageReceived, this);
				},
				//probably onMessage
				onMessageReceived: function(sender, message) {
					if (message && message.Header && message.Header.Sender === "TestPopup") {
						//var result = this.Ext.decode(message.Body);
 
						var contactFilters = Terrasoft.createFilterGroup();
						var config = {
							entitySchemaName: "Contact",
							mode: "processMode",
							captionLookup: "Contact lookup",
							multiSelect: false,
							columnName: "Name",
							filters: contactFilters,
							commandLineEnabled: true
						};
						var handler = this.handler;
						LookupUtilities.OpenLookupPage(this.sandbox, {config: config, handler: handler}, this, null, false);
					}
				},
				handler: function() {
					//run process here
					/*
					ProcessModuleUtilities.executeProcess({
						sysProcessName: processName
					});*/
				},
				destroy: function() {
					this.Terrasoft.ServerChannel.un(Terrasoft.EventName.ON_MESSAGE, this.onMessage, this);
					this.callParent(arguments);
				}
			},
			diff: []
		};
	});

Please note that you'll need to modify the OpenLookupPage method and draw a lookup frame manually.

Show all comments