Friday, 17 April 2020

Creating a Attachment Record in Siebel

Hello All,

Recently i had a requirement wherein ,
  •  I had to Create Generate a BIP report
  •  Attach BIP on a Particular Order
  •  Send the Attached BIP to external System

Taking the 2nd part, Attaching BIP to a Order, or Simply Creating a attachment record in Order.

This can be achieved very Easily with ,

Business Service Name: FINS Industry BC Facility Service
Busienss Service Method: CreateFile

but, FINS Industry BC Facility Service can create attachments and attach in Related attachment BC but user has to be in current context of Application i.e. The process need to be initiated from Siebel application by user.
For any process that is called via a web service this BS won't work

So to create attachment, we have to use CreateFile method of the corresponding Attachment BC.
Below code can be used,


var OrderBO = TheApplication().GetBusObject("Order Entry"); 
var OrderAttachBC = OrderBO.GetBusComp("Order Entry Attachment"); 
var AttachmentName = "Attachment";//Name of Attachment 
var OrderId = Inputs.GetProperty("RecordId"); //RowId of Order 
var sAbsoluteFileName = Inputs.GetProperty("FilePath");//Path of file that will be added as attachment 

 with(OrderAttachBC) 
{
NewRecord(NewAfter); SetFieldValue("OrderFileName", AttachmentName ); 
SetFieldValue("Order Id",OrderId); SetFieldValue("OrderFileDeferFlg", "R"); SetFieldValue("OrderFileDockReqFlg", "N"); 
SetFieldValue("OrderFileDockStatFlg", "E"); 
SetFieldValue("OrderFileSrcType", "FILE"); 
SetFieldValue("OrderFileExt", "PDF"); 

var sGetFileReturn = InvokeMethod("CreateFile", sAbsoluteFileName, "OrderFileName", "Y"); WriteRecord(); 
}

Hope this was helpful.

No comments:

Post a Comment

Siebel GoTo View - Handling Realtime cases

 Hello All,  We all must have used GoTo view functionality of siebel to navigate to a particular view from current view. What if the require...