Backand: Object exists but not able to access it - backand

I'm using Backand for my backend service where I have an object that exists in my model diagram but I can't access it. Whenever I try, I get an error that the table doesn't exist. I can't delete it. I've tried renaming it but it only took a single additional character to the name. I've tried to edit it and remove it in the model json area but to know avail. Any help would be greatly appreciated. Thanks.

Are you sure you click on save button in bottom of model page?

I was able to get this corrected. My problem came about that at some moment, I went to the Object's Settings tab. There are two "Names" at the top of that. "Name" and "Database Name". At some point I had changed the "Name" (which is editable) which cause the "Name" and "Database Name" to be different which caused queries to have problems.
So to correct this issue - I renamed the "Name" to be exactly what the "Database Name" is (having to do so slowly as it has an event trigger each time you make a change so it has to wait for the confirmation of each save before typing the next letter). Once I got the "Name" and "Database Name" to match exactly, then I was able to refresh the Object Model and delete out the object. Then created the Object with the name I really wanted.

Related

VB.Net ComboBox (as Dropdown) not translating text to DisplayMember with Databinding

I inherited a fairly large project at work that is undocumented and written in VB (originally started pre .NET, ended around .NET 2). I'm in the process of updating / refreshing a lot of the code, but have run into an annoying issue that I haven't found the solution for yet. This system utilizes a UI, a Web Service, and a SQL DB.
Problem: I have a Databound Combobox (originally set to DropDownList - I'm changing it to DropDown, which is what started this mess - going back isn't an option) that is tied to a DataSet that comes from a Web Service. When a user types in the item they want manually, the data from the text field doesn't seem to associate itself with the DisplayMember, which forces the WS/SQL query to fail (it is sent a blank value when it's expecting a ValueMember). If the user types in a partial selection and then chooses the value they want from the DisplayMember list using the arrow keys or tab, the query goes off without a problem.
My Question: How do I get the text field to translate to the DisplayMember which will then properly tie itself to the ValueMember which will then allow the query to execute correctly? Sorry for making this sound complicated or convoluted; I'm sure the answer is easy and I'm just glazing over it.
The relevant bit of code is:
With cmbDID
If dtsLU.Tables.Contains(reqTable) = True Then
.DataSource = dtsLU.Tables(reqTable)
.DisplayMember = "zip"
.ValueMember = "gridID"
End If
End With
cmbDID.DataBindings.Clear()
cmbDID.DataBindings.Add("SelectedValue", dtsData, strDT & ".gridID")
I've tried changing "SelectedValue" to "Text", which almost works - but it directly translates to gridID and skips zip which ends up with an incorrect Web Service response since the zip and gridID field values are not synced (zip (DisplayMember) may be 5123 while gridID (ValueMember) may be 6047). I've tried changing "SelectedValue" to "SelectedIndex", and that got me no where.
Any help is greatly appreciated.
EDIT
To add some clarification to the process, the below pseudo code / description is roughly what happens. I could post the whole module, but I feel that would just muddy the whole question even more.
Private Sub A
FormAlpha is created with 1 ComboBox in the form of a DropDown
This DropDown is populated with a DataSet
DataBinding with a blank DataSet is added to the control to keep track of the users input
End Sub
lblSubmit_Click event is triggered on FormAlpha by the user after they have populated the DropDown with their data. lblSubmit_Click calls Private Sub Submit
Private Sub Submit
BindingContext(DropDown DataSet, tableName).EndCurrentEdit() is called
DataSet.HasChanges() is processed
If changes are present, changes are processed
HERE lies the problem
If the user has manually typed in the DropDown field, but not hit an arrow key or tab, then the DataSet registers a change, but returns a null value in all fields - it knows something was entered, but that data apparently didn't pass through the DataSet for the ComboBox (ListItems or SelectedIndex didn't change / fire I'm guessing). If the user selects the item with the arrow keys, the DataSet has the proper input (I'm assuming the Data was validated by the control at this point).
If the processed data is good, a value is entered into the database
If the processed data is bad (empty), an error is returned
End Sub
If the above can't be solved with what I've provided, but someone still knows a better way to handle this type of situation, I'm all ears. Rewriting the module isn't ideal, but fixing this problem is a necessity.
Alright, while this fix may not be ideal, it is a fix none the less.
The bare bones problem was that the text value of the DropDown wasn't causing the data to actually affect the SelectedIndex / SelectedValue of the control unless you interacted with it using the arrow keys or a mouse click. So, while the DropDown would read "1234", in reality the control saw "".
The fix I have in place for this is simply calling comboBox.text = comboBox.text whenever the user hits the submit button.

database list contains wrong objects

