While creating a lead record we need to set address as default shipping. For updating the default shipping or billing we need to use setCurrentSublistText method. For example leadRecord.removeLine({sublistId: ‘addressbook’,line: 0,ignoreRecalc: true}); // billing sectionleadRecord.selectNewLine({sublistId: ‘addressbook’});var label = leadRecord.setCurrentSublistText({sublistId: ‘addressbook’,fieldId: ‘label’,text: “Billing Information”}); leadRecord.setCurrentSublistText({sublistId: ‘addressbook’,fieldId: ‘defaultbilling’,text: ‘T’});
Author: Radhika R
Credit Card Transaction failed : Invalid Profile ID or Key
When saving a Credit Card Transaction, user is receiving a warning A payment hold has been placed on this Payment due to an authorization decline for Credit Card xxxx. You then navigated to Payment Method tab > Payment Events subtab and clicked View. In the Payment Event window > Response Information > Details field, it says “Invalid Profile ID or Profile Key. Correct the profile… Continue reading Credit Card Transaction failed : Invalid Profile ID or Key
Add an Image with Text Overlay
You can add an image with text overlay to multiple areas on your website using Site Management Tools. To add an image with text overlay: Go to the page where you want to add an image with text overlay. Click Add on the Site Management toolbar. Drag the Image Text Overlay content type to the page. You can drag… Continue reading Add an Image with Text Overlay
Hashing passwords in NodeJS with bcrypt library
While submitting a form, there are some sensitive data (like passwords) that must not be visible to anyone, not even to the database admin. To avoid the sensitive data being visible to anyone, Node.js uses “bcryptjs”. This module enables storing passwords as hashed passwords instead of plaintext. We can install this package by using this… Continue reading Hashing passwords in NodeJS with bcrypt library
How to add primary key constraint in Sequelize
Sequelize provides the primaryKey option that you can add to your Sequelize model attributes. The primaryKey option allows you to assign the PRIMARY KEY constraint to your model columns. When you sync() the above Sequelize model, the user_id column will be created as the PRIMARY KEY column of the Users table in your database. You… Continue reading How to add primary key constraint in Sequelize
How to use operators in your Sequelize queries
When you use the Sequelize ORM for your JavaScript project, the SQL operators are included in the library in the form of the Op object. When you call the query methods from your model, you can use the Op object properties to create SQL queries with operators. for example, Sequelize provides several operators.
How to use JSON web tokens with Node.js ?
JSON Web Token (JWT) is an Internet Standard that is used for exchanging data between two parties in a secure manner. It can’t be easily hacked as it creates a digital signature with the secret key along with the HMAC algorithm). JWT Structure: JSON Web Tokens consist of three parts separated by dots (xxxxx.yyyyy.zzzzz), which are: Header: This… Continue reading How to use JSON web tokens with Node.js ?
The Sequelize include option
The Sequelize include option is commonly added in a model finder method (findOne(), findAll(), etc.)This option is used to add a JOIN clause to the generated SQL query, enabling you to retrieve data from multiple tables with one query.For example, suppose you have two related SQL tables named Cities and Countries.Each Cities row stores the information of which country it belongs to with the CountryId column as… Continue reading The Sequelize include option
Creating a transaction sequence using Sequelize
Sequelize supports running SQL statements under a transaction by using the Transaction object. To start a transaction using Sequelize, you need to create a Transaction object by calling sequelize.transaction() as shown belowconst trx = await sequelize.transaction(); The code above creates a Transaction instance named trx.When we run query methods from model, we need to pass the object as the transaction option. const trx =… Continue reading Creating a transaction sequence using Sequelize
Use EJS as Template Engine in Node.js
EJS or Embedded Javascript Templating is a templating engine used by Node.js. Template engine helps to create an HTML template with minimal code. Also, it can inject data into an HTML template on the client side and produce the final HTML. EJS is a simple templating language that is used to generate HTML markup with… Continue reading Use EJS as Template Engine in Node.js