How to create a custom field on entry form with add-on - expressionengine

Currently I'm working on an extension for Expression Engine (2.9.2) and I'd like to create a custom field on the entry form in Control Panel. So far I only found that it could be created via Channel Fields in CP which is not what I want. There are currently a lot of channels, some not using the default channel field configuration, and we would have to create the fields in Channel Fields multiple times and with different short names.
I know how to create fields in the database so storing/retrieving the information is not a problem.
I've had a look at the developer documentation and the hooks section but unfortunately it's not very explanatory in these regards and doesn't give examples.
Is there a way to create custom fields on the create/edit entry form automatically by an extension?
Thanks in advance.

Related

How to force custom sublist view (Saved Search) on specific roles

I have modified the view under communication > Messages for a supplier, so that nobody apart from Finance should be able to see certain transactions. I also managed to make the new one default. However, the users still see the other views in the view dropdown list and the ‘View History’ button shows communication history of everything.
Please advice on how to stop the users from using the other views and remove ‘View History’ button? I tried workflow but it did not work.enter image description here

Externally hosted form and NetSuite Data

I have a page hosted on an external site and I would like to create a form on that page. The use of the form would be to collect data to create SO in Netsuite.
In the form itself, I would like to have an autopopulate functionality so that for e.g. when I put in "Kat" in End User contact, I see all contacts starting with "Kat". This will enable me to select a correct contact and also help prevent duplication of data. Can you please guide me on how to structure this flow. What Netsuite components should i be using? For the external site, it will use Django.
Thanks
You need to create a couple of RESTlets in NetSuite. One to perform a search to get the contacts and return them in the payload, and one to create sales order in NetSuite and populate it with the values provided in the payload.
How are you solving the issue with CORS?

Umbraco uCommerce Secure Trading - need to use OrderNumber instead of OrderGuid

I am trying to use umbraco with uCommerce.
I have implemented SecureTrading as Payment provider in uCommerce. Now I need a solution to use OrderNumber in place of OdrderGuid to be used to identify the PurchaseOrder.
Currently OrderGuid is being sento to SecureTrading & this is being displayed in SecureTrading Transactions section. And due to this identifying the order is really hard.
We have appropriate value in OrderNumber field of PurchaseOrder table & we want to Display that value in SecureTrading's Transaction section.
Any way to achieve this?
If I try to write my own payment provider code, it'll be very huge task, also we have set the SecureTrading environment accordingly to uCommerce default preference.
Immediate help is required.
For more Detail
I have developed a DLL for my own customization as menthioned in http://docs.ucommerce.net/ucommerce/v7.3/payment-providers/integrating-a-payment-gateway.html But, that also is not working. the custom Payment Provider added in code(DLL) is not visible in backoffice to change the Payment Provider. There are all old entries for providers.
Even nothing shows up in cms Admin section for uCommerce Settings.
Thanks
Hi you can create a derrived version of the PageBuilder which will send the parameters to SecureTrading.
There's a protected virtual method you can override called "GetParameters".
It returns a dictionary that holds everything that will be send to SecureTrading.
You can set the "orderreference" in the dictionary to OrderNumber. This originally holds the orderguid.
Don't forget to register your page builder in the IoC container.
http://docs.ucommerce.net/ucommerce/v7.5/extending-ucommerce/register-a-component.html
You need to override the component by reusing the ID that the page builder has, which is: "SecureTradingPageBuilder". When overriding the page builder you don't have to change anything in the back office.
This should fix your problem :)

Liferay database table work flow?

I am new to Liferay. Now I need to create the flow chart which has the Liferay table work flow in following scenarios,
1) What are the list of table will reflect/update if we create the site admin?
2) What are the list of table will reflect/update if we create the site?
I tried by opening database tables and noticed that USER_, CONTACT_ will reflect, But I need list of all the related tables which will reflect when we create the site and siteadmin? I am using Liferay 6.2 version.
Thanks in advance.
When you want to know the internals of any system it is always best to check the relevant source-code. So in this case you can check the source-code for those classes which are used for CRUD operations on User and Site.
1) What are the list of table will reflect/update if we create the site admin?
Site-administrator is a Role, which can be applied to a User created in Liferay.
So if you want all the tables that are created from User-creation till User is assigned the Site-administrator role for a particular site, there here are some which I can recollect:
User_ (Obvious)
Contact_ (not so obvious :-) )
Group_ (Users are also created as a record in this table since Users have public and private pages)
Address (if you add an address)
Phone (if you add a Phone)
Users_Roles (Power user role is assigned by default)
UserGroupRole (user and site-role relationship, Site-administrator is a Site-role)
Users_Groups (user and site relationship)
For others you should refer the source-code for UserLocalServiceImpl, RoleLocalServiceImpl and GroupLocalServiceImpl, check the relevant methods prefixed add, update etc.
The corresponding service.xml for these module would reveal the database tables being used.
2) What are the list of table will reflect/update if we create the site?
Sites are nothing but Groups in Liferay. So its obvious Group_ table is playing a big role.
Other tables also depend upon what configuration you are doing while creating a Site.
Then there would be other tables like Layout when you start creating pages for a Site.
I would strongly encourage to go ahead and explore the source code for the classes and you would understand the flow - when and what tables are affected.
Here is some convention which might help you traverse the source-code, almost every *LocalServiceImpl is associated with a *Model like UserLocalServiceImpl with UserModel and almost every *Model has a corresponding database table with the same name.
Also the name of the functionality would in most cases hints at what service classes are being used to connect to database, like adding a User would hint at using UserLocalServiceImpl.
Hope I have understood your question and have been able to give some proper direction.
If you want to know this because you also want to write to these tables: Don't go there! You should purely use the API to change the data that Liferay stores. Otherwise you will run into disasters some time in the future - promised.
For just getting the SQL commands that Liferay actually uses, configure portal-ext.properties and change this default value:
hibernate.show_sql=false
Then go to "Server Administration/Log Levels" and add a new category "org.hibernate.SQL", configure it to the level DEBUG. Then the results show up in the logs. Note that this log configuration is transient and will be reverted on next server start. If you want the setting to be persistent, you'll need to go into Liferay's log4j configuration files.
Remember: You don't want to write to the tables ever. Promise!

Client Object Model access to Custom User Properties

I've setup up a custom user property via central admin and set the value on a couple of my users. That said when I query the User Information List using Query Builder I'm not seeing values for the field. I've even tried specifying the fields to return via ViewFields.
Anyone have any experience with this? Any other suggestions?
Thanks!
Casey
i've also searched a while, but the closed i came to was this... i ended up using the UserProfileService instead, like described in this article.

Resources