IRuleContect Script not triggering on field

Hello,

I have a script that I want to run on the field when another field is equal to a specific value and have this script change the value of the field.

 


string CompanyN = Context.Field("Company").Text;
string Npc = Context.Field("NamePostCode").Text;
if(CompanyN == "Manage at home")
{
     Npc.Replace(Npc, "Manage at home UB7 0LJ");
}

I've written this but nothing happens when i run the document recognition stage.

Thanks

 

J

Was this article helpful?

0 out of 0 found this helpful

Comments

1 comment

  • Avatar
    Adrian Enders

    I assume this is a Rule script. If you are referencing 2 fields, you should put the script on a parent level of both fields. If the fields are under a Section, put the rule on the Section. If the fields are in a repeating group, put the rule on the repeating group.

    If you put the rule on one of the fields, it may not execute because the fields are on the same hierarchical level. I have seen this before, if I understand you correctly.

    0

Please sign in to leave a comment.