on 08-12-2018 7:14 PM
Hi Expert ,
I had previously done alert message add in sap b1 using DI API. Now i want to add same using Service Layer. Please give me any reference .below is my di api code:
CompanyService oCompServ = oCompany.GetCompanyService();
MessagesService oMsgServ = (MessagesService)oCompServ.GetBusinessService(ServiceTypes.MessagesService); Message oMsg = (Message)oMsgServ.GetDataInterface (MessagesServiceDataInterfaces.msdiMessage);
oMsg.Subject = "New Web Order Placed";
oMsg.Text = "Order Details. With DocEntry:....;
RecipientCollection oRcptColl = oMsg.RecipientCollection; oRcptColl.Add(); oRcptColl.Item(0).SendInternal = SAPbobsCOM.BoYesNoEnum.tYES; oRcptColl.Item(0).UserCode = "manager"; SAPbobsCOM.MessageDataColumns oMsgDataCols = oMsg.MessageDataColumns; SAPbobsCOM.MessageDataColumn oMsgDataCol = oMsgDataCols.Add(); oMsgDataCol.ColumnName = "Order No"; SAPbobsCOM.MessageDataLines oLines = oMsgDataCol.MessageDataLines; SAPbobsCOM.MessageDataLine oLine = oLines.Add(); oLine.Object = "17"; oLine.ObjectKey = "DocEntry"; oLine.Value = sboOrderNo; oMsg.Priority = SAPbobsCOM.BoMsgPriorities.pr_High;
oMsgServ.SendMessage(oMsg);
Thanks
Surajit Kundu
Hi Surojit,
You can find SL documentation at https://<ServerAddress>:50000
If you go to API reference you can find there the following:
POST https://localhost:50000/b1s/v1/Messages
{
"MessageDataColumns": [
{
"ColumnName": "Document",
"Link": "tYES",
"MessageDataLines": [
{
"Object": "17",
"ObjectKey": "2",
"Value": "1"
}
]
}
],
"RecipientCollection": [
{
"SendInternal": "tYES",
"UserCode": "andy"
}
],
"Subject": "service layer subject 01",
"Text": "test by service layer"
}
Probably this is what you are looking for.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sergei,
Thanks for your answer .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.