on 01-14-2015 3:10 PM
Hi all,
for a customer project we need to create custom alerts at a specific time (filled in in a custom field).
Is there any possibility (APIs) to create alerts in CLM and in the Contract calendar?
If this doesn't work we will try to create a schedule item out of a script which will have the custom field value as start date.
Is there any possibility (APIs) to create Schedule items (in Master agreements) out of a script?
Thanks and regards,
Özlem
Hi Ozlem,
As far as I got your requirement, I can suggest you to use Custom mail template for sending the custom mail notifications in Explicit script which can be scheduled depending upon the requirement.
You can use NotificationUtil Class for sending the custom mails.
example for your reference:
import com.sap.odp.api.comp.messaging.MailTypeEnumType;
import com.sap.odp.api.util.NotificationUtil;
sender= IapiAccountLocator.lookup(session, session.getAccount().getAccountObjectReference());
recipient = IapiAccountLocator.lookup(session, doc.getDocumentOwnerUserReference());
String[] recipients = {"xyz@abc.com"};
sender=IapiAccountLocator.lookup(session,doc.getDocumentOwnerUserReference());
mailTypeEnum = new MailTypeEnumType(MailTypeEnumType.ODP_CUSTOM_TEMPLATE1);
Properties props= new Properties();
recepientname= doc.getDocumentOwnerUserReference().getDisplayName();
documentId= doc.getDocumentId();
supplierName= doc.getVendorRef().getDisplayName();
documentDescription=doc.getDocumentDescription();
props.put(new String("DOCUMENT_ID"), documentId);
props.put(new String("DOCUMENT_DESCRIPTION"), documentDescription);
//similarly you can use other tokens in order to set value and send in an email.
NotificationUtil.sendNotification(recipients, sender, mailTypeEnum,props, null, null);
//Below method is being used:
//sendNotification(java.lang.String[] recipients, IapiAccountIfc sender, MailTypeEnum notificationType, java.util.Properties notificationParameters, java.lang.String attachmentDisplayName, java.io.InputStream attachment)
Hope it helps.
Regards,
Kushagra A
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kushagra,
thank you for your response.
As far as I understood this code is to send notifications in the form of mails.
What we are searching for is custom alert which is shown bolt in the contract calendar and in the alert widget.
Correct me if I am wrong and if this can also be realized with the mail send option.
Thanks and regards,
Özlem
HI Ozlem,
Apologies, I thought you want to send mail alerts to the users. I dont think there is any IAPI exposed for creating such custom alerts as shown in the image. As a workaround you can create a workbench channel and add your report their or you can also add your report in the same Alert workbench channel depending on your requirement.
Hope it helps.
Regards,
Kushagra A
Hi Ozlem,
I would advice you to explore Class 1016(Agreement Schedule Item).
You can find the methods in this class.
You can write a script on class 1016 Target Created if you want to set some fields, depending on your requirement. I am not sure of your requirement but this class have the methods which you are looking for.
Let me know if you need any query.
Hope it helps!
Best,
Kushagra
Hi Kushagra,
thank you for your answer. That was the class which we needed!
The script looks like this
import com.sap.odp.api.doccommon.doc.SchedItemEventTypeEnumType;
colln = doc.getSchedItems();
date = doc.getExtensionField("Z_TEST_DATE").get();
if(!hasValue(date)){
return;
}
// Create ContractSchedItemIBeanImpl Object
newMember = colln.create();
// Set parameters
newMember.setDisplayName("Alert date reached");
newMember.setPublishToCalendar(true);
newMember.setFixedStart(date);
// 0 = TASK | 1 = MILESTONE
newMember.setEventType(new SchedItemEventTypeEnumType(0));
// Add Object to Collection
colln.add(newMember);
Regards,
Özlem
User | Count |
---|---|
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.