Invoke custom function that display a form - vtiger

I need to use multiple custom function on my VTiger. Currently i am successfully create a custom function that are passing a data from vtiger to other system whenever project are saved.
Now i need to create another custom function that prompt a form to the user to fill in. The data fill by the user would be saved on the database.
Is there anyway to call the custom function that can display a form a user to fill in and then processing the form. thank you.

Unfortunately it is impossible to invoke a form from vtiger custom function.

Related

Django: How to request data and simultaneously have it editable

I have a simple app that gets user input and when a button is clicked, the input is saved as an entry on the database. I'm thinking of creating another app that not only displays the same information (think of view profile) but also simultaneously lets the user edit the text that is displayed in the text field.
I'm guessing the solution is to have the text-fields be auto-filled by pulling the data from the database, and allow overwriting the data once the submit button is clicked.
Typically read and edit views are separated for good reasons like avoiding accidental edits, allowing different levels of access, things like that. But this capability does exist in Django via forms. If you already have a Form built for submitting the data, you can provide a page with existing data pre-filled by initializing the Form instance with the data - in the docs they call this a bound form. See this example in the docs to get an idea of the mechanics.

How to store a returned javascript value in a django form?

I want to store things like Browser type and GPS locations for mobile devices along with user input data.
I know how to set up a form in Django so that the user inputs are stored in the database. But how would I go about executing a Javascript function that will a return a value to be stored in the same model as all the user inputtext in the form?
I found reasonable two ways:
I would go for api and do request to server with information you want to store and put it to your model (for instance REST django-rest-framework). But its more complicated since you need to handle authorisation.
As altenative to api you could create hidden fields in form which would be filled by js code executed from the browser. When user clicks submit button he sends you data with no need to manually provide it.

auto-populate a column in a new row in edit list mode in SharePoint 2013

I have a list that is connected to a form and filtered based upon a value in the parent form (an ID field). I want to allow the users to add new rows by directly editing the list. In doing so, I don't want to have to make the users enter in the value that already exists on the form. I can't seem to find anyway of doing this.
Example Screenshot
Are you using infopath ? I think your option is to call a web service to verify such thing. Or if you customize your form using javascript you could achieve this the same way by javascript.

Flask drop-down list Ajax

I have an administrator page and each time when new user is added, administrator should determine group of that user (by default it will be viewer).
First, can someone please write how I can keep the default value in SQL-Alchemy?
Second, how can I update database based on drop-down list parameter?
If someone can share their own experience I will be grateful.
If I understand your question correctly, for #1 you need to store a default value in SQL-Alchemy. If you're using Flask-SqlAlchemy then you can define a default value like this:
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(80), default='John')
For SQL-Alchemy it wouldn't be much different.
And for your question #2, you need to define a controller that gets data from an Ajax call from the drop-down list and stores it in the database. I suggest using Select2 which has autocomplete and Ajax remote data features. As user types in the input it sends an Ajax call to the URL you define and you can get the keyword user is searching for. For a working example of Select2 you can visit this.

django save a form for a user that has not registered yet

I need some advice / ideas if someone is inclined to help: I have a javascript interface for manipulating pictures. Basically it's about moving photos around. Once it's done the position of images is saved into a Django form and then saved to database with the owner saved as the current user. Now the trick is that I would like to be able to allow non registered users to play with this interface and then if they like the result they hit save and are redirected to an account registration page and only then the form is actually saved with their user as the owner.
What comes to my mind now is to keep the values of the form in session but I don't know what will happen to the session once the anonymous user registers and becomes another user. I was also thinking of using a 'next' parameter in the registration process with the url filled with get parameters that would be the content of the form but then I don't know if userena is ready to allow that.
Any light on this is welcome.
Well, we did similar thing on our site.
When unregistered user attach photos we save objects to database and assign unique hash which was generated when user came to the page with form. When user hit submit we pass this hash in url and on the next step, when user wants to register, we just get objects from database by this hash and assign user_id to them.
Also we have a cron job which do clean up and removes all lost objects
P.S. Sorry for my english i hope you'll get my point
Save the object without the user and store a reference of that object in the session (or (signed) cookie). If if the user registers, update all the objects with the newly created user.
Another approach would be to store the data in the browser (html5 localstorage and fallbacks, or similar) and only insert it into the database once the user has signed up. You would need to make sure both things happen inside the same browser 'instance', but things would be easier in the server side.