I have tried remaining the DataMember name from capital "S" (ShipmentList) to lower-case "s" (shipmentList), but still not solved. Below link I referred before posting here but that not solved my issue, also, have a look at screenshot.
https://stackoverflow.com/a/46433472/4878854
You should use shipmentlist as a DataMember and not shipmentList.
If you open PX.Objects.SO.SOOrderEntry BLC/graph you can find the following dataview:
public PXSelectJoin<SOOrderShipment, LeftJoin<SOShipment, On<SOShipment.shipmentNbr, Equal<SOOrderShipment.shipmentNbr>, And<SOShipment.shipmentType, Equal<SOOrderShipment.shipmentType>>>>,Where<SOOrderShipment.orderType, Equal<Current<SOOrder.orderType>>, And<SOOrderShipment.orderNbr, Equal<Current<SOOrder.orderNbr>>>>> shipmentlist;
Related
today when I try to run my Strapi with some exercises, there was an error showing that inversedBy attribute flight not found target api::airport.airport. However, the command shows Admin UI was built successfully. but I cannot access the Admin panel and do anything with it. It seems that the error is belonging to one of the content, but the entire API is not working. What should I do? Does anyone know how to fix this bug?
enter image description here
Thank you.
Firstly, I tried to run the start command(npm run develop) for several time, it keep reporting same error.
Secondly, I tried to access the administration panel directly, it is apparently that I failed.
Hopes someone can help me to figure out, how can I solve this bug/error.
I had a similar error.
The issue for me related to a problem where the 'key'(i.e. attribute key in JSON) didn't match that was referenced by the model in the mappedBy & inversedBy.
e.g. mappedBy:"f_light" should point to
"f_light":{type:"relation",...) --
At least that was the problem for me
Strapi Docs on how the schema is supposed to look
My issue: Error on attribute a_token in model a-request(api::a-request.a-request): inversedBy attribute a-requests not found target api::a-token.a-token
This occurred because I inversedBy:'a-token' when the attribute key was 'a_token'. Changing them so they matched solved my issue ('a-token' -> 'a_token').
The naming conventions of mappedBy, inversedBy, and the attribute keys MUST use '_' instead of '-' for spaces, otherwise it will fail the naming convention tests.
How to get the current id that had been used when editing and viewing a record?
I am currently following the instruction by Alfonso Secas that he posted in this topic..
http://www.grocerycrud.com/forums/topic/1326-how-to-use-grocery-crud-and-image-crud-together/page-2
And now on the part where he said "When editing a record, get the current ID from $this->getStateInfo(); to compose the iframe's source url."
It seems like getStateInfo doesn't exist yet so it shows an error "Fatal error: Call to undefined method Examples::getStateInfo() "
http://www.grocerycrud.com/documentation/options_functions/getState
this will do what u want . give it a try
u need to use the CRUD object to call this function instead of $this ..
You have some options:
Primary key
getStateInfo()->get_primary_key
Last uri segment
end($this->uri->segments)
Does not work in list action.
As a workaround you can use one of CodeIgniter's methods to get id from page url
https://www.codeigniter.com/userguide3/libraries/uri.html
You need to take last segment from URI
$segmentsCount = $this->uri->total_segments();
$itemID = intval($this->uri->segment($segmentsCount));
p.s. it is not best solution but it can do the trick
I know there are plenty of topics on this but I searched&tried so many and it is still not working.
I have tables: Team and Worker. Any worker can be assigned to a Team. So at the Workers Manager I want to search Workers also by Team name.
I got the column etc. but when I type part of team name - search starts but the written text dissappears and search doesn't care about the field. I checked the AJAX call with Firebug and there is a field called teamName (I added public field to my Worker model class). But when I print_r criteria in my search method - there is no condition.
How is that possible? How can I perform the searching by related field?
EDIT (my serach() method):
public function dsearch()
{
// Warning: Please modify the following code to remove attributes that
// should not be searched.
$criteria=new CDbCriteria;
$criteria->compare('idWorker',$this->idWorker);
$criteria->compare('idLeaderType',$this->idLeaderType);
$criteria->compare('t.idTeam',$this->idTeam);
$criteria->compare('idVoip',$this->idVoip);
$criteria->compare('workLogin',$this->workLogin,true);
$criteria->compare('workPass',$this->workPass,true);
$criteria->compare('name',$this->name,true);
$criteria->compare('surname',$this->surname,true);
$criteria->compare('madeCalls',$this->madeCalls);
$criteria->compare('deleted',$this->deleted);
$criteria->compare('liveChanges',$this->liveChanges);
$criteria->compare('confirmer',$this->confirmer);
$criteria->compare('oldWorkerNum',$this->oldWorkerNum);
$criteria->compare('idDepart',$this->idDepart);
$criteria->compare('Team.name', $this->teamName, true);
$criteria->with=array('Team');
$criteria->together = true;
return new CActiveDataProvider($this, array(
'criteria'=>$criteria,
));
}
Use the mergeWith: Hope it works.
if($merge!==null){
$criteria->mergeWith($merge);
}
Reference:http://www.yiiframework.com/doc/api/1.1/CDbCriteria#mergeWith-detail
I found usefull extension to do that:
http://www.yiiframework.com/extension/relatedsearchbehavior/
I couldnt get it to work somehow. I downloaded new version and now its fine.
It works pretty well. Thanks for your time though.
I'm completely stuck in retrieving a specific node from a responseXML object that I got back from the GetUserProfileByName (SharePoint / SPServices). I need a specific PropertyData node (in the example "FirstName") and then retrieve the value of the "FirstName". Retrieving the value is not a problem, retrieving the specific node is...
Below a part from the returned XML (for the sake of the example I stripped some properties):
...
<PropertyData>
<Name>UserProfile_GUID</Name>
<Values>
<ValueData>
<Value xmlns:q1="...">206b47c7-cfdc-...</Value>
</ValueData>
</Values>
</PropertyData>
<PropertyData>
<Name>FirstName</Name>
<Values>
<ValueData>
<Value xsi:type="xsd:string">Maarten</Value>
</ValueData>
</Values>
</PropertyData>
...
Since I know that I need the property FirstName, I do not want to iterate through the entire set of PropertyData nodes until I've the correct one (slow). In XPath I can select FirstName just by saying:
//PropertyData[Name='FirstName']/Values/ValueData/Value
However, I cannot do that in the xData.responseXML object. I tried the following filter, finds and other things (in all kinds of variations):
$(xData.responseXML).SPFilterNode("PropertyData").find("[Name*=FirstName]")
$(xData.responseXML).SPFilterNode("PropertyData").find("[Name*='FirstName']")
$(xData.responseXML).SPFilterNode("PropertyData").filter("[Name*=FirstName]")
$(xData.responseXML).SPFilterNode("PropertyData[Name='FirstName']")
I did many searches, but was not able to find an answer. There were many partial answer which a I all tried, but were not working. Any one a clue...
Thanks in advance!
Maarten
#Maarten
I'm not at my computer right now to test, but try this:
$(xData.responseXML).find("Name:contains('FirstName')").closest("PropertyData")
REVISION 1:
Given your feedback that an additional element is returned (the phonetic field), here is a revised selector to only return the one containing the FirstName element:
$(xData.responseXML)
.find("Name:contains('FirstName')")
.not(":contains('SPS-PhoneticFirstName')")
.closest("PropertyData");
Paul
Doing a simple
db.Dictionary("select Id, Name from \"Product\"");
results in an exception
"column "id" does not exists"
The correct field name is "Id" - seems as if the Postgres in OrmLite does something to the "Id" field. Tried with some random field names with mixed casing and they also ended up in exceptions where the fields where displayed in all lower case.
Can this be achieved somehow or is this an error in OrmLite?
Is this also an issue in db.List, db.Lookup etc?
Have you tried putting the column in quotes to preserve the case?
db.Dictionary("select \"Id\", Name from \"Product\"");
There is a unit test example here https://github.com/ServiceStack/ServiceStack.OrmLite/blob/master/src/ServiceStack.OrmLite.PostgreSQL.Tests/OrmLiteSelectTests.cs#L195