Partager via


IContentList::SetScore Method

Use this method to set a new score for an item in a ContentList object.

HRESULT IContentList::SetScore(
  long RowNum,
  float Score,
  BSTR Component,
  BSTR Description
);
Sub SetScore(
    RowNum As Long,
    Score As Float,
    Component As String,
    Description As String
)

Parameters

  • RowNum
    [C++]

    [in] A long that contains the position of the item in the ContentList object for which a new score will be set. Positions are counted from zero (0), not from one (1).

    [Visual Basic]

    A Long that contains the position of the item in the ContentList object for which a new score will be set. Positions are counted from zero (0), not from one (1).

  • Score
    [C++]

    [in] A float that contains the new score.

    [Visual Basic]

    A Float that contains the new score.

  • Component
    [C++]

    [in,optional] A BSTR that is intended to contain the name of the pipeline component that is setting the new score. This parameter is optional and is used for score tracing.

    [Visual Basic]

    A String that is intended to contain the name of the pipeline component that is setting the new score. This parameter is optional and is used for score tracing.

  • Description
    [C++]

    [in,optional] A BSTR that is intended to contain the reason that the score is being set; for example, Need of Delivery. This parameter is optional and is used for score tracing.

    [Visual Basic]

    A String that is intended to contain the reason that the score is being set; for example, Need of Delivery. This parameter is optional and is used for score tracing.

Return Value

[C++]

This method returns an HRESULT indicating whether it completed successfully. See the Error Values section for more details.

[Visual Basic]

None.

Error Values

[C++]

This method returns S_OK (0x00000000) to indicate success and standard COM HRESULT error values to indicate failure. For more information about standard COM errors, see Standard COM Errors. Additional information may be available using the global Err object, which can be accessed using the API function GetErrorInfo. In particular, the GetDescription method of the IErrorInfo interface may return a text description of the error.

[Visual Basic]

This method sets the Number property of the global Err object to S_OK (&H00000000) to indicate success and to standard COM error values to indicate failure. For more information about standard COM errors, see Standard COM Errors. Additional information may be available using the global Err object. In particular, the Description property may contain a text description of the error.

Remarks

The Component and Description parameters are optional.

This method assumes that the ContentList object has a column of type CLCOL_R4 with the CLCOL_SCORE_COLUMN flag set.

For the sake of uniformity, pipeline components provided with Commerce Server pass the Programmatic Identifier (ProgID) of the component for the Component parameter.

Example

'strProgID is a string.
myContentList.SetScore(123456, 0.5, strProgID, "")

See Also

Other Resources

ContentList Object