3 Replies Latest reply on Apr 21, 2014 12:26 PM by philmodjunk

    Function working intermittently

    EP

      Title

      Function working intermittently

      Post


           I have a solution that uses the following expression to determine if an "order" should be labeled as "new" to identify a first time orderer/customer:

           If ( Clients::_pkClientID > 244 and Clients::OrderCount = 1; "NEW"; "")

           This is used with a SetField function with NewOrder field after a user enter the order.  It usually works but sometimes the NewOrder field isn't marked as "New."  The reason for Clients::_pkClientID > 244 is bc 244 clients were initially imported into the system, so we only want this to evaluate on clients with an ID above 244.

           Anything wrong with my expression?

           Thanks

            

        • 1. Re: Function working intermittently
          philmodjunk

               How does Clients::OrderCount get a value? Could it be empty or zero--perhaps due to a new record not yet being comitted at the time this script step executes?

          • 2. Re: Function working intermittently
            EP
                 

                                     How does Clients::OrderCount get a value? Could it be empty or zero--perhaps due to a new record not yet being comitted at the time this script step executes?

                                      

                 Clients::OrderCount is a calc field= Count (OrderCount::_fkClientID)

                 As for a new record not being committed yet....this might be the case.  I'm not surer though, bc I'm not using globals which set actual fields upon committing the record, I'm using actual fields and the Order record is created, so shouldn't it be detected and make my calc field work?

            • 3. Re: Function working intermittently
              philmodjunk

                   In some cases the calculation might not have updated yet to show the correct count. You may want to insert a commit records step just before this If step as a way to test and see if that corrects theissue.