top of page

Forum Posts

webmaster
Mar 22, 2018
In Coding with Velo
My site is https://www.aesresourcesite.com I have one page that is only used the first time a user signs on to the site: https://www.aesresourcesite.com/first-time-login On the first time login page I use the WIX provided member login button and I want the options to be for new member setup I created my own login button for all of my other pages and I use WIX code to set the login options to "mode": "login" but the options are ignored and the "signup" mode is displayed. The only way I can get the login view to show up is by changing my option on the first time page - which I do not want to do. How can I get the login options I specify in my WIX code to take precedence over the first time page options? This is a very annoying problem for us as our users are easily confused and have difficulty folllowing instructions. I want the login panel they see to be the correct one.
0
0
48
webmaster
Feb 06, 2018
In Coding with Velo
I'm having a problem that's driving me crazy From my page onReady I'm invoking a function defined in my public lib.js The function returns a variable that is set to either yes or no per my console.log the variable is correctly set in the function, but, per my console.log, my page onReady function is receiving an undefined variable: export async function checkAccess // defined in lib.js let hasAccess = "no"; ......check database for access if {access record found hasAccess = "yes"} console.log("*** found current access : ", hasAccess) = *** found current access : yes return (hasAccess); $w.onReady(async function() { // from my page code hasAccess = checkAccess ( ); console.log("* hasAccess check : ", hasAccess) = * hasAccess check : undefined Can anyone tell me how to send/receive the yes/no value to my page???
0
9
1k
webmaster
Jan 11, 2018
In Coding with Velo
I created 4 datasets with relationships to each other userProfile has a user-reference-id that is referenced by userActivity userActivity has a field "title" that references the activity field on the dataset Activity Activity has an activityGroup that references the "title" field on the dataset activtyTitles There should only be on userProfile record per user (one to one) There may be multiple userActivity records per user (one to many) There will only be one Activity record per userActivity, but there will be multiple userActivity records per Activity (one to one, one to many) There will only be one activityTitle record per Activity record, but multiple Acctivity records per activityTitle I'm calling a function to find out what types of activities a user is participating in I'm passing the user-reference-id to the function and bypassing reading the userProfile record I'm trying to use the user-reference-id in my first query to find all the userActivity records for a given user, but I'm getting zero records returned. There are 4 records for the given user in both my test and production datasets. (In my debugging efforts I ran the query without the .eq on the user-reference-id and I did get all my userActivity records returned, for all my users.) the user-reference-id on the userProfile dataset is defined as a text field; the refId field on userActivity is a reference field tied to the user-reference-id on userProfile and userRefId has a value of "1" Is there some rule about not being able to use a reference field in an .eq option? I'm hoping this is just a syntax problem and not something that can't be done. HELP! My function code is below: export function checkActivityType(userEmail, userRefId) { wixData.query("userActivity") .ascending("refld", "endDate") .eq("refld", userRefId) .find() .then( (uAresults) => { uAresults.items.forEach( (item) => { activity = item.activity; wixData.query("activities") .ascending("title") .eq("title", activity) .find() .then( (Aresults) => { let itemsActivity = Aresults.items; let itemActivity = itemsActivity[0]; let activityGroup = itemActivity.activityGroup; wixData.query("activitiyTitles") .ascending("title") .eq("title", activityGroup) .find() .then( (results) => { let itemsGroup = results.items; let itemGroup = itemsGroup[0]; let activityAhc = itemGroup.ahc; let activityAes = itemGroup.aes; let activityTitle = itemGroup.title; if (activityTitle === "Staff") {admin = "yes";} if (activityAhc === true) {ahc = "yes";} if (activityAes === true) {aes = "yes";} } ); // end then activityTitle query } ); // end then activities query } ); // end uAresults loop } ); // end then userActivity query var resultsArray = [ahc, aes, admin]; return resultsArray; } // end function
1
5
933

webmaster

More actions
bottom of page