When I spin up a new vm the custom attributes field populates everything but one particular field. I am brand new to vRA and was told to try to fix this. I have read some documentation and watched a few videos but I am at a loss so any help would be greatly appreciated.
var customProperties = inputProperties['customProperties'];
vmName = inputProperties['resourceNames'][0];
bUID = customProperties['bPOC'];
tUID = customProperties['tPOC'];
mUID = customProperties['mPOC'];
bName = System.getModule("com.vmware.library.tasks").getNameFromuID(bUID);
mName = System.getModule("com.vmware.library.tasks").getNameFromuID(mUID);
bEmail = System.getModule("com.vmware.library.tasks").getEmailFromuID(bUID);
mEmail = System.getModule("com.vmware.library.tasks").getEmailFromuID(mUID);
tName = "";
tEmail = "";
var userName = System.getContext().getParameter("__metadata_userName");
if (tUID == "0000000") {
tName = System.getModule("com.vmware.library.tasks").getNameFromuID(userName);
tEmail = System.getModule("com.vmware.library.tasks").getEmailFromuID(userName);
}
else {
tName = System.getModule("com.vmware.library.tasks").getNameFromuNID(tUNID);
tEmail = System.getModule("com.vmware.library.tasks").getEmailFromuNID(tUNID);
}
chartfield = customProperties['chartfield'];
This is the code that they wanted me to look through and mess with. It was having issues with the tName and tEmail but the person showing me around fixed those while he was showing me how to do stuff. Any help would be greatly appreciated. Thank you
Related
I'm trying to check my connections via cordova, the logic that I'm trying to do, is:
if network connected give "greetings" alert, else replace elements of the main view.
my difficult is to if connection ok, just give greetings message. someone could check my code to help me do to?
regards
function net(){
var theNet = navigator.connection.type;
var status = {};
status[Connection.NONE] = 'Sem acesso';
status[Connection.UNKNOWN] = 'Sem conexão';
status[Connection.WIFI] = 'Conexão wireless';
status[Connection.CELL] = 'Rede de operadora';
status[Connection.UNDEFINED] = 'Sem definição';
//alert(status[suaNet]);
var result = "<p style='text-align:center'><img style='height:20em;width:20em;' src='img/icon-dove-1024x934.png'></p>";
var blank = "<ul class='nav navbar-nav'><li style='texto-menu'><a href='#'>Nothing here</a></li></ul>";
if(Connection.NONE || Connection.UNKNOWN === false)
{
BootstrapDialog.alert("hi");
}
else if(Connection.NONE || Connection.UNKNOWN === true){
document.getElementById('div-inteira').innerHTML = result;
document.getElementById('menu-barra-hamburguer').innerHTML = blank;
}
else{
console.log("doest works");
}
are you doing this after device.ready function ?
Try consoling the network type before you check for the connection's. And make sure your using the correct implementation of the plugin.
I want a Sharepoint 2013 app to create programmatically an Enterprise Custom Field when it runs for the first time.
I fiddled around with the following code snippet, but it's not working
var projContext = PS.ProjectContext.get_current();
function AddCustomField() {
$('#message').text('Adding Custom Field...');
var object_to_add = new PS.CustomFieldCreationInformation();
object_to_add.FieldType = CustomFieldType.Text;
object_to_add.Name = "New_one";
object_to_add.Description = "test description";
projContext.CustomFieldCollection.add(object_to_add);
}
Any help would be appreciated!
var projContext = PS.ProjectContext.get_current();
var fieldType = PS.CustomFieldType.TEXT;
var customfields = projContext.get_customFields();
var entityTypes = projContext.get_entityTypes();
var projEntity = entityTypes.get_projectEntity();
var resourceEntity = entityTypes.get_resourceEntity();
var taskEntity = entityTypes.get_taskEntity();
projContext.load(customfields);
projContext.load(entityTypes);
projContext.load(projEntity);
projContext.load(resourceEntity);
projContext.load(taskEntity);
projContext.executeQueryAsync(QuerySucceeded, QueryFailed);
CreateField("Test", "Test", fieldType, projEntity);
function CreateField(name, description, fieldtype, entitytype) {
var customfieldInfo = new PS.CustomFieldCreationInformation();
customfieldInfo.set_description(description);
customfieldInfo.set_name(name);
customfieldInfo.set_fieldType(fieldtype);
customfieldInfo.set_entityType(entitytype);
customfields.add(customfieldInfo);
customfields.update();
projContext.load(customfields);
projContext.executeQueryAsync(QuerySucceeded, QueryFailed);
}
I made some modifications to a Google Script I found online, but not knowing how to script so well, I'm sure I'm missing something here.
My goal is to have all the information submitted through a Google Form to then be emailed to me or a group I'll create.
This script here does email me the info, but it's all added as a single line without even mentioning the questions.
I'm a total newb, but I'm sure this could be solved with some kind of command or event that I'm unaware of.
Take a look:
var EMAIL_SENT = "EMAIL_SENT";
function sendEmails() {
var sheet = SpreadsheetApp.getActiveSheet();
var startRow = 2; // First column of data to process
var numRow = 1; // Number of columns to process
var dataRange = sheet.getRange(startRow, 1, numRow, 10)
// Fetch values for each row in the Range.
var data = dataRange.getValues();
for (var i = 0; i < data.length; ++i) {
var row = data[i];
var message1 = row[1,2,3,4,5];
var message2 = row[2];
var message3 = row[3];
var message4 = row[4];
var message5 = row[5];
var message6 = row[6];
var message7 = row[7];
var message8 = row[8];// Second column
var emailSent = row[10]
if (emailSent != EMAIL_SENT) { // Prevents sending duplicates
var subject = "New Hire On The Way!";
MailApp.sendEmail("itgroup#mycompany.com",subject,message1+message2+message3+message4+message5+message6);
sheet.getRange(startRow + i, 10).setValue(EMAIL_SENT);
}
}
}
That whole "EMAIL_SENT" was my attempt at having the script not resend info that was already entered.
If there is a better way of doing this, I'd love to hear it.
Thank you so much!
You can set this function as a trigger for onFormSubmit in the response sheet.
Source: Get Google Forms data in an Email Messages
function SendGoogleForm(e) {
var email = Session.getActiveUser().getEmail();
var subject = "Google Docs Form Submitted";
var s = SpreadsheetApp.getActiveSheet();
var columns = s.getRange(1,1,1,s.getLastColumn()).getValues()[0];
var message = "";
for ( var keys in columns )
message += columns[keys] + ' :: '+ e.namedValues[columns[keys]] + "\n\n";
MailApp.sendEmail(email, subject, message);
}
if your just wanting the email to have a little more structure you can just add html to the individual messages. Depending how crazy your want to get is up to you. Here is a simple change that you can try it should have a little more structure. Replace this with your if statement
if (emailSent != EMAIL_SENT) { // Prevents sending duplicates
var subject = "New Hire On The Way!";
MailApp.sendEmail("itgroup#mycompany.com",subject,message1+"<br />"+"<br />"+"<br />"+message2+"<br />"+"<br />"+"<br />"+message3+"<br />"+"<br />"+"<br />"+message4+"<br />"+"<br />"+"<br />"+message5+"<br />"+"<br />"+"<br />"+message6+"<br />"+"<br />"+"<br />");
sheet.getRange(startRow + i, 10).setValue(EMAIL_SENT);
}
All I did here is add breaks between your messages. This should create some spaces. You can always go crazy with inline css and html. www.w3schools.com is always a great place to start for beginners. Good Luck and happy coding!
i
HTML
<div id="notApprovedUsers">
</div><button onclick="approveUsers()">Approve</button>
</div>
i like to get checked users in parameter userList to work with.
here is javascript there me generating list with users and checkboxes.
i like to approve just the checked one's of course!
JavaScript
function getNotAssignedUsers() {
server.getUsersByGroup("1eb33e30-c355-467f-af3c-e7d0b4a1fgt5").then(function (userDetails) {
debugger;
for (var i = 0; i < userDetails.length; i++)
{
var vorname = userDetails[i].firstName;
var nachname = userDetails[i].lastName;
var newCheckBox = document.createElement('input');
newCheckBox.type = 'checkbox';
newCheckBox.id = "0"+i;
document.getElementById("notApprovedUsers").appendChild(newCheckBox);
var newElement = document.createElement('div');
newElement.id = i;
newElement.className = "notApprovedUsers";
newElement.innerHTML = vorname + " " + nachname;
document.getElementById("notApprovedUsers").appendChild(newElement);
}
});
}
HERE in userList I need to read just a checked users..
function approveUsers(userList)
{
var user1 = document.getElementById("00").checked;
var user2 = document.getElementById("01").checked;
var user3 = document.getElementById("02").checked;
alert(user1 || user2 || user3);
}
You want something like this then. There may be errors as I havent tested
var names = [];
$('input[type=checkbox]:checked').each(function(index, value){
var name = $(value).next("div").html();
names.push(name);
});
Then do something with the names array
Edit - See jsfiddle http://jsfiddle.net/vpg3r/3/
I think the best solution for you here is to use jQuery. You can use something like:
$('#notApprovedUsers input[type=checkbox]:checked')
to get all the elements that are checked, and work with them.
I've created a JSFiddle for you to demonstrate how to implement the behavior that I'm describing. You can see it in this link.
I'm trying to add a checkbox to my form which copies billing details from the form to shipping details, but my function isn't working.
This is what I have so far:
function fillShipping(f) {
var billing = document.forms["billing"];
var shipping = document.forms["shipping"];
if (document.getElementById("checkshipping").checked)
{
f.title.value = f.title.value;
f.firstname.value = f.firstname.value;
f.email.value = f.email.value
f.phone.value = f.phone.value
f.Address1.value = f.Address1.value
f.Address2.value = f.Address2.value
f.city.value = f.city.value
f.postcode.value = f.postcode.value
f.country.value = f.country.value
}
Can anyone point out where I'm going wrong?
You probably meant
shipping.title.value = billing.title.value;
Instead of
f.title.value = f.title.value;
if you are getting the forms and putting them into vars why are you passing in f? why not billing.email.value = shipping.email.value? Also how are you calling this function?