Custom code inside Netsuite CRM like Salesforce? - crm

I want to write a sample query inside the Netsuite CRM.
In salesforce, we can create our own visualforce pages and apex classes. The same way, is it possible to write custom code in Netsuite CRM?
I found some .js files but not able to find which file lists up the customers records.
Do anyone have idea? Please share.
Thanks.

If you're well acquainted with Visualforce page, Apex and Triggers in Salesforce then probably you can think of them in Netsuite as javascript files only. In Netsuite terminology we called them as Suitescripts (Serverside Javascript).
Below is a relative comparison view
Visualforce Page : Suitelet.js
Apex Classes (REST) : RESTlets.js
Triggers : UserEvent.js and Client.js
SOQL Query : Saved search / Script Search
Page layouts : Forms
Visualflow : Workflows

There are several sets of options for this in NetSuite, broadly under the name SuiteScript. I'd check out the NetSuite help documents to learn more.
Within an existing form (Eg a customer form), you could write a script which runs in the web browser and fetches further information, or even runs a query (called a saved search) and then returns the data for processing or display.
There are server-side event scripts, where the same type of code can run during or after certain record events occur.
You may also want to examine Suitelets, which are custom pages where the displayed data is completely generated by a SuiteScript
Hope this brief intro helps. Again, the online help files are your friend.

Related

Wordpress - CRUD operation from the front end

I'm in a bit of crux here. I have this application designed that basically allows users to enter info, create an entry, etc. etc. all the usual CRUD operations from the front end only. No user should ever have to mess around with the admin page.
When this was designed, I was thinking of using the standard way of just using JavaScript to grab all the necessary info, put it into a JSON object, and send that back to the SQL database.
However, there are a few issues with this. I'm not sure how to hook up javascript code to a button in wordpress that will fetch the entered info and upload this to wordpress SQL database, and then later retrieve this information.
I've seen lots of plugins, for instance, wpdataaccess, which is create in terms of creating an SQL database and such, but it doesn't really have much functionality for a customizable CRUD front-end. There are shortcodes, which are about the closest that you can come to this.
But ideally I'd like to somehow just have a button with JavaScript code that says like ok grab the info from each of the fields and upload it to the SQL database.
Is this only possible with a custom-coded plugin? Or do plugins for this already exist? Or do I even need a plugin?
Really any help would be appreciated here.
Also, you're probably wondering why I'm using wordpress... I don't really have an option here - I've got a raspberry pi OS that was built on top of WordPress so I sort of have to stick with it.
Thank you so much
I was able to find a solution to this. Use the plugin gravity forms to have users enter their data. Then, you can display the data back with another plugin, gravity view.

Alfresco Share | Using dashlet into a custom page programmatically

