Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
Using Nu specific functions in forms and objects Topic is solved
Using Nu specific functions in forms and objects
Hello, I have a form called change_address, there are two fields : input : TerminalID and display old_address;
I am trying to fetch old address with terminalid from table called address;
I have tried two methods: display sql with :nuFormValue('TerminalID') and also javascript method.
I get not defined errors in console for everything that is nu-specific code.
What should I do?
I am trying to fetch old address with terminalid from table called address;
I have tried two methods: display sql with :nuFormValue('TerminalID') and also javascript method.
I get not defined errors in console for everything that is nu-specific code.
What should I do?
-
- nuBuilder Team
- Posts: 4292
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 444 times
- Contact:
Re: Using Nu specific functions in forms and objects
Hi,
There's no such function nuFormValue() and the syntax is also different.
https://wiki.nubuilder.cloud/index.php? ... tFormValue
PS: It's important to provide as much detail as possible, including the error message you are receiving. Without knowing the specific error(s), we will have to make assumptions about what the issue might be.
There's no such function nuFormValue() and the syntax is also different.
https://wiki.nubuilder.cloud/index.php? ... tFormValue
PS: It's important to provide as much detail as possible, including the error message you are receiving. Without knowing the specific error(s), we will have to make assumptions about what the issue might be.
Re: Using Nu specific functions in forms and objects
Hello Kevin. This is my first time interacting with NuBuilder, sorry for lack of details.
I will describe my main goals form my application.
I have a table and I want to parse xml and display data from xml, after pressing Add to Merchants button, I want this data to be added in my table. I have parsed xml in a form using javascript and I have javascript variables, now I need to add these variables in my table using SQL Queries.
How can this be achieved?
I will describe my main goals form my application.
I have a table and I want to parse xml and display data from xml, after pressing Add to Merchants button, I want this data to be added in my table. I have parsed xml in a form using javascript and I have javascript variables, now I need to add these variables in my table using SQL Queries.
How can this be achieved?
-
- nuBuilder Team
- Posts: 4292
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 444 times
- Contact:
Re: Using Nu specific functions in forms and objects
Set the XML with nuSetFormValue() in the Lookup's After Browse to a form field and use JS (LUJS field) to process it.
Re: Using Nu specific functions in forms and objects
Kevin, thanks for reply!
Are there any in-depth tutorials you are aware of? Can not find anything.
Are there any in-depth tutorials you are aware of? Can not find anything.
-
- nuBuilder Team
- Posts: 4292
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 444 times
- Contact:
Re: Using Nu specific functions in forms and objects
Do you want to know how to use nuSetFormValue() or something else?
Re: Using Nu specific functions in forms and objects
Yes, I would like to create custom forms, grab input values from the form fields and put them into sql to update my database.
Please understand, I am coming from MSAccess and can not really get my head around how to setup simple clickable buttons that will run sql queries and CRUD into my database.
-
- nuBuilder Team
- Posts: 4292
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 444 times
- Contact:
Re: Using Nu specific functions in forms and objects
Can you clarify where exactly you are stuck in the process of creating clickable buttons that run SQL queries and perform CRUD operations in your database? Are you having trouble adding the button to your form, adding a click event to the button, or executing the SQL query? Providing more details will help me give you more specific guidance.
Re: Using Nu specific functions in forms and objects
I will describe what I am trying to accomplish coming form MSAccess, I know these two are completely different, but still.
I have a form, where fields on left side is getting filled with uploaded XML, I am parsing and pasting it into those fields. Fields on the right side are hand-filled. Here is a VBA Code which I am running on "Add" button:
To explain: I am checking if serial number is existing in my main table, if it does, then I check if Terminal ID is existing, if it does not I check if serial number is complaint with blank status and if everything checks up, I run a query to add into main table.
You notice that MSAccess can grab values from forms with [] brackets.
How do I replicate this in nubuilder? If I can achieve this I will be able to translate my whole MSAccess project into nubuilder.
I have a form, where fields on left side is getting filled with uploaded XML, I am parsing and pasting it into those fields. Fields on the right side are hand-filled. Here is a VBA Code which I am running on "Add" button:
To explain: I am checking if serial number is existing in my main table, if it does, then I check if Terminal ID is existing, if it does not I check if serial number is complaint with blank status and if everything checks up, I run a query to add into main table.
You notice that MSAccess can grab values from forms with [] brackets.
How do I replicate this in nubuilder? If I can achieve this I will be able to translate my whole MSAccess project into nubuilder.
Code: Select all
Option Compare Database
Private Sub AddFiscalMerchant_Click()
Dim count As Integer
count = DCount("SerialNumber", "MainInstances", "[SerialNumber]='" & [Forms]![AddFiscalMerchant]![SerialNumber] & "'")
tidcount = DCount("TerminalID", "MainInstances", "[TerminalID]='" & [Forms]![AddFiscalMerchant]![TerminalID] & "'")
blankstatus = DLookup("Blankornot", "MainInstances", "[SerialNumber]='" & [Forms]![AddFiscalMerchant]![SerialNumber] & "'")
If count = 0 Or blankstatus = "NotBlank" Or tidcount <> 0 Then
MsgBox "Serial Number was NOT FOUND, IS NOT blank or Terminal ID ALREADY EXISTS!", vbCritical
Else
DoCmd.OpenQuery "AddFiscalMerchant", acViewNormal, acAdd
Beep
MsgBox "Merchant has been added successfully!", vbInformation, "Success"
DoCmd.Close acForm, "AddFiscalMerchant"
End If
End Sub
Private Sub CloseWindow_Click()
Dim answer As Integer
answer = MsgBox("You are about to close window, continue?", vbQuestion + vbYesNo)
If answer = vbYes Then
DoCmd.Close acForm, "AddFiscalMerchant", acSaveNo
Else
End If
End Sub
Private Sub Form_Load()
DoCmd.GoToRecord , , acNewRec
End Sub
Private Sub SerialNumber_LostFocus()
If Len(SerialNumber.Text) = 9 Then
SerialNumber = SerialNumber.Text
SerialNumber = Left(SerialNumber, 3) & "-" & Mid(SerialNumber, 4, 3) & "-" & Right(SerialNumber, 3)
SerialNumber.Text = SerialNumber
End If
End Sub
Private Sub UploadXMLFile_Click()
Dim fd As Office.FileDialog
Set fd = Application.FileDialog(msoFileDialogFilePicker)
With fd
.Filters.Clear
.Title = "Select a XML File"
.Filters.Add "XML File", "*.xml", 1
.AllowMultiSelect = False
If .Show = True Then
xmlFileName = .SelectedItems(1)
' Process XML File
' Dim root As Object
Dim xDoc As Object
Set xDoc = CreateObject("MSXML2.DOMDocument")
xDoc.async = False: xDoc.validateOnParse = False
xDoc.Load (xmlFileName)
Set CommonTemplate = xDoc.DocumentElement
Set TerminalTemplate = CommonTemplate.FirstChild
Set PossessorTemplate = CommonTemplate.LastChild
' Get Root Node
Me.SerialNumber = TerminalTemplate.ChildNodes(1).Text
Me.MerchantName = PossessorTemplate.ChildNodes(0).Text
Me.INN = PossessorTemplate.ChildNodes(2).Text
Me.TerminalID = TerminalTemplate.ChildNodes(4).Text
Me.MerchantID = PossessorTemplate.ChildNodes(1).Text
Me.Address = TerminalTemplate.ChildNodes(2).Text
Me.ReconcilationTime = TerminalTemplate.ChildNodes(8).Text
Me.InstallAppNumber = PossessorTemplate.ChildNodes(3).Text
Me.Profile = TerminalTemplate.ChildNodes(0).Text
End If
End With
End Sub
You do not have the required permissions to view the files attached to this post.
-
- nuBuilder Team
- Posts: 4292
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 444 times
- Contact:
Re: Using Nu specific functions in forms and objects
To upload a file, you can use the File object.
This Tutorial should help you get startet to parse an XML file: https://www.w3schools.com/xml/default.asp
This Tutorial should help you get startet to parse an XML file: https://www.w3schools.com/xml/default.asp