TVC - Trigger message creation

TVC - Trigger message creation

Description:

User may want to add a trigger message which is executed in check event. In this article we will discuss about how to create simple trigger warning. Let’s take an example that whenever user promotes any Part object, there should be an error shown in the interface.

 

Steps to follow:

  1. First create a trigger with warning message using MQL (replace policy and state according to environment):

add prog warningTest code "warning This_is_a_Warning_Message;"; modify policy "EC Part" state Preliminary add trigger promote check warningTest;

In case you get following error in MQL, it means policy name is incorrect

Error: #1900068: modify policy failed
System Error: #1500178: state requirement 'created' does not exist

 

To figure out correct state name, run below command (change according to part type/ name/revision)

print bus "Electrical Part" Electra-001 A select history;

You will see output like below where you can find out the state name

history = modify - user: admin_platform time: 11/28/2022 3:55:11 PM state: Preliminary

 

  1. Now if user promotes the object from UI (Using OOTB Lifecycle or TVC Structure Browser pageconfig), the trigger will be executed and error message will be shown

Using OOTB Lifecycle:

image-20240308-132725.png

Using TVC Structure Browser:

image-20240308-133154.png

 

TECHNIA CONFIDENTIAL