I'm very new to Alfresco. My question is, how can we use a dashlet (created from scratch) into a page (created from scratch too)? What are the files and configurations to deal with, for including a dashlet into a page.
Moreover, the newly created page has to be similar to dashboard page but without authentication. The idea here is to do away from the default "Share" dashboard login flow.
Thanks.
A dashlet is simply a special type of web script, so yes, it is quite possible to place the same web script into a custom page by binding it into a component region.
The relationship between pages, templates, components and regions can be a little complex if you're new to Share development, so I'd recommend reviewing Dave Draper and Erik Winlof's Share Customizations Live presentation from last November's DevCon, where they introduce a sample project including an Ant build script and which includes a custom web script and page definition. The code can be downloaded from this Git repo as a basis for your own project.
You should not find that too many changes if any are required to your dashlet web script to make it work inside a custom page, but remember that if the user is unauthenticated then you will not have access to any information about them, nor will you be able to retrieve any data from the repository.
Let me try to answer this with some examples:
Alfresco page
To create an Alfresco Share page (you use share?), you need to create three files:
<TOMCAT>/webapps/share/WEB-INF/classes/alfresco/site-data/pages/my-page.xml
<TOMCAT>/webapps/share/WEB-INF/classes/alfresco/site-data/template-instances/my-page.xml
<TOMCAT>/webapps/share/WEB-INF/classes/alfresco/templates/org/alfresco/my-page.ftl
The first one defines your page, the second one defines what components (dashlets) you will use on the page, and the last one is a HTML template (in Freemarker) arranging your components.
The first two files are XML, a bit alfresco specific, but simple XML, and the last one you could put static HTML and it'd work, or you could put some freemarker macros.
What is in each of those files (examples), you can read on this page, written specially for you and this question :) (Don't ask, I felt like writing about it)
No authentication
To not use authentication, you can just put <authentication>none</authentication> in the page definition file (the first XML file).
Dashlet files
Basically, a dashlet can be at the minimum two files, usually 4-5 or something like that. The dashlet.get.desc.xml file signifies two things: desc.xml part says it's for a new component (dashlet), and get part says this component will answer to HTTP GET calls.
is usually placed somewhere bellow /webapps/share/WEB-INF/classes/alfresco/site-webscripts/org/alfresco/components. Doesn't really matter where bellow, but you would want to put it in some folder to manage all your code easier.
This file contains one important thing: url. Url defines what url your dashlet will answer to. And when you defined your page in the page definition above, you would put this url there to access the dashlet.
You could even access the dashlet directly, using the link http://localhost:8080/share/my/url/to/dashlet.
The other file, dashlet.get.html.ftl is, again, a freemarker template file. You put HTML there. You can also have a controller file for the dashlet, dashlet.get.js which prepares some dynamic content (it is written in server-side javascript and has access to some of Alfresco Javascript API).
Finally, you can put some internationalized text (translations) into bundles (basically, dashlet.get.properties, dashlet.get_DE.properties, dashlet.get_ES.properties etc, by browser lanugages).
There are also options to include client-side javascript or css files to this dashlet.
To see how exactly to assemble all this, you could try reading this page. Probably not really a good read, but it will hopefully clear some things up.
Sorry, just to be clear, you want to reproduce a share interface on an Alfresco repository, but without the login? Dashlets and interface components are webscripts, and webscripts are stored inside the repository, so in order to access them you need to be authenticated. You could use tag in the webscript xml description a runas="admin" or runas="guest" in order to achieve something. If i misunderstood, please let me know, and I'll try to help..

wanted selection of tags just like asp.net or stackoverflow,example?

At every question posting on websites like ASP.NET and Stack Overflow there's an option to select tags for questions. These tags are from a database, I need exactly the same solution fir my website. Can anyone suggest some an example?
I am using ASP.NET with a SQL Server database.
This may be the thing you wanted and then you can use jqueryUI autocomplete to achieve the autocomplete behavior as suggested by Kevin B
for storing tags in database definitely you have to manage it in database based on TAG -User relationship
While the server-side code is PHP, this tutorial shows you how you can build your own jQuery powered tag cloud that gets its data from the server (either the database or some other source).
the best solution present on internet ,exactly I wanted
https://github.com/harindaka/ASPTokenInput
Its uses the jqueryui API but it modifies it to fit perfectly to be able to adjust with C# code , to get the text on fly it process a url of an aspx page like a web service and retrieves the results from db on every key down event . you can code every thing you want in suggestion their ItemList.aspx.cs code and there you go , perfect harmony of C# code with power of Jquery

Creating a Website Widget / API

I recently created a website for a friend (asp.net/sql server), the website includes news of his company and he and his team update this frequently.
The question has been asked if i could now create a widget / api of some sort that visitors of the website could now include the news on there own website should they wish too. I feel this needs to be a one line of code intergration or something that is extremely easy to intergrate.
Any recommendations or articles are welcome.
EDIT: how is something like this created
http://img830.imageshack.us/img830/7769/codingabandwebsitecreat.png
Thanks
With jQuery's ajax and an asp.net handler that returns an injectable html chunk is my off hand guess at simple way. Other's will probably know of frameworks if you don't want to roll your own. Is RSS to primitive?
you could also write a REST service in WCF since you're using asp.net and have it return XML or JSON, depending on how you write your widget.
How something like that is created... Well, I've created a number of these and the process is fairly simple. Sorry I don't have an article to reference. Create a 'widget creation/builder' page with input parameters, when submitted either store those in the database and return an ID to associate with those settings, or generate a list of param's for those settings, or both. Simply output the <script> tag into a textbox. Like so (inside an AJAX callback):
$("#results").html("<script type='text/javascript' src='" + widget_path + params + "'></script>");
Where widget_path is the absolute path to the widget ASP script, and params is either something like key=454 or theme=sunny&source=34&count=50 etc. Either manually or using something like jQuery.param to serialize the form. An alternative would be two <script> tags with settings in the 2nd and calling a widget initialize function.
They can copy and paste that into their site, and that ASP script should output only JavaScript, which you can either document.write() or use a JS library (such as jQuery) to operate on the DOM (.click() etc). If using a database the ASP script would check the key param and grab the widget settings, if not then simply process the params. It's important to mention if you want to communicate back and forth with an API, you need cross-domain enabled or you could simply use JSON (in ASP script check for a 'callback' parameter, wrap JSON in that function name, and use jQuery.getJSON with &callback=? at the end); there are other methods of course.
If you use a database, make sure to take security into account (SQL injection, etc.)
WidgetBox looks like a good, mainline method as well.

Where is the best place to put a DB query in drupal?

I have a few forms who's data needs to be written to the main database in their own tables. Just simple name-email collection forms, that are part of regular pages in drupal. I suspect the right way to do this would be to write a module that would have the query in a function, but this is just a guess. I've never written a module before, and don't know how the form would be processed that way.
It's also a guess that to perform the db query within a node would be insecure?
The only other idea I have would be to use a php file on the server to do the form processing, with the db query written there, but that seems very non-drupal, as far as I can tell.
How to??
http://drupal.org/node/508 is Drupal's info on module development
You'll be wanting to use the function "db_query()"
You can use Drupal's built in methods to build forms though that will save the data for you. Have a look at the module developers guide though and you should be able to figure it out. Module development sounds intimidating but it's not as hectic as it seems once you actually know what's going on with Drupal (hence, read the guide).
Have you checked what's already out there? Webform may be able to solve your needs without any custom code.
Also, I highly recommend the book Pro Drupal Development if you want to learn more about Drupal and basic module development.
I'd second the Webform module. Create a really simple webform with name and email (results can be emailed or stored automatically in the DB, and can be exported easily in several formats). Then check out the Webform Block module to put that webform in a block and place wherever you need it on your site. No custom coding required!
Here is an excerpt from the Webform Block project page:
Allows embedding a webform node into a block which can be positioned in any block region (theme space permitting).
Handles redirecting back to the current page on validation errors.
A good use for this is to add a site wide contact form inline on your pages, such as in the footer or sidebar.
Multiple webforms can appear on the same page. The contents of the block is simply a node, so theme work can be done in the node-webform.tpl.php file as usual.

Resources