Validation with Universal Functions switch my form mode to UPDATE...

Marie Carrier

Hi,

I would like to know why is my Universal Function changes my form mode from OK to UPDATE mode?

ClearAllStoreValues();

@STORE1= SQL(SELECT SUBSTRING([U_CardNumber],5,4) FROM [dbo].[@BOY_E0_CREDITCAEX] WHERE [U_CardCode] = $[$5.0.0])

Set($[$154.0.0]|None);
Set($[$154.0.0]|@STORE1);

The goal is to get the 4 last digit of the BP Credit Card # in the [OCRD.CrCardNum], so customer care can handle credit card validation without IPayment licence.

Or it might be my Validation Settings...

Regards,

Comments

2 comments

  • Comment author
    Geoff Booth
    • The validation is simply a "trigger" to start the UF so doesn't change anything.
    • You have two "Set" statements which populates the value in the fields on the form and changes the form mode to Update.
    • Then you need to click the Update button to actually save the new value to the database.
    0
  • Comment author
    Marie Carrier
    • Edited

    That is weird because I have the same for another Validation/UF and I do not get the UPDATE mode.

    And if I set it directly to :

     Set($[$154.0.0]|SQL(SELECT SUBSTRING([U_CardNumber],5,4) FROM  [dbo].[@BOY_E0_CREDITCAEX] WHERE [U_CardCode] = $[$5.0.0]);

    there is nothgin that appears in my cell...
    I wanted to remplace my old "magnifying glass" used with a Formated Search.

    The Error Message is : 
    Macro error in UF-041: System.Exception: Error setting value SQL(SELECT SUBSTRING([U_CardNumber],5,4) FROM  [dbo].[@BOY_E0_CREDITCAEX] WHERE [U_CardCode] = C2365USD on item 154: Form - Bad Value
     [Macro Command: Set($[$154.0.0]|SQL(SELECT SUBSTRING([U_CardNumber],5,4) FROM  [...

    0

Please sign in to leave a comment.