Goal:
To create a database with documentation about drivers. The idea is to create both vendor and protocol entries, and to link them, as follows: Inside the protocol creation form, I would like to select which vendor supports this protocol.
Approach:
I used the Create your own! button to create the following 2 Applications:
Vendors
Protocols
Inside the protocol creation page I've put a Database List field. With the following properties:
Name = vendors
Display type = select
Multiple select = false
hibernate query : I left this field blank.
xwiki class name = VendorsCode.VendorsClass
ID field name = doc.name
value field name : I left this field blank.
Problem:
To my surprise this works, but not entirely. When I open the form to add a protocol, in the vendor dropdown list there are now not only vendors but also a couple of other objects such as : "Blog.BlogIntroduction". Obviously I don't want that in the list. Why is it in there, and how can I get it out ?
I tried to add the value doc.name in the value field name box as well. But that actually only makes it worse. Now the list only contains "Blog.BlogIntroduction".
Notice that this is a clean fresh installation of xwiki. There's nothing special in this database.
What is going on here?
What you see is the default value for the select item in the Database List, as it is stored in the template page for "Protocol" objects.
A new Database List is initialized to show a list of blog posts, by having a default value of Blog.BlogPostClass for the "XWiki Class Name". (You can try this by creating a new Database List field in step 2 and open the edit view that field; just delete it after you are done.) For a fresh installed wiki there are two blog posts: the "blog page template" in Blog.BlogPageTemplate and the blog intro post in Blog.BlogIntroduction. Exactly these two items are shown initially.
After you fill in the value of your class in the "XWiki Class name" field, XWiki has a chance to find the actual list of possible values.
However it keeps the selected "default value" from the first attempt around (even though it makes no sense).
This looks like a bug to me, at least from a user experience.
How to fix it
First Step: The reason why your list only contains the bogus "default value" might be that the class you have given does not exist.
From what I see in the screenshot the class name looks ok for me, but then this field is not tolerant to any kind of typos, even something like a space before the class name. If the name does not fit exactly, it gives a (nearly) empty list.
If you cannot get it working with the class name and want to go the HQL route instead, use for the HQL field
, BaseObject as obj where doc.fullName = obj.name
and obj.className = 'VendorCode.VendorClass'
and doc.fullName != 'VendorCode.VendorTemplate'
and doc.fullName both as id and value field. This has the additional benefit that the template vendor is not available in the drop down, only the "real" objects.
After you managed to fix the name of the class, you should see a list of all vendor objects (including the VendorCode.VendorTemplate, unless you went the HQL route), and the remaining bogus default value. Now you can continue to the next step:
Second Step: if you managed to fix the class name, you will see your vendors in the drop down beside the default value; now it is time to get rid of the bogus default value. For this go to the template object of the application; e.g.
follow the "Edit Application" link on the start page of the "Protocol" application
then look at the box with the three checkboxes below the field definitions; the uppermost of the checkboxes says "Update class template"
this part contains a link to something called "ProtocolTemplate".
click the link and you end up at the template page
on the template page, click on edit and choose some other value from the drop down of vendors, and then click save.
The "BlogSomething" value should be gone now from the selection of vendors.
Optional step (not answering the quesion, but might be of interest anyway)
If you prefer to have no value at all preselected in the template, you need a few more steps:
in the application edit, edit the field and choose "multiple select" and display type "checkbox"
go to "next step" in the editor, then back to field edit with "previous step"
uncheck the checkbox beside the selected vendor entry, then open the field editor and set "display type" back to checkbox and unset the "multiple select" checkbox.
go the "next step" and "finish"
Afterwards if you create a new "protocol" entry, this is has an empty "vendor" preselected.

Copy Value from combo list on login screen to username field on new form

Newer to access...I am trying to copy the value selected from the combobox on the log in screen to a field on the new form that opens after successful login.
The field I need copied is called cmoemployee on the Login form.I need that to go to the username field on the mainframe form.
Any help would be greatly appreciated! I have tried many different ways but I can't seem to get it.
Haha,
I actually know what you mean here. This can be a complete pain as the variables are deleted when you open a new form In general it is better to show what you have tried so people are able to help you fix it. Anyway, I've tried to do this so I know how frustrating it can be. There are two main ways that this can be done. You can open the form with openargs (I do not think this is a good option for you as you will have to have the openargs constantly transferring from one form to the next and will be cleared if one form misses them.
A better option would be to use tempvars which are not deleted. This is the code I used to do something similar:
I am going to assume your combobox is two columns (but only displays one) and the bound column is the primary key to an employee table. In which case this would work (or you can modify it to meet your needs)
Log in:
'Check Password (or however you check it
If StrComp(txt_Password, DLookup("[Password]", "tbl_Employee", "[ID] = " & cmoemployee), 0) = 0 Then
TempVars.Add "MyEmpID", cmoemployee.Value 'TempVars will store the combobox value
Else
Msgbox "Incorrect Password Please try again"
End If
On Load event of mainfraim form:
[UserName] = TempVars!MyEmpID
That should get you started, so you can build the rest. Let me know if you have any questions.

Error coming up almost everytime I run my aplication from VS

Please see the pic. and advise why this error is coming up and how to fix it.
Thanks
Change your datagrid column's name from "Name" to "colName". Me.Name is a property, so naming it "Name" is causing problems. This is one reason I like to use a type prefix (btn, txt, lbl, etc) to signify control type.

The data set name is missing in the data region 'DataSetName'

I added an additional, new DataSet to my report and have been getting this cryptic error ever since.
The issue was that when the report had elements setup using the first data set I'd defined when the report was created. Adding an additional data set reset the DataSetName value to be blank. In this case for my Table but it could be for a List, etc.
To correct:
Open the report in SQL Server Business Intelligence Development Studio (AKA Visual Studio)
View the object details in the Properties Window (View > Properties Window or press F4)
Check the DataSetName value (under the Data section)
Update the value to point to the correct Data Set
Examine your RDLC file, open it in a XML editor. Most specifically, take a look at the Dataset section. See if there are some old ones that are still there. You can edit this file directly, but be careful what you do.
You can also attempt to run the RDLC file through a XML validator, and see if it comes up with any errors. Make sure to validate against the RDLC file's schema. (http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition/ReportDefinition.xsd)
I had a bit of trouble finding the correct properties window that contained this value, so I will add the following:
On the Layout Tab, press F4 to bring the properties box up.
In the dropdown at the top of the properties box, find your table and select it.
You should now see that data section about halfway down, along with the DataSetName property the error is complaining about.
I know this is a decade late, but this is to possibly help the next guy that is searching the internet for answers (like me).
In SSRS, right-click any unused/white area of the report then choose Select-> and the Group level (not group level content) that you are getting the error about.
In the properties window (Menu->View->Check Properties) for the Group Level, scroll down to General the DataSetName. Select the drop down arrow and choose the original dataset.