Jump to content
  • 0

Table View of Self-Join Tables setting default value where no match found


Durand

Question

Using a self-joining table to enter part numbers and quantity required to view description, pricing, discount structure etc.

When entering a part number that doesn't correspond with any part number on the stock list (part number and quantity table self-joining to stock list) it will obviously not show any other detail as there is no data to match, but I would like to set a default value for the description field when no match is found to display 'Invalid Part Number'.

I've had some ideas on how to get it done but keep getting stuck as I also want to display this in the Table View with HTML.

Only way I've managed to get near to what I want was to add a cascading autocomplete text field, but I can't hide this field from the table view where the part number and quantities are entered.  I can't think anymore, surely there is an easier way.  I don't know enough of JavaScript, but thought that could be an answer to use an HTML block with javascript to display what I need.

Any suggestions?

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hi @Durand,

Is your Description field set as a Cascading text field to show the description of a part number from another table?

If so, I advise you to add a Virtual field and change the form element of this field to 'Calculated value'. Add a Case..When statement as below:

*************

Case when [@field: Part_Number] is null 

Then 'Invalid Part Number'

End

*************

Add a Rule to the DataPage for both the Virtual field and the Description field.

Rule 1: Part number field 'is blank', 'hide' Description field

Rule 2: Part number field 'is not blank', 'hide ' Virtual field.

I hope that helps.

Regards,

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...