Maximo Anywhere Tasks for new work order - maximo

Not able to create tasks for new work order from Anywhere. Please suggest
Able to create a new work order without task
Added a new view for tasks, and trying to add taskId, status, Asset with lookup and Location with lookup.
lookup are not visible in UI. Here is my code
<view id="WorkExecution.NewAdhocWorkOrderInspTaskView" label="Create Inspection Tasks" >
<requiredResources id="WorkExecution.NewAdhocWorkOrderInspTaskView_requiredResources">
<requiredResource id="WorkExecutionAdhocINspTaskView.NewAdhocWorkOrderView_additionalasset" name="additionalasset"/>
</requiredResources>
<container id="WorkExecution.NewAdhocWorkOrderInspTaskView_workOrder_container_0" resource="AdhocWOInspTaskResource" >
<group id="WorkExecution.NewAdhocWorkOrderInspTaskView_group_0">
<groupitem id="WorkExecution.NewAdhocWorkOrderInspTaskView_workOrder_groupitem_4" >
<text editable="true" id="WorkExecution.NewAdhocWorkOrderView_groupitem_WorkExecution0.Asset" label="Asset2" layoutInsertAt="item1"
lookup="WorkExecutionAdhocWOInsptask" lookupAttribute="assetnum" placeHolder="Tap to enter1" resourceAttribute="InspTaskAssetNum" />
</groupitem>
</group>
</container>
</view>
<resource additionalData="true" id="AdhocWO_InsptaskResource" name="AdhocWOInspTaskResource" describedBy="http://jazz.net/ns/ism/asset/smarter_physical_infrastructure#WoActivity" providedBy="/oslc/sp/SmarterPhysicalInfrastructure" >
<attributes id="AdhocWO_InsptaskResource_attributes">
<attribute describedByProperty="spi:taskid" id="AdhocWO_InsptaskResource_spi_taskid" name="InspTaskId"/>
<attribute describedByProperty="spi:assetnum" id="AdhocWO_InsptaskResource_spi_AssetNum" name="InspTaskAssetNum"/>
<attribute describedByProperty="spi:location" id="AdhocWO_InsptaskResource_spi_Location" name="InspTaskLocation"/>
<attribute describedByProperty="spi:status" id="AdhocWO_InsptaskResource_spi_Status" name="InspTaskStatus"/>
</attributes>
</resource>
<resource additionalData="true" describedBy="http://open-services.net/ns/asset#Asset" id="additionalasset" name="additionalasset" pageSize="1000" providedBy="/oslc/sp/AssetManagement">
<attributes id="additionalasset_attributes">
<attribute describedByProperty="dcterms:identifier" id="additionalasset_assetuid_dctermsidentifier" name="assetuid"/>
<attribute describedByProperty="spi:assetid" id="additionalasset_assetid_spiassetid" name="assetid"/>
<attribute describedByProperty="spi:orgid" id="additionalasset_orgid_spiorgid" index="true" name="orgid"/>
<attribute describedByProperty="spi:siteid" id="additionalasset_siteid_spisiteid" index="true" isExactMatchIndex="true" name="siteid"/>
<attribute describedByProperty="oslc:shortTitle" id="additionalasset_assetnum_oslcshortTitle" index="true" name="assetnum"/>
</attributes>
<queryBases id="additionalasset_queryBases">
<queryBase id="additionalasset_queryBase_getadditionalasset" name="getadditionalasset" queryUri="/oslc/os/oslcasset"/>
</queryBases>
<whereClause id="additionalasset_whereClause"/>
</resource>
<lookup id="WorkExecutionAdhocWOInsptask" label="Select Asset" resource="additionalasset">
<requiredResources id="WorkExecutionAdhocWO_Insptask.AssetLookup_requiredResources">
<requiredResource id="WorkExecutionAdhocWO_Insptask.AssetLookup_additionalasset" name="additionalasset"/>
<requiredResource id="WorkExecutionAdhocWO_Insptask.AssetLookup_workOrder" name="AdhocWOInspTaskResource"/>
</requiredResources>
<list id="WorkExecutionAdhocWO_Insptask.AssetLookup_additionalasset_list" resource="additionalasset">
<listItemTemplate id="WorkExecutionAdhocWO_Insptask.AssetLookup_additionalasset_listItemTemplate_Item2Desc2" layout="Item2Desc2">
<listtext cssClass="bold textappearance-medium" id="WorkExecutionAdhocWO_Insptask.AssetLookup_additionalasset_Item2Desc2_assetnum" layoutInsertAt="item1" resourceAttribute="assetnum"/>
<listtext cssClass="bold textappearance-medium" id="WorkExecutionAdhocWO_Insptask.AssetLookup_additionalasset_Item2Desc2_description" layoutInsertAt="desc1" resourceAttribute="description"/>
<listtext id="WorkExecutionAdhocWO_Insptask.AssetLookup_additionalasset_Item2Desc2_location" layoutInsertAt="item2" resourceAttribute="location"/>
<listtext id="WorkExecutionAdhocWO_Insptask.AssetLookup_additionalasset_Item2Desc2_locationdesc" layoutInsertAt="desc2" resourceAttribute="locationdesc"/>
</listItemTemplate>
</list>
<returnAttributes id="WorkExecutionAdhocWO_Insptask.AssetLookup_returnAttributes">
<returnAttribute id="WorkExecutionAdhocWO_Insptask.AssetLookup_assetnum_asset" sourceAttribute="assetnum" targetAttribute="InspTaskAssetNum" />
</returnAttributes>
</lookup>

