Print Page | Close Window

VerifierCondition

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=473
Printed Date: 12-Mar-2025 at 10:28pm


Topic: VerifierCondition
Posted By: chuchay
Subject: VerifierCondition
Date Posted: 04-Oct-2007 at 10:45pm

I am using a DelegateVerifier and I need to pass a parameter to my verifier condition but I can't seem to make it work. First question is, is it possible to pass a new parameter? If not, is there an alternate way? If possible, how do I do it? I am very new to DevForce.

Thanks in advance.
 



Replies:
Posted By: Yaron
Date Posted: 09-Oct-2007 at 9:40am
Can you maybe post some more specifics? what kind of variable are you attempting to pass, etc


Posted By: GregD
Date Posted: 09-Oct-2007 at 7:52pm

Try putting the delegate method in a new class whose constructor takes the parameter you need. You can then set a class member variable equal to the parameter. Since the delegate method lives inside the class, it has access to that class member variable.

  public class DelegateHolder {
   public DelegateHolder(String pSomeParameter) {
    mSomeParameter = pSomeParameter;
   }
 
    private static VerifierResult SomeCondition(
      Employee pEmp, TriggerContext pTriggerContext, VerifierContext pVerifierContext) {
      bool result;
      if (mSomeParameter = "foo" {
        // do something
      }
      return new VerifierResult(result);
    }
   private String mSomeParameter;
  }
 
Greg Dunn
IdeaBlade


Posted By: chuchay
Date Posted: 09-Oct-2007 at 9:49pm
Thank you very much. I will try this and give you feedback. :)



Print Page | Close Window