Changing Fields Depending On Data Follow

0
Avatar
Legacy Poster

Hi 

 

I'm trying to write a script (shown below), of If the field is equal to a specific value

 

Set it as 1 field otherwise another, but it doesn't seem to like me setting different fields

 

Can any one help me out here ?

 

ReferenceField("STPRT_BU_PARTNER")

 
If Mid(Field("STPRT_BU_PARTNER"),2,6) ="005241" then 
  Value = Field("UPCOUTER")
Else
  Value = Field("PRODUCTNO_EXT")
End If
 
 
Thanks

2 comments

0
Avatar
Fernando Ramos Miracle
Moderator
Comment actions Permalink

I can see you've declared the field "STPRT_BU_PARTNER" with the ReferenceField() command, but not the other two fields. Might that be the problem? Apart from that I don't see where the problem might be.

 

Could you let me know on what type of event are you adding this VB script (onProcessData, OnNewRecord...)?

0
Avatar
Legacy Poster
Comment actions Permalink

Hi Fernando,

 

Thanks for the reply,

 

I'm just selecting the type as VBScript, I'm don't think you need to select an event

 

Thanks

Please sign in to leave a comment.