📚 SAP Business One SDK Help

UpdatePredefinedText Method
See Also  Example
pIPredefinedText
The data for the predefined text to be updated. The PredefinedText object must contain the key of the object to be updated.

Description

Updates an existing predefined text.

The data for the predefined text, including the key of the predefined text to be updated, is contained in the PredefinedText passed to the method. To update a predefined text, you must first retrieve it using the GetPredefinedText method.

Syntax

Visual Basic
Public Sub UpdatePredefinedText( _
   ByVal pIPredefinedText As PredefinedText _
) 

Parameters

pIPredefinedText
The data for the predefined text to be updated. The PredefinedText object must contain the key of the object to be updated.

Example

Updating a predefined text (C#)Copy Code
// Get predefined text service 
PredefinedTextsService textService; 
companyService = company.GetCompanyService(); 
textService = (PredefinedTextsService)companyService.GetBusinessService(ServiceTypes.PredefinedTextsService); 
 
PredefinedText text = textService.GetDataInterface(PredefinedTextsServiceDataInterfaces.ptsPredefinedText) as PredefinedText; 
PredefinedTextParams textParams = textService.GetDataInterface(PredefinedTextsServiceDataInterfaces.ptsPredefinedTextParams) as PredefinedTextParams; 
 
// Get the predefined text to update 
textParams.Numerator = 2; 
PredefinedText text = textService.GetPredefinedText(textParams); 
 
// Update text 
text.Text = "new Text";           
textService.UpdatePredefinedText(text); 

See Also