Workflow Soluiton

 View Only
Expand all | Collapse all

Error while updating the altered value in GridView Component

Migration User

Migration UserMar 18, 2016 02:00 AM

  • 1.  Error while updating the altered value in GridView Component

    Posted Mar 18, 2016 01:39 AM

    I am trying to do custom validation on a Gridview while updating the altered value.

    My Gridview is in edit mode that looks like below specified.

    I can successfully update the Active field with TRUE or FALSE value.

    My problem is when some one updates the Active field with spelling mistake of True/False. eg: Tru,Fals,Flase etc... as below mentioned.

    g3.PNG

    When i try to update the altered Active entry with incorrect spelling. It goes to error as mentioned below.

    120px_e1.PNG   120px_e2.PNG

    I get the above error immediatelyafter clicking update. 

    I think after clicking "update" GridView changes from edit mode to read mode and the actual update to DB happens only when i click on "SAVE" button.

    So i need to validate the above case like a pop up or something saying "Please enter the correct value".

    Note: 1.Type of "Active" is bit in database. So, it only takes True/false in "GridView" component and 0/1 in database..

    OR

    Is there any other way to handle the situation?

    Thanks in advance.



  • 2.  RE: Error while updating the altered value in GridView Component

    Posted Mar 18, 2016 02:00 AM

    Need Soultion!!



  • 3.  RE: Error while updating the altered value in GridView Component

    Posted Mar 18, 2016 02:37 PM

    I was poking around hoping for a javascript solution to this because it felt cleaner, but I don't see a good way to do it. Maybe Africo can find something, though.

    But hope isn't lost! You definitely can do some validation using workflow itself. In your grid component go to the functionality tab and setup a custom validation model.

    customvalidationofgrid.png

     

    Within that model, you can use a "for each element in collection" component to iterate through each row of the grid.

    customvalidationforgrid.png

     

    Make sure you use the CustomValidationInput variable and not your actual array.

    customvalidationeachrow.png

     

    Then it's simply a matter of checking the individual property(s) of each row for acceptible values. If it's okay, the end component returns a null value. If not, send to an end component that returns an error.



  • 4.  RE: Error while updating the altered value in GridView Component

    Posted Mar 18, 2016 03:07 PM

    is the data type you're loading into the grid actually using a bit (logical) value for that field, or is it using a text value that you're then trying to map back to a bit value?  if your data type is a legitimate logical(true/false) data type, then you should see a checkbox in an editable grid, like so:

    2016-03-18_12-56-33.png

     

    i suppose there's also the possibility that your source datatype is a Logical (nullable) value.  see the difference here:

    2016-03-18_13-02-01.png

    here's the data type configuration for that grid:

    2016-03-18_13-03-42.png

    so i guess my next question is, how is your data type structure being built?  is it the result of a sql query component?  did someone build the data type directly in an integration library?  

    if someone built the data type, change the logical (true/false) column to a non-nullable version and you'll get a checkbox instead, making the issue you've described moot.

    assuming you already have null values in a database table (assuming also that you're utilizing sql data tables, which, from your description above, sounds like you are), you'll first need to set any null values to 0 (zero) so that your integration components don't error out when they find a null value where they expect a non-nullable true/false value.



  • 5.  RE: Error while updating the altered value in GridView Component

    Posted Mar 18, 2016 03:19 PM

    Good call! I was treating the symptom and not the disease.



  • 6.  RE: Error while updating the altered value in GridView Component

    Posted Mar 18, 2016 04:08 PM

    i'd say both complement one another; it's possible he won't be able to adjust the input data structure, and will then need to validate in the manner you indicated.  



  • 7.  RE: Error while updating the altered value in GridView Component

    Posted Mar 21, 2016 12:44 AM

    Thank You Both for the efforts, 

    Africo, Firstly i am using "GridView" Component not the "Grid" Component.

    I guess the solution that you specified works with "Grid" component but not with "GridView" Component. It does not gives you checkbox even if the datatype is a legitimate logical(true/false) in editable "GridView" Component.

    And the data type structure of Active field is the result of the query integration which fetches from SQL Data table.

    It is of type bit as shown below.

    data1.PNG

    So, The data type that is loading into grid is using bit(logical) for the active field from SQL Table.

    And my Active field in SQL DB doesn't contain any null value it is either 0 or 1.



  • 8.  RE: Error while updating the altered value in GridView Component

    Posted Mar 21, 2016 02:06 AM

    Ok - are you able to switch to the normal Grid component?  Is there a reason that you must use the GridView?  you're right, i was describing the functionality of the normal Grid component.  



  • 9.  RE: Error while updating the altered value in GridView Component

    Posted Mar 21, 2016 04:48 AM

    Yes previously i was using "GRID" component had some issues with it.. So my new requirement is to change "Grid" to "GridView" component.



  • 10.  RE: Error while updating the altered value in GridView Component

    Posted Mar 21, 2016 09:42 AM

    michael.george thanks for your suggestion.

    Your custom validation model worked great to check the "NULL" Values in "GridView". Where as how to check "Empty Entries" in "GridView"..??

    NUL123.PNG

    I mean when user types "NULL" and then updates. It gives out a pop-up saying "There are Errors on the page" so that user can change intimated not to give "NULL" values.

    similarly, How can i validate the "empty strings"..?

    empty.PNG

    So when user tries to update "GridView" with "Empty Values" i should throw out a pop-up saying "Empty values not allowed".

    I have tried using "Text Contains Multiple Text Rule" as below.

    MUL123.PNG

    Thought, This will compare both NULL and Empty strings but its not working.

    Also tried with "Text Contains Rule" and "Variable Exist Rule" and "Variable Exist" component but couldn't validate the required "Empty String"

    Below is my Custom validation Model.

    Err.PNG



  • 11.  RE: Error while updating the altered value in GridView Component

    Posted Mar 22, 2016 02:38 AM

    Empty Strings validation for other fiels like "username" "Password" and "Domain" is successfull with "TEXT EXIST" Component...

    But validating the Spelling mistake of "Active" Field is still a mystery..



  • 12.  RE: Error while updating the altered value in GridView Component

    Posted Mar 24, 2016 08:35 AM

    Test for blank values with a simple "text exists" as you indicated was successful and test for valid values with a "text contains multiple text" like I indicated above and this should work. If you are still having issues with it, I may need a bit more information to go on.



  • 13.  RE: Error while updating the altered value in GridView Component

    Posted Mar 24, 2016 10:48 AM

    If you need to validate a text field's spelling just use a Matches rule and have it evaluate the valid responses.