Related

Custom Product restrictions are not working on child components

I have created a custom product restriction for a component due to project specific visibility rules. This product restriction can be applied on ExampleListComponent, ExampleComponent and also can be used in homepage, product page or content pages as and when required. ExampleListComponent can have multiple ExampleComponent instances. When apply the restriction on ExampleListComponent(which is added directly on homepage content slot) it is working fine but when apply the same on ExampleComponent(child component) it is not working. Following are some code snippets
items.xml
<collectiontype code="ExampleCardList" elementtype="ExampleComponent" autocreate="true" generate="true" type="list" />
<itemtype code="ExampleComponent" extends="AbstractMediaContainerComponent" autocreate="true" generate="true" jaloclass="com.example.core.jalo.ExampleComponent">
<attributes>
<attribute qualifier="title" type="localized:java.lang.String">
<persistence type="property" />
</attribute>
<attribute qualifier="secondaryMedia" type="Media">
<modifiers read="true" write="true" search="true" unique="false" />
<persistence type="property" />
</attribute>
</attributes>
</itemtype>
<itemtype code="ExampleListComponent" extends="SimpleCMSComponent" autocreate="true" generate="true" jaloclass="com.example.core.jalo.ExampleListComponent">
<attributes>
<attribute qualifier="cards" type="ExampleCardList">
<persistence type="property" />
</attribute>
</attributes>
</itemtype>
<itemtype code="ExampleAvailabilityRestriction" jaloclass="com.example.core.jalo.restrictions.ExampleAvailabilityRestriction" extends="AbstractRestriction" autocreate="true" generate="true">
<attributes>
<attribute qualifier="product" type="ProductList">
<persistence type="property" />
</attribute>
</attributes>
</itemtype>
ExampleAvailabilityRestrictionEvaluator.java
public class ExampleAvailabilityRestriction implements CMSRestrictionEvaluator<ExampleAvailabilityRestrictionModel> {
public boolean evaluate(ExampleAvailabilityRestrictionModel restrictionModel, RestrictionData restrictionData) {
List<ProductModel> products = restrictionModel.getProduct();
if (CollectionUtils.isEmpty(products)) {
return true;
}
for (ProductModel product : products) {
if (!availabilityService.isProductAvailable(product.getCode())) {
return false;
}
}
return true;
}
}
I verified the other OTB restriction and code looks ok. Is there any other configurations required to be able to apply the restriction on child components.
This article helped me to resolve the issue.
https://answers.sap.com/questions/13121879/time-restriction-not-working-on-cms-link-component.html
Added the following line in examplecardcomponent.jsp
<c:if test="${ycommerce:evaluateRestrictions(component)}">
</c:if>
also we can add this on the parent component jsp(examplecardlistcomponent.jsp) while iterating the child components
<c:forEach var="exampleCard" items="${exampleCards}" varStatus="loop">
<cms:component component="${exampleCard}" evaluateRestriction="true" />
</c:forEach>

