Access 2013 form not updating when navigation button pressed - forms

First time on site. Forgive me, I'm probably doing this wrong, but I have searched for 2 days and not found my answer.
After entering data in the Lead Maintenance form, clicking the Registrar tab runs the following macro:
<?xml version="1.0" encoding="UTF-16" standalone="no"?>
<UserInterfaceMacros xmlns="http://schemas.microsoft.com/office/accessservices/2009/11/application">
<UserInterfaceMacro For="navbtnRegistrar" Event="OnClick">
<Statements>
<Action Name="SetWarnings"/>
<Action Collapsed="true" Name="OpenQuery">
<Argument Name="QueryName">qryEnroll</Argument>
</Action>
<Action Name="OpenQuery">
<Argument Name="QueryName">qryLeadMainUpdateEnrollToTrue</Argument>
</Action>
<Action Name="SetWarnings">
<Argument Name="WarningsOn">Yes</Argument>
</Action>
<Action Name="OpenForm">
<Argument Name="FormName">frmStudentsData</Argument>
</Action>
<Action Name="CloseWindow">
<Argument Name="ObjectType">Form</Argument>
<Argument Name="ObjectName">frmStudentsData</Argument>
<Argument Name="Save">No</Argument>
</Action>
</Statements>
</UserInterfaceMacro>
</UserInterfaceMacros>
The new data is being appended to the table properly, however the New Student data form is not displaying the appended data. Any suggestions?

It looks like your Student Data Entry form is in "Data Entry" mode, so it will automatically only show a blank record for your users to fill out. You would need to turn off Data Entry mode, a property on the form itself and turn on the navigation bar that you already have on the Lead Maintenance form so that users can navigate between records.

Related

Magento 2 custom column sorting not working

I have created custom column in Sales -> Order UI Grid. I have added "Profit" column. Which is not related to any database table and not the attribute. This column display just calculation of profit.
The issue is I can not sort the column. Column is sortable but it is sorting incorrectly.
I have checked many similar question in stack but nothing helpfull. As the column is not in table and not the attribute.
Following is my override file.
sales_order_grid.xml
<?xml version="1.0" encoding="UTF-8"?>
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<columns name="sales_order_columns">
<column name="total_paid" class="Company\Module\Ui\Component\Listing\Column\PurchasedPrice">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="label" xsi:type="string" translate="true">Profit</item>
<item name="sortOrder" xsi:type="number">13</item>
</item>
</argument>
</column>
</columns>
</listing>
Maybe this is already an old question, but it can be helpful for someone like me facing this issue.
According to this Magento 2 GitHub issue, there is a ui_bookmark table where some settings about UiComponents (and UI Grid component in my case) are stored.
Truncating this table and clearing the cache in my case fixed the problem of columns sortOrder in UI Grid.

Magento 2 - Copy price block to another location in product layout

I am trying to find a way to duplicate the price block so that it appears in two locations of the product page for specific products, by using the Layout Update XML field inside the design tab of the product edit page (Magento Admin).
I have successfully copied the price block by creating a modified layout XML file for specific products, for example:
theme_folder\Magento_Catalog\layout\catalog_product_view_id_178.xml
Inside this file I added the following in the required location:
<block class="Magento\Catalog\Pricing\Render" name="product.price.final.second.location" after="product.info.options.wrapper">
<arguments>
<argument name="price_render" xsi:type="string">product.price.render.default</argument>
<argument name="price_type_code" xsi:type="string">final_price</argument>
<argument name="zone" xsi:type="string">item_view</argument>
</arguments>
</block>
However there are too many products that use this modified layout and it would be easier to manage the product catalog if I could achieve the same thing just using the Layout Update XML field and entering a simple instruction like:
<copy element="product.price.final" destination="second.price.container">
Except there is no copy instruction, only a move instruction which is not what I want.
A different solution would be to have a way to select which layout XML to use from the product edit page, for example a yes/no attribute.
Is there a way to achieve this result?
I found the solution. The following XML inserted into the Layout Update XML field will copy the price block to a referenceBlock (or referenceContainer):
<referenceBlock name="my.reference.block">
<block class="Magento\Catalog\Pricing\Render" name="product.price.final.lower">
<arguments>
<argument name="price_render" xsi:type="string">product.price.render.default</argument>
<argument name="price_type_code" xsi:type="string">final_price</argument>
<argument name="zone" xsi:type="string">item_view</argument>
</arguments>
</block>
</referenceBlock>

