Error when validating script
I am trying to create a server script something like the code below:
using System; using System.Data; using System.Collections.Generic; using Metastorm.Ide.Extensibility; using Metastorm.Runtime.Core; using Metastorm.Runtime.Types; using System.ComponentModel; using Metastorm.Runtime.Models.TESTSQLPROJECT; namespace Metastorm.Runtime.Models.TESTSQLPROJECT { public class ServerScript1 { [Promote(PromotionTargets.ExpressionBuilder)] [Category("UserCategory")] public static string sGetNextSeqeunce(BusinessObject1 conn) { // do something with BusinessObject1 //and return a string } } }
When I validate, I get the error:
The type or namespace name 'TESTSQLPROCESS' does not exist in the namespace 'Metastorm.Runtime.Models.TESTSQLPROJECT' (are you missing an assembly reference?)
any suggestions please
Comments
-
Ignore the namespace error, these are misleading and will occur nearly every time there is an error elsewhere in the code, regardless.
The actual error in your code is that you have not returned a result from your method, which has a return value type of string. e.g.
public static string sGetNextSeqeunce(BusinessObject1 conn)
{
// do something with BusinessObject1
//and return a string
return "";
}0 -
Thanks for the quick response.
Even with the namespace errors, which I'm happy to ignore, I cannot deploy my project due to the script validation errors.
Are you suggesting that the namespace errors are a consequence of errors in my code rather than real "namespace" errors?
Any help would be appreciated.
Here's my actual code:
I am able to reference the BusinessObject1 class via the "Show Member List" and its parameters are availbale via the code prompts.
using System; using System.Data; using System.Collections.Generic; using Metastorm.Ide.Extensibility; using Metastorm.Runtime.Core; using Metastorm.Runtime.Types; using System.ComponentModel; using Metastorm.Runtime.Models.TESTSQLPROJECT; namespace Metastorm.Runtime.Models.TESTSQLPROJECT { public class ServerScript1 { /// <summary> /// xxxxxx . /// </summary> /// <value>zzzzzzz</value> [Promote(PromotionTargets.ExpressionBuilder)] [Category("UserCategory")] public static string sNextInSequence(BusinessObject1 conn) { conn.Refresh(); return conn.NextSequenceFormatted; } } }
0 -
Here's the code that generates no errors upon validation.
using System; using System.Data; using System.Collections.Generic; using Metastorm.Ide.Extensibility; using Metastorm.Runtime.Core; using Metastorm.Runtime.Types; using System.ComponentModel; using Metastorm.Runtime.Models.TESTSQLPROJECT; namespace Metastorm.Runtime.Models.TESTSQLPROJECT { public class Comanaco { [Promote(PromotionTargets.ExpressionBuilder)] [Category("UserCategory")] public static string sGetNextInSequence(BusinessObject1 bo1) { bo1.Refresh(); return bo1.NextSequenceFormatted.ToString(); } } }
Validation Error Messages of the type "The type or namespace name "xxxxxxx" does not exists in Metastorm.abd.xyz......."
are symptomatic of a syntax error - but the line no. in the Messages dialogue does not reflect the line that contains the error.
Any comments will be welcomed.
0 -
Another useful tip when validating code .....
At the bottom right of the Designer dialogue, you'll see a little red icon.
Click on thos icon, and then click on the pop-up - and the exact coding error wil be displayed
0
Categories
- All Categories
- 123 Developer Announcements
- 54 Articles
- 152 General Questions
- 148 Thrust Services
- 57 Developer Hackathon
- 37 Thrust Studio
- 20.6K Analytics
- 4.2K AppWorks
- 9K Extended ECM
- 918 Core Messaging
- 84 Digital Asset Management
- 9.4K Documentum
- 32 eDOCS
- 190 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- 10 XM Fax
- Follow Categories