Please login or register.

Login with username, password and session length
Advanced search  

News:

Author Topic: A little help for script debugging  (Read 682 times)

zvajda

  • Newbie
  • *
  • Posts: 8
    • View Profile
A little help for script debugging
« on: November 25, 2012, 07:46:25 am »

Hi there,

I am very new at scripting and I tried a little customization, I've made a little script for calculating a name property based on a value from another property, basically if the Category property is "Furnizor" ( supplyer ) then it concatenates the name one way using calculated value VB Script, else it concatenates other way ( one of the properties used for concatenating is changing ).

This is the script:
Code: [Select]
Option Explicit

'Get values
Const kI_PROPDEF = 1035 ' CATEGORIE

Dim szCurrentValue
  szCurrentValue = PropertyValues.SearchForProperty(kI_PROPDEF).TypedValue.DisplayValue

Dim szVariableF
szVariableF = PropertyValues.SearchForProperty( 1161 ).TypedValue.Value
Dim szVariableC
szVariableC = PropertyValues.SearchForProperty( 1160 ).TypedValue.Value
Dim szVariableT
szVariableT = PropertyValues.SearchForProperty( 1146 ).TypedValue.Value
Dim szVariableD
szVariableD = PropertyValues.SearchForProperty( 1048 ).TypedValue.Value

'Concatenates Name property
Dim szName
If szCurrentValue = "Furnizor" Then
   szName = szVariableT & szVariableF & "/" & szVariableD
Else
   szName = szVariableT & szVariableC & "/" & szVariableD
End If
Output = szName   

This is the error:
Code: [Select]
MPropertyPage2.cpp, 102, Creating a new object failed. (0x80040419)
MPropertySheet2.cpp, 143, Creating a new object failed. (0x80040419)
PropertySheetObject.cpp, 3252, Creating a new object failed. (0x80040419)
PropertySheetObject.cpp, 3252, Calculation of the automatic value of the property 'Nume corespondenta comerciala' failed. (0x80040107)
PropertySheetObject.cpp, 3559, Calculation of the automatic value of the property 'Nume corespondenta comerciala' failed. (0x80040107)
CoVaultMountingDocumentOperations.cpp, 214, Calculation of the automatic value of the property 'Nume corespondenta comerciala' failed. (0x80040107)
CoVaultMountingDocumentOperations.cpp, 324, Calculation of the automatic value of the property 'Nume corespondenta comerciala' failed. (0x80040107)
DocumentCache.cpp, 4702, Calculation of the automatic value of the property 'Nume corespondenta comerciala' failed. (0x80040107)
DocumentCache.cpp, 4769, Calculation of the automatic value of the property 'Nume corespondenta comerciala' failed. (0x80040107)
DocumentCache.cpp, 4912, Calculation of the automatic value of the property 'Nume corespondenta comerciala' failed. (0x80040107)
RPCDocumentOperations.cpp, 117, Calculation of the automatic value of the property 'Nume corespondenta comerciala' failed. (0x80040107)
RPCDocumentOperationsHelper.cpp, 1696, Calculation of the automatic value of the property 'Nume corespondenta comerciala' failed. (0x80040107)
RPCDocumentOperationsHelper.cpp, 1822, Calculation of the automatic value of the property 'Nume corespondenta comerciala' failed. (0x80040107)
RPCDocumentOperationsHelper.cpp, 27150, Calculation of the automatic value of the property 'Nume corespondenta comerciala' failed. (0x80040107)
RecalculateProperties.cpp, 481, Calculation of the automatic value of the property 'Nume corespondenta comerciala' failed. (0x80040107)
RecalculateProperties.cpp, 481, Script execution failed. ((205-1)) (0x800408BB)
RecalculateProperties.cpp, 1364, Script execution failed. ((205-1)) (0x800408BB)
RecalculateProperties.cpp, 1218, Script execution failed. ((205-1)) (0x800408BB)
RecalculateProperties.cpp, 1430, Script execution failed. ((205-1)) (0x800408BB)
RecalculateProperties.cpp, 1170, Script execution failed. ((205-1)) (0x800408BB)
VaultScriptSessionTemplates.cpp, 258, Script execution failed. ((205-1)) (0x800408BB)
VaultScriptSessionTemplates.cpp, 258, Type mismatch
Source: Microsoft VBScript runtime error
Line: 23
Error: 0x800a000d (0x800A000D)
VaultScriptSessionTemplates.cpp, 355, Type mismatch
Source: Microsoft VBScript runtime error
Line: 23
Error: 0x800a000d (0x800A000D)
CoActiveScriptSite.cpp, 805, Type mismatch
Source: Microsoft VBScript runtime error
Line: 23
Error: 0x800a000d (0x800A000D)
CoActiveScriptSite.cpp, 649, Type mismatch
Source: Microsoft VBScript runtime error
Line: 23
Error: 0x800a000d (0x800A000D)
(M-Files 9.0.3372.0)

Would anyone be so kind to help me out with this ??
« Last Edit: November 25, 2012, 07:51:30 am by zvajda »
Logged

zvajda

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: A little help for script debugging
« Reply #1 on: November 29, 2012, 05:07:34 am »

Thanks for the vote of confidence :) , I've solved the problem that only a rooky like me could have done.

So problem solved.
Logged

Jean-Baptiste

  • Member
  • **
  • Posts: 48
    • View Profile
    • Gestform
Re: A little help for script debugging
« Reply #2 on: December 26, 2012, 11:14:53 am »

HI,

The error :
Code: [Select]
VaultScriptSessionTemplates.cpp, 355, Type mismatch
maybe the line in error :
Code: [Select]
szName = szVariableT & szVariableC & "/" & szVariableD
This is because TypedValue.Value is an object and concatenating object doesn't work.

The solution may be :
Code: [Select]
szVariableD = PropertyValues.SearchForProperty( 1048 ).TypedValue.Value.DisplayValue
Logged
Jean-Baptiste HENRY
Gestform
Developer
web : http://www.gestform.com