SSRS using Business Development Studio and FetchXML

I have the following Fetchxml for a Custom report to get all the Active Leads:
<fetch distinct="false" mapping="logical" output-format="xml-platform" version="1.0">
<entity name="lead" >
<attribute name="companyname" />
<attribute name="leadid" />
<attribute name="gr_totaltraveldays" />
<attribute name="gr_marketvertical" />
<attribute name="leadsourcecode" />
<attribute name="lastname" />
<attribute name="firstname" />
<attribute name="estimatedamount" />
<attribute name="gr_dayssincelastactivity" />
<attribute name="new_numberofattendees" />
<attribute name="ownerid" />
<order descending="false" attribute="ownerid" />
<filter type="and" >
<condition attribute="statecode" value="0" operator="eq" />
</filter>
</entity>
I got this FetchXML from Advance Find in CRM 2011.
When i use this FetchXML in my report DataSet I get below error:
The gr_totaltraveldays field is there. I looked into the Database for fields and this field is in LeadExtensionBase table.
i had the same problem in BIDS with FetchXML.i was getting the error : "The attribute "XXXX" cannot be found for entity "XX". Specify a valid query, and try again." However, the field existed in the entity and was published.
The solution was to change the connection string, adding the organization name, in the Datasource as following: {URL};{organizationName};
then it worked!
for example : https://XXXX.crm4.dynamics.com;org12345ab;
You can find the organizationname in the Settings --> Customization --> Deveoper resources.
Regards!
Check your connection string. I had the same problem with my report.Seems like your connection string is explicitly pointing to the right organisation.
https://aaaa.crm4.dynamics.com;
This should work

Openlaszlo 5.0.x getattribute, rotation

I am working on an animation. I am using .swf pictures which I rotate with code like below.
My problem is: I want to read the actual rotation angel or position of the view "MoAuxid" when I klick on button "Abfrage". How can I get this result?
Best regards
Main Program:
<Mond width="400" height="400">
<view name="Bedienung_rot" x="800" y="10">
<simplelayout axis="y" inset="8"/>
<text text="Output:"/>
<edittext id="outputID" text = "0"/>
<text text="Arc:"/>
<edittext id="WinkelID" text = "51"/>
<button x="000" y="160">
Rotation
<!-- Handler to execute the Method -->
<handler name="onclick">
var x = WinkelID.getText();
MoAuxid.rotate(x);
outputID.setAttribute('text',x);
</handler>
</button>
<text text="Output2:"/>
<edittext id="output2ID" text = "x"/>
<button x="000" y="160">
Abfrage
<!-- Handler to execute the Method -->
<handler name="onclick">
var x = MoAuxid.getAttribute('y');
output2ID.setAttribute('text',x);
</handler>
</button>
</view>
</Mond>
The Mond4.lzx includes the following code:
<!-- IMAGE RESOURCES -->
<resource name="Mo_Bkgnd" src="images/Kalender.jpg" />
<resource name="Mo_Aux" src="images/Mo_Zeiger_Aux.swf" />
<!-- CLASS: Mond -->
<class name="Mond" resource="Mo_Bkgnd">
<attribute name="stretches" value="both"/>
<attribute name="width" value="${this.unstretchedwidth *.5}"/>
<attribute name="height" value="${this.width}"/>
<attribute name="act_height" value="${this.unstretchedheight}"/>
<attribute name="act_width" value="${this.unstretchedwidth}" />
<attribute name="lasthour" value="00" />
<attribute name="lastminute" value="00" />
<attribute name="timezoneoffset" value="00" />
<attribute name="StdZeigWinkel" value="00" />
<attribute name="TagNachtWinkel" value="00" />
<attribute name="kalZeigWinkel" value="20" />
<attribute name="JahresWinkel" value="00" />
<attribute name="FeiertWinkel" value="00" />
<!-- Aux Zeiger -->
<view name="MoAux" resource="Mo_Aux" x="200" y="201" opacity="1" id="MoAuxid">
<method name="rotate" args="Arc">
var rotincrement = 0 + Arc;
var dur = 0;
this.animate('rotation',rotincrement,dur);
</method>
</view>
</class>

