problems getting the value of a field in a Ext.data.Model - javascript

I need to set values ​​in a text field, obtaining a data.Model these values​​, but when I run the function anywhere in the code, sends me this error:
Uncaught TypeError: Can not read property 'get' of undefined
But if I run it from a button works fine.
this is the code:
function SetterValues() {
var rec = store_usr.getAt(0);
Ext.getCmp('name_usr').setValue(rec.get("user"));
Ext.getCmp('nom_usr').setValue(rec.get("name"));
Ext.getCmp('ape_usr').setValue(rec.get("LastName"));
}
Help please! because I can not run it from anywhere in my code!

The error message you're receiving indicates that the rec variable is undefined. Are you sure that your store_usr exists, and is loaded? If so, does store_usr.getAt(0) return anything?

Related

Error when i refresh page in dynamics crm

i become an error when i click of the refresh button in Quote Entity.
the Problem does not happen in every record.
here is the error Text:
TypeError: Unable to get property 'getValue' of undefined or null reference at initializeFields
(https://.crm4.dynamics.com/%7b637228466560015635%7d/webresources/Sales/QuoteDetail/QuoteDetail_main_system_library.js:1:8424)
at FormOnLoad (https://.crm4.dynamics.com/%7b637228466560015635%7d/webresources/Sales/QuoteDetail/QuoteDetail_main_system_library.js:2:11491)
at mp.prototype.executeFunction (https://.crm4.dynamics.com/uclient/scripts/app.js?v=1.4.476-2003.4:1429:2767)
at mp.prototype.execute (https://.crm4.dynamics.com/uclient/scripts/app.js?v=1.4.476-2003.4:1429:2419)
at up.prototype._executeIndividualEvent (https://.crm4.dynamics.com/uclient/scripts/app.js?v=1.4.476-2003.4:1426:19561)
at up.prototype._executeEventHandler (https://.crm4.dynamics.com/uclient/scripts/app.js?v=1.4.476-2003.4:1426:18254)
at execute (https://.crm4.dynamics.com/uclient/scripts/app.js?v=1.4.476-2003.4:1426:15493)
at O.prototype._executeSyncAction (https://.crm4.dynamics.com/uclient/scripts/app.js?v=1.4.476-2003.4:881:688)
at O.prototype._executeSync (https://.crm4.dynamics.com/uclient/scripts/app.js?v=1.4.476-2003.4:881:294)
at O.prototype.executeAction (https://.crm4.dynamics.com/uclient/scripts/app.js?v=1.4.476-2003.4:881:150)
You get an Error because of Javascript and especially for your function initializeFields
Your Javascript is running onLoad of your Form.
You are fetching some attribute, and trying to get value of it.
But you do not get object itself and hence getValue Error.
Try adding your code here and we can help you further.

Uncaught FirebaseError: Function DocumentReference.set() called with invalid data. Unsupported field value: undefined

I'm creating a e-commerce with Vue & Firebase. Trying to add some cart information from the current logged in user. Strange thing is at the very first time information saved perfectly. When I trying to add some again. That dosent work and show this error.
Uncaught FirebaseError: Function DocumentReference.set() called with invalid data. Unsupported field value: undefined
So I have to refresh that page. Then it work again. I cant understand where is the problem.
Note: If I try to add any other value instead of cart. then it works fine.
checkoutLoggedInUser(){
var db = firebase.firestore();
var user = firebase.auth().currentUser;
db.collection("orders").add({
user_id:user.uid,
cart:this.$store.getters.cart
})
this.$store.commit('emptyCart')
this.$router.push({ name: 'Home'})
}
That error message is saying that one of the fields you're trying to write to a document is undefined in JavaScript. Check the values that you're passing by using console.log or using a debugger to figure out which one is undefined, then change your code to pass something else, or omit the field entirely.
Also bear in mind that the error message is referencing a call to DocumentReference.set(), but the code you're showing is calling DocumentReference.add(), so the error might be in a different location.

XPathResult is undefined

I have the error "Uncaught TypeError: Cannot read property 'FIRST_ORDERED_NODE_TYPE' of undefined" in some cases (not always) when run next code:
var type = XPathResult.FIRST_ORDERED_NODE_TYPE;
At the same time next code works fine for the same cases:
if (XPathResult)
var type = XPathResult.FIRST_ORDERED_NODE_TYPE;
It seems error is raised by interpretator, but not in runtime. Probably the problem is related with activation of window object.
I have this workaround with check if object exists but i want to figure out what is the real problem. Any ideas?
UPD: The problem is reproducableonly in Chrome

JavaScript error: SCRIPT5007: Unable to get property 'getElementsByTagName'

I am using the following jQuery to get the field value from a Display Form in SharePoint 2013 so I can pass the value along in a URL.
var itemID = $('h3:contains("My ID")').closest('td').next('td').text();
It is working perfectly, but I am getting an error when I inspect the action:
SCRIPT5007: Unable to get property 'getElementsByTagName' of undefined or null reference
File: sp.ui.dialog.js, Line: 2, Column: 22380
This contradicts what is actually occurring, since the code executes. I am running IE11 in IE10 compatibility mode.
I have seen this when the URL being passed to the modal function was invalid. In my case, I has a dynamic URL containing a variable named itemID. I got the error whenever itemID was undefined.
I wish I could elaborate further but all I can comment on is my own observations at this point.

Console erros innerHTML

I seem to be getting console errors on my innerHTML=t; the script is to display time on a page. Here is the console error:
Uncaught TypeError: Cannot set property 'innerHTML' of null time.js:8
The script is to display time on a page. Here is the code:
var myVar=setInterval(function(){myTimer()},1000);
function myTimer(event) {
var d=new Date();
var t=d.toLocaleTimeString();
document.getElementById("jstimer").innerHTML=t;
}
Does anybody know why I am getting those console errors?
You're getting
Uncaught TypeError: Cannot set property 'innerHTML' of null time.js:8
because
document.getElementById("jstimer")
is returning null, meaning that the element was not found. You need to check your html and make sure that there is in fact an element with the id (not class, or name, or anything else) of jstime in your dom at the time this timer fires

Categories