How to add widget to layout in Magento 2?

Is there a way to add widget to the layout xml? I know about the layout updates from the backend, but I wanted to know if there is a way to add widgets the same way as static blocks?
you can add widget via followings xml ,
<referenceContainer name="content.top">
<block class="Magento\Catalog\Block\Category\Widget\Link" name="demoBlock" template="widget/static_block/default.phtml">
<action method="setData">
<argument name="id_path" xsi:type="string">category/20</argument>
<argument name="title" xsi:type="string">Demo Category Title</argument>
<argument name="template" xsi:type="string">category/widget/link/link_inline.phtml</argument>
</action>
</block>
</referenceContainer>
you need to update followings
referenceContainer as per you needs
Block Class & Template (if you require to update the template for block)
arguments in setData

Set layout Magento in advanced search

I have several stores with different layouts. When I make a search in a store, the result is displayed with the default layout. If I call getStore by AdvancedController, the result is correct but the page has incorrect layout.
In the default layout:
<catalogsearch_advanced_result translate="label">
<label>Advanced Search Result</label>
<reference name="root">
<action method="setTemplate"><template>page/2columns-right.phtml</template></action>
</reference>
<reference name="catalogsearch_advanced_result">
<action method="setColumnCount"><columns>4</columns></action>
</reference>
</catalogsearch_advanced_result>
while in another store layout:
<catalogsearch_advanced_result translate="label">
<label>Advanced Search Result</label>
<!-- Mage_Catalogsearch -->
<reference name="root">
<action method="setTemplate"><template>page/3columns.phtml</template></action>
</reference>
<reference name="catalogsearch_advanced_result">
<action method="setColumnCount"><columns>3</columns></action>
</reference>
</catalogsearch_advanced_result>
The result from each store is always displayed with the default layout.
How I can resolve it?
The Advanced Search Results layout is controlled through your theme's catalogsearch.xml layout file.
You can either modify that or override it using a local.xml layout file and change the template used for the advanced search results;
<?xml version="1.0" encoding="UTF-8"?>
<layout>
<!-- Advanced search result -->
<catalogsearch_advanced_result>
<reference name="root">
<action method="setTemplate"><template>page/1column.phtml</template></action>
</reference>
</catalogsearch_advanced_result>
</layout>
If you are changing the catalogsearch.xml and scratching your head as to why the layout isn't changing in your site then first of all verify that the theme author/other developers haven't already overridden this in local.xml

Symfony2: Scope Widening Exception

I want to inject a form and formHandler service into my controller.
<services>
<service id="acme_core.image_controller" class="Acme\CoreBundle\Controller\ImageController">
<argument type="service" id="session" />
<argument type="service" id="acme_core.image.form" />
<argument type="service" id="acme_core.image.form.handler" />
<argument type="service" id="acme_core.image_manager.default" />
</service>
</services>
Scope Widening Injection detected: The definition "acme_core.image_controller" references the service "acme_core.image.form.handler" which belongs to a narrower scope. Generally, it is safer to either move "acme_core.image_controller" to scope "request" or alternatively rely on the provider pattern by injecting the container itself, and requesting the service "acme_core.image.form.handler" each time it is needed. In rare, special cases however that might not be necessary, then you can set the reference to strict=false to get rid of this error.
What does this mean concret?
What should I add tom my image_controller.xml?
Best Regards
You have to add scope="request" in your service tag e.g
<service id="acme_core.image_controller" class="Acme\CoreBundle\Controller\ImageController" scope="request">
For more info check this cookbook entry.