How does one find the Id of a queue in Microsoft CRM 2011?

I'm trying to add a task to a queue programatically. I found this example code: http://msdn.microsoft.com/en-us/library/gg328106.aspx, but it simply creates the queues instead of using existing ones. Is there an easy way to find the id of a queue?
I figured it out. I found that one can use the Advanced Find tool to generate FetchXML. Using that I was able to query for my queue and then get the ID.
Here's what I ended up using:
string fetchXml = #"<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>
<entity name='queue'>
<attribute name='name' />
<attribute name='emailaddress' />
<attribute name='queueid' />
<order attribute='name' descending='false' />
<filter type='and'>
<condition attribute='name' operator='eq' value='{0}' />
</filter>
</entity>
</fetch>";
EntityCollection result = service.RetrieveMultiple(new FetchExpression(String.format(fetchXml, queueName)));
var myQueue = (Queue)result.Entities[0];
Console.WriteLine(myQueye.Id);

Sharepoint 2010 - Adding Sample data to User Field type

Hi StackOverflow members!
I have developing custom list in Visual Studio (trough XML). I created list definition (with content type) and added list instance to it.
Here is schema.xml of my list:
<?xml version="1.0" encoding="utf-8"?>
<List xmlns:ows="Microsoft SharePoint" Title="Teams" EnableContentTypes="TRUE" FolderCreation="FALSE" Direction="$Resources:Direction;" Url="Lists/Teams" BaseType="0" xmlns="http://schemas.microsoft.com/sharepoint/">
<MetaData>
<ContentTypes>
<ContentTypeRef ID="0x010089E3E6DB8C9B4B3FBB980447E313DE94" />
</ContentTypes>
<Fields>
<Field Type="User" Name="Employee" DisplayName="Employee" Required="TRUE" ID="{7B18E941-BAAD-453A-895C-39579AB5A9F1}" Group="Sample Group" />
<Field Type="Boolean" Name="Manager" DisplayName="Manager" ID="{9FC927CC-45EB-4E9E-8F25-18AAEDF7DCAF}" Group="Sample Group" />
</Fields>
<Views>
<View BaseViewID="0" Type="HTML" MobileView="TRUE" TabularView="FALSE">
<Toolbar Type="Standard" />
<XslLink Default="TRUE">main.xsl</XslLink>
<RowLimit Paged="TRUE">30</RowLimit>
<ViewFields>
<FieldRef Name="Employee" />
<FieldRef Name="Manager" />
</ViewFields>
<Query>
<OrderBy>
<FieldRef Name="Modified" Ascending="FALSE"></FieldRef>
</OrderBy>
</Query>
<ParameterBindings>
<ParameterBinding Name="AddNewAnnouncement" Location="Resource(wss,addnewitem)" />
<ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" />
<ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_ONET_HOME)" />
</ParameterBindings>
</View>
<View BaseViewID="1" Type="HTML" WebPartZoneID="Main" DisplayName="$Resources:core,objectiv_schema_mwsidcamlidC24;" DefaultView="TRUE" MobileView="TRUE" MobileDefaultView="TRUE" SetupPath="pages\viewpage.aspx" ImageUrl="/_layouts/images/generic.png" Url="AllItems.aspx">
<Toolbar Type="Standard" />
<XslLink Default="TRUE">main.xsl</XslLink>
<RowLimit Paged="TRUE">30</RowLimit>
<ViewFields>
<FieldRef Name="LinkTitle"></FieldRef>
<FieldRef Name="Employee" />
<FieldRef Name="Manager" />
</ViewFields>
<Query>
<OrderBy>
<FieldRef Name="ID"></FieldRef>
</OrderBy>
</Query>
<ParameterBindings>
<ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" />
<ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_DEFAULT)" />
</ParameterBindings>
</View>
</Views>
<Forms>
<Form Type="DisplayForm" Url="DispForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
<Form Type="EditForm" Url="EditForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
<Form Type="NewForm" Url="NewForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
</Forms>
and elements.xml with list template and content type:
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<!-- Do not change the value of the Name attribute below. If it does not match the folder name of the List Definition project item, an error will occur when the project is run. -->
<ListTemplate
Name="TeamList"
Type="10000"
BaseType="0"
OnQuickLaunch="TRUE"
SecurityBits="11"
Sequence="410"
DisplayName="TeamList"
Description="My List Definition"
Image="/_layouts/images/itgen.png">
</ListTemplate>
<ContentType
ID="0x010089E3E6DB8C9B4B3FBB980447E313DE94"
Name="Team Member"
Group="Sample Group"
Description=""
Version="0">
<FieldRefs>
<FieldRef ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Name="Title" Hidden="TRUE" />
<FieldRef ID="{7B18E941-BAAD-453A-895C-39579AB5A9F1}" />
<FieldRef ID="{9FC927CC-45EB-4E9E-8F25-18AAEDF7DCAF}" />
</FieldRefs>
</ContentType>
<Field Type="User" Name="Employee" DisplayName="Employee" Required="TRUE" ID="{7B18E941-BAAD-453A-895C-39579AB5A9F1}" Group="Sample Group" />
<Field Type="Boolean" Name="Manager" DisplayName="Manager" ID="{9FC927CC-45EB-4E9E-8F25-18AAEDF7DCAF}" Group="Sample Group" />
</Elements>
The question is: how to add sample data to this list? Especially to field of type "User"?
I tried to add this code in list instance element like this:
<ListInstance Title="TeamList"
OnQuickLaunch="TRUE"
TemplateType="10000"
Url="Lists/TeamList"
Description="TeamList">
<Data>
<Rows>
<Row>
<Field Name="Employee">CONTOSO\joses</Field>
<Field Name="Manager">true</Field>
</Row>
</Rows>
</Data>
but, error occures: Error occurred in deployment step 'Activate Features': At least one field type in not installed properly. Any help for makeing it work with dialog would be very appreciated.
A User field is a special type of Lookup field. As such, the text value is represented in the format of ID;#TextValue. And really, it is only the ID that is important. The Value is largely ignored. This can be a problem because while the username will always be the same, the ID that represents that user will change from site collection to site collection.
Your row XML should look something like this:
<Data>
<Rows>
<Row>
<Field Name="Employee">99;#CONTOSO\joses</Field>
<Field Name="Manager">true</Field>
</Row>
</Rows>
</Data>
You said that this is being deployed to an existing site, so you can browse to the User Information page for CONTOSO\joses. The ID will be in the URL's query string. But be aware that even if the feature works in this site, there is no guarantee that the feature will work in other site collections.
To avoid this problem, instead of seeding a list instance using XML, I will generally use a Feature Receiver to pre-populate lists with User fields. I prefer EnsureUser because it will add the user to the site if the user does not already exist.
This will also work:
<Field Name="Employee">-1;#CONTOSO\joses</Field>
In SharePoint 2013 using -1;# to fill a column of type User is less prone to error.
If you misspell or provide a nonexistent user:
<Field Name="Employee">-1;#domain\nonexistent account or misspelled</Field>
The record is NOT created.
Explicitly specifying the ID may result in assigning an existing group or user and could be lot harder to debug. Especially if you also provide a value for the ID column:
<Field Name="ID">1</Field>
<Field Name="Employee">1;#domain\nonexistent account or misspelled</Field>
Both Rich's and Jonathan's answers are correct, just wanted to clarify and couldn't comment due to low rep.

Resources