Page 1 of 1

TM1 perspective to send mails automatically

Posted: Thu Jul 19, 2018 8:48 am
by Marwa
Hey everyone,

First of all , sorry for my english level it's not my primary language :)

Here is my question: I have created an application in TM1 for ticketing (for my internship) ! I have created a cube with 4 dimensions : Tickets, year, month and TicketInformation ! Tickets are activeforms that opened with tm1 web and that uses Action button which lanches a process that stock information in my Cube.

Now I want to do something such as sending an automatic mail to a group of users everytime a specific data in the cube is changed ! They ask me to do that, I searched a lot but didn't find anything ! Should it be a process with a button action ? or should it be something else? is there any existing script for this ? I really have no idea from where I could start.

Thank you in advance :))))

Re: TM1 perspective to send mails automatically

Posted: Thu Jul 19, 2018 12:01 pm
by Elessar
Hello,

TM1 itself cannot send e-mails. You need to launch a TI-process launching a PS script sending the e-mail

This was discussed here:
http://www.tm1forum.com/viewtopic.php?t=11815
http://www.tm1forum.com/viewtopic.php?t=12453

Re: TM1 perspective to send mails automatically

Posted: Thu Jul 19, 2018 12:58 pm
by tomok
Marwa wrote: Thu Jul 19, 2018 8:48 am Now I want to do something such as sending an automatic mail to a group of users everytime a specific data in the cube is changed ! :))))
You can send emails via a TI process as has been mentioned but here is the rub, how are you going to know when the specific data you are referring to is changed? There is no event monitoring available to you that can trigger something when data is changed so you would have no idea when a user has changed the value in a specific cell in a specific cube. If you are the one changing the data AND you are performing the change by running a TI process you could branch off and send an email but if you are just entering data in a cube view or web sheet then you won't be able to send an automated email. You would have to manually kick off a TI process after you manually entered the data.

Re: TM1 perspective to send mails automatically

Posted: Thu Jul 19, 2018 6:00 pm
by Wim Gielis
tomok wrote: Thu Jul 19, 2018 12:58 pmThere is no event monitoring available to you that can trigger something when data is changed so you would have no idea when a user has changed the value in a specific cell in a specific cube.
True but Excel has event monitoring like changing a certain cell or range. If you translate the cell change in Excel to the cell in the cube, I think it is not impossible. However, as I now notice, TM1 hooks up onto Excel events, so maybe that's a factor to take into account.

You use Perspectives and hence macro’s, so events are possible. In the past I created a double click event in VBA to add new lines in an input sheet (and other related stuff).

Re: TM1 perspective to send mails automatically

Posted: Mon Jul 23, 2018 4:04 am
by vino1493
Marwa,

As you mentioned that "Action button which lanches a process that stock information in my Cube", I assume you are asked to send emails whenever the Action button gets clicked. In that case, you can update that TI process being called by the action button. I hope you have some good understanding on TI processes. If the load complet
Go the prolog section of the TI process and paste the below code

Code: Select all

	
#Initiate all the required variables
	sPsCmd = '"& {
	Send-MailMessage 
	-From ' | pFrom | ' 
	-To ' | pTo | ' 
	-cc ' | pCC | ' 
	-Subject ' | '\"' | pSubject | '\"
	-Body ' | '\"' | pBody | '\"
	-BodyAsHtml 
	-SmtpServer ' | pSmtpServer | ' 
	}"';

# Calling the PowerShell command to send email
ExecuteCommand ( 'powershell.exe -command ' | sPsCmd, 1 );

You need to know the "SMTP server" for sending ( it is mandatory). Talk to your admin team to get this. Provide the values of 'pFrom', 'pTo', etc., before pasting the above code.