How to return only selected items from Pods Framework? - podscms

Just started using the PODS framework for Wordpress. Most of it I picked up pretty fast, the rest I'm struggling with. Below is an example of my confusion:
I created a custom post (Partner Bio) with auto-templates turned on.
I created a pods-template (Bio for Industry) that is sourcing post (Partner Bio).
I created another custom post (Industry) with multi-select post-type relationship field to post (Partner Bio).
The issue I'm having is that when I create an instance of post (Industry), then select specific items from that relationship (Partner Bio), (say there are 10, but I chose 3), I'm getting data returned for all of Partner Bio's instead of just the three I chose, so in other words the template pulling data from all Partner Bios regardless of what I choose in the post field drop down.
The template I'm using looks like this:
<div>{#post_thumbnail.thumbnail}<br/>
{#first_name} {#middle_initial} {#last_name}<br/>
{#title_of_partner}<br/>
{#position}<br/>
{#phone}<br/>
Email {#first_name}
</div>
This made me think that when you embed a pod usinge a shortcode, it's not being controlled by the fields selected when you edit your post. So then I tried grabbign the code from the template and then just dropping it in the post, that did not work either.
My goal is to display the block listed above one under another, based on which bios I choose. What am I doing wrong?
If my example above is confusing, here's a simpler sample illustrating the same issue, this maybe more clear:
Post A structure/fields:
Name,
Email,
Rel, // Post A's Relationship via post-type to Post B,
Auto templates: on,
Pods Template created: {#name}{#Emal}{#Image}
The issue, is when I create an instance of Post A and select items from the Rel, I'm getting values pulled in from all members of that relationship rather than just what I checked off.
If I turn off auto templates and drop in magic tags into the instance of Post A, I do get back only data for the relationship items I chose but I ge it back in this format:
Name and Name and Name
Emaile and Email and Email
Rather than:
Name
Email
Name
Email
...

Related

MS Access 2016: how to enter a concatenated field into a table from a form

TblEmployees has Fname, Lname and EmployeeName fields. EmployeeName should be Fname + Lname (i.e. John Doe). I want to enter Fname and Lname in a form FrmEmployeeData, and update TblEmployees with Fname, Lname and EmployeeName.
If FrmEmployeeData has as Data Source TblEmployees, how do I get the concatenated [Fname]&" "&[Lname] into the EmployeeName field of the table?
I also tried changing the DataSource of FrmEmployeeData to a query QryConcatenateFname&Lname where EmployeeName:[Fname]&" "&[Lname]. This gave the correct "John Doe" in the query result but I could not get it to update the TblEmployees.
What am I doing wrong? Thx.
It looks like you are learning access as this question is really too simple for stack overflow. Instead consult an Access book at your library or start finding Youtube vidoes and tutorials on the internet. Having said that here is a start:
Access gives you the ability to add a calculated field to a table in the design tab by treating it as a DataType. You can also add lookups and some data validation. Never do any of that!! Use forms to enter and search the data, and use reports to print the data.
A simple yet quite incomplete explanation is that as your database expands into multiple related tables you will find that entering the data directly into the tables is error prone for the database designer yet alone the clients. Because any observation will be distributed across multiple tables it becomes easier and easier to forget one or make a mistake as you add more and more tables.
Access is designed for quickly making simple forms for the tables in your database. If your relationships are already entered using the Relationships tool Access even generates starter forms that handle 1 to many relationships. Just click on a table and under home then forms group on the ribbon choose either form or form wizard and start playing with your new forms properties:
if you don't see the properties (hit f4 in most cases). Seriously every control has properties you can play with. In particular look at the control sources and for the form itself (hit the top left corner to select the form) check out the default view property.
I happened to include EmployeeName as a string in tblEmployees but there was no need other than having access put the EmployeeName textbox on the form. I would have to go back and delete EmployeeName from the table which is about the same effort as adding the textbox to the form myself. Below I show how to set the control source for EmployeeName to the usual FullName calculation
=[Fname] & " " & [Lname]
Access forms by default have both data entry and search capabilities. Play with the record selector highlighted at the bottom of the beautified form below. You can edit any record you see and the changes will appear in the table. If you go past the last record you can add a new record.

Unique form with many tables

I'm trying to create a form to fill three tables to describe some projects with the 'Title of the project' as common field. When I create the form I have to write the title three times, otherwise it's not posible to fill the tables. Is there any way to put just one of the three fields on the form but the three of them are filled?
The database is empty, I want to make a form to start introducing all the projects that are going to be done in my group of work. In one table there are data related to the project, like start dat , full budget etc. In another one the information about my company, like the group its doing it, its role etc. In the last one just some general information like related tags. The name of the project appears in all of them, but when I do the form from a query they seem not to be related even if I do it on the query.
I've already tried to do it with the Wizard tool, selecting the different tables and its fields. I also tried to check the form properties...but I can't come up with what I'm doing wrong...
I'm new using access...

Is there a way to assign the primary category for a product in demandware using the Open Commerce API (OCAPI)?

The primary category of a product is present in the product document (primary_category_id) in the DATA API but cannot be written. After sending a PATCH update of the product with a different primary_category_id, it doesn't change.
Is there a way of doing this through the OCAPI?
Can be some limitation for PATCH Method.Fields that can be updated:
name,
page_description,
long_descripton,
page_title,
page_keywords,
brand,
ean,
upc,
manufacture_sku,
manufacture_name,
searchable,
unit,
searchable,
online_flag,
default_variant_id.
Try with PUT Method. PUT https://hostname:port/dw/data/v19_1/products/{id}. Also,
please check Request Document.
At this time it does not appear that this is possible to manage via OCAPI.
I suspect that in the future you'd be able to achieve it using the following resources:
DELETE /catalogs/{catalog_id}/categories/{category_id}/products/{product_id}
followed by:
PUT /catalogs/{catalog_id}/categories/{category_id}/products/{product_id}
With a ProductCategoryAssignment document in the PUT call.
However, this would require that Salesforce adds those attributes to the ProductCategoryAssignment document.
The reason I suggest this is where it would be added is that within a catalog import document (XML) the flags are associated with a similar resource representation. eg:
<category-assignment category-id="gear-bags-backpacks" product-id="NSF4003100">
<primary-flag>true</primary-flag>
</category-assignment>

MS Access Form and Tables

I have a specific question regarding the utilization of three tables in a database. Table 1 is called Personnel, and lists the names of the staff.
Tables 2 and 3 are identical, just listing two different types of overtime (long and short), along with the hours of the OT, Date of the OT, and Assigned to/Picked fields that are empty.
Here is the idea, I just dont know how to implement it. I would like to create a form for people to enter their OT picks, then automatically move to the next person on the list. So Rich Riphon, as an example, would be up first, would click on the link I would send, and a form would open up, showing his name, populated by the first table, and showing two drop down menus, populated from the Long OT and Short OT tables. He would select one from each (or None, which would be a option) and Submit it.
The form action would be to place his name in the Assigned field for the OT he picked, and place a Yes in the Picked field.
When the next person in the list opens the form, it has moved down to number 2 on the Personnel list, Cheryl Peterson, and shows her the remaining OT selections (excluding those that have a Yes in the Picked column).
Any suggestions or comments or better ways to do this would be appreciated.
First, I don't think ms access would be able to (easily) kick off the process based on a hyperlink. You may be able to do something by passing a macro name to a cmd prompt but it would take some mastery to get it working properly. Could you instead create a login form to get the current user? If you do that you don't really need to display the personnel list, just keep track of who has not yet responded to the OT request. Essentially at that point all you would need on your form is a listing of the available OT and a button that creates the assignment. Also it may be easier (and a better design) to only have one table for the OT listings and add a column for the type of overtime (long/short).
What if Cheryl isn't the 2nd person to get the form? Your concept goes out the window.
Instead, I would keep a table of all user names, and their security level. managers can see everything, individual users can only see their record. This would be done by using a query behind the OT Picks form, and either filtering by the current user or not filtering at all. I have done many of these types of "user control" databases and they all have worked well.
As for the actual OT tracking, I agree with Steve's post in that it should be done in one table This would be the preferred method of a concept referred to as "normalizing data". You really want to store as little data as possible to keep the size of your database down. As an example, your Login table would have the following fields:
UserID
FirstName
LastName
SecurityLevel
Address1
Address2
City
State
Phone
Etc... (whatever relevant info pertains to that person)
Your OT table would look like this:
UserID
OTDate
OTHours
OTType
Etc... (whatever else is relevant to OT)
You would then join those 2 tables on the UserID fields in both tables any time you needed to write a query to report OT hours or whatever.

Yii, form using 2 models -> skip the validation on one

I have one form using to different models. I want to be able to create a new Person and eventually a new User, to give this person an account. A person doens't need to have a User related (could be just a person used for statistics or something like that). I have a checkbox in my form "Click if you want create a user" and I show the user part of the form if it's checked.
Then in the controller I can, with the checkbox value, know if I need call performAjax() for both Person and User or only Person.
But my problem is about the client validation. If I try to submit the form without the User required field, for example, the submition will abort and i'll get some errors like "This field is requiered".
So, my question is how could I skip the validation of my user model if its fields are empty (checkebox unchecked, we don't want to create a user).
Any help are welcom :)
Sorry for my bad English.
Have a good day :)
Michaƫl S.
When saving the model, set the first parameter on false to skip validation:
$model->save(false)