vtiger 7 related module quick create autofill - crm

I've created a custom module and related it to vtiger organizations module. The custom module has an uitype10 attribute to link the record to the organization.
Everything works except that the organization name field in the quick create form of my related module is not automatically filled in. What I mean is:
if I go to organizations list, click an organization, click on Contacts icon and then click on the add button to add a new contact from the organization panel, the quick create form shows the organizazion name already filled in with the organization name I currently am in.
if I go to organizations list, click an organization, click on my custom module icon and then click on the add button to add a new record from the organization panel, the quick create form shows the organization name as empty. I have to manually write the organization name in it.
What I need is that my module behaves like the contacts module, so when I add a new record from the organization panel, the field for organization name should already filled in.
Any idea on how to achieve this?

Vtiger store Relation between 2 modules in vtiger_relatedlists table and based on details in this table Create Button URL will get generated in function getCreateViewUrl() in RelationListView.php. You can get core file in modules/Vtiger/models/RelationListView.php.
Solution : Table crestel_relatedlists will have relationfieldid which store the fieldid of your organization module against relation with your module. If relationfieldid is set to "0" then you have to set it with exact fieldid which you can get from vtiger_field table.

Related

how to adda drop-down box to the basic info page of publisher portal?

I have wso2am4.0.0 and run success.
I want to change the textbox to drop down box of the Roles of basic info page (https://localhost:9443/publisher, Develop > Basic Info) , like image below.
How do I modify the source code of carbon-apimgt to make this change?
The publisher portal code can be found here - https://github.com/wso2/carbon-apimgt/tree/v9.0.174/features/apimgt/org.wso2.carbon.apimgt.publisher.feature
AFAIK, it's not possible. For that, you need to populate the existing roles list. Current publisher Rest API does not have such a resource to populate the role list and it only contains a validation resource[1].
[1] - https://apim.docs.wso2.com/en/latest/reference/product-apis/publisher-apis/publisher-v2/publisher-v2/#tag/Roles

Can we use two source table or more in a page or in page extension in AL BC365?

I've created a page extension which extends "item card" , now what i'm trying to do here is that i have a table which i created, and want to access fields of that table in this Page extension.
Basically the problem is that the "item card" page already have "item" as its source table, and i also want to access my table's fields in this page extension. Is there a way to do that?
I'm totally new to Microsoft Business Central 365 AL Development. So, Please help me out.
You will need to define a local variable for your table in your Page Extension.
Then using the trigger OnAfterGetRecord (also in your Page Extension) you retrieve the record in your custom table corresponding to the current Item.
Something like this (which I haven't tested) provided that the primary key in your custom table is Item No.:
trigger OnAfterGetRecord();
begin
MyTable.Get("Item No.")
end;
var
MyTable: table "My Table";

Filter page datasource based on record selection

I seem to be struggling with this. I am working on a project management app in Google App Maker. I am using SQL data models. The portion of the app I am having trouble with is several project detail pages linked with a project list page. I have no trouble going from the project list page to the first project detail page.
I have a table widget in the project list page, and the onClick code for a table row is:
app.datasources.Projects.selectKey(widget.datasource.item._key);
app.showPage(app.pages.ProjectPage);
This filters the first detail page with the primary key of the record in focus. No problem here. When I want to navigate the next detail page that has a different datasource (but I still need to filter using the same primary key) I am struggling.
If someone can guide me in making a button in the first detail page that when clicked gets the _key of the project loaded in that current page and filters another detail page for the same project in focus, (using another data model, let's call it ProjectBudgetPage for example) I would really appreciate the help.
This was one my latest attempts at navigation to other detail pages within a project, this was for an onClick event:
var widgets = widget.parent.descendants;
var projectID = widgets.HiddenProjectID.text;
var projectDataSource = app.datasources.ProjectBudgetView.item;
projectDataSource = projectID;
app.showPage(app.pages.ProjectInfoPage);
which results in: (TypeError) : Cannot read property '__gwt_instance' of undefined
at HeaderProjectTabs.HeaderContainer.InfoTabButton.onClick:5:5
I am not sure if I understood properly but I suggest that you start by checking this official App Maker template available here https://developers.google.com/appmaker/templates/partner-management/ which provides a ready-to-run app you can use to manage an internal list of partners, but you can also customize it with your own needs. I recently used most of the UI and logic of this template and I was able to integrate it with SQL data models and it works really great.
I noticed that for this template they are saving the (widget.datasource.item._key) to a Page custom property which you can access afterwards. Custom properties are page-level properties that store data for a single user session. Custom properties are useful when you need to bind properties of multiple widgets to a single value. More info available here https://developers.google.com/appmaker/ui/binding#custom_properties
In your scenario, you can create a new custom property (string) inside your ProjectInfoPage and then you can add a script to the button onClick event in your ProjectPage to save the _key or any other item to a page property. For example:
app.pages.ProjectInfoPage.properties.ProjectKey = widget.datasource.item._key;
app.showDialog(app.pages.ProjectInfoPage);
Then you can get the “ProjectKey” property by adding this to the onAttach event in your ProjectInfoPage:
var key = app.pages.ProjectInfoPage.properties.ProjectKey;
…
In the onAttach event you can filter the new model or pass the property values to a server script. I believe there are other approaches but I hope this helps!

Drupal 7: how to filter view content (with entity reference field) based on current page content

in my drupal 7 I have 2 content-types like these:
ContentA
ContentB (with a field Entity Reference to ContentA)
In the front-end detail page of ContentA, I would love to show a block/view with a list of ContentB whose Entity Reference field is set to the current ContentA.
I made a view of type Block and added it correctly to the page, but I cannot filter ContentB based on the current ContentA.
Could you help me?
Thanks
You should add a contextual filter for the value you will use for filtering to the block View of ContentB.
Then in your contextual filter in the "When the filter value is NOT in the URL" area select "Provide default value" and Type "PHP code" (You should have enable php filter for this). In your php code area you should have the following code
$node=menu_get_object();
return $node->field_your_machine_field_name['und'][0]['target_id']; // this is the field you will use for fitlering
Hope it helps
UPDATE
The above code will work if you need to show in your block similar results with the same selection (for example similar results of ContentB with the same selection in the referencing field of ContentA ).I will not delete because you might need it also in your project.I misunderstood. Actually the solution is simpler. You should add the contextual filter to the field and in "When the filter value is NOT in the URL" area select "Provide default value" and "Provide id from url"

Make new user data (collective.example.data) visible

I followed the collective.examples.userdata directive to add fields to member and I works very fine.
The new infos are well stored and visible in the ##personal-information but now I'd like to go to the next step and show the new fields in the author.cpt page to make the new fields visible for every members(in a site directory for instance). I think I need to customize the membershiptool.getUserInfo() function but I just don't now how to proceed. Anyone knows how could I do to show this new fields in the author.cpt ?
Thanks

Resources