-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcomponent---src-pages-complex-take-wo-ownership-mdx-0fd64b64398425ea3b9b.js
2 lines (2 loc) · 4.69 KB
/
component---src-pages-complex-take-wo-ownership-mdx-0fd64b64398425ea3b9b.js
1
2
"use strict";(self.webpackChunkmas_playbook=self.webpackChunkmas_playbook||[]).push([[552],{3624:function(e,t,a){a.d(t,{Z:function(){return w}});var n=a(7294),r=a(8650),l=a.n(r),o=a(1597),i=a(811),s=a(87),c=a(5900),m=a.n(c),u=function(e){var t,a=e.title,r=e.theme,l=e.tabs,o=void 0===l?[]:l;return n.createElement("div",{className:m()("PageHeader-module--page-header--NqfPe",(t={},t["PageHeader-module--with-tabs--vbQ-W"]=o.length,t["PageHeader-module--dark-mode--WCeH8"]="dark"===r,t))},n.createElement("div",{className:"bx--grid"},n.createElement("div",{className:"bx--row"},n.createElement("div",{className:"bx--col-lg-12"},n.createElement("h1",{id:"page-title",className:"PageHeader-module--text--Er2EO"},a)))))},d=function(e){var t=e.relativePagePath,a=e.repository,r=(0,o.useStaticQuery)("1364590287").site.siteMetadata.repository,l=a||r,i=l.baseUrl,s=l.subDirectory,c=i+"/edit/"+l.branch+s+"/src/pages"+t;return i?n.createElement("div",{className:"bx--row EditLink-module--row--BEmSX"},n.createElement("div",{className:"bx--col"},n.createElement("a",{className:"EditLink-module--link--IDrl1",href:c},"Edit this page on GitHub"))):null},p=a(4703),h=a(1721),g=function(e){function t(){return e.apply(this,arguments)||this}return(0,h.Z)(t,e),t.prototype.render=function(){var e=this.props,t=e.title,a=e.tabs,r=e.slug,i=r.split("/").filter(Boolean).slice(-1)[0],s=a.map((function(e){var t,a=l()(e,{lower:!0,strict:!0}),s=a===i,c=new RegExp(i+"/?(#.*)?$"),u=r.replace(c,a);return n.createElement("li",{key:e,className:m()((t={},t["PageTabs-module--selected-item--aBB0K"]=s,t),"PageTabs-module--list-item--024o6")},n.createElement(o.Link,{className:"PageTabs-module--link--Kz-7R",to:""+u},e))}));return n.createElement("div",{className:"PageTabs-module--tabs-container--Cdfzw"},n.createElement("div",{className:"bx--grid"},n.createElement("div",{className:"bx--row"},n.createElement("div",{className:"bx--col-lg-12 bx--col-no-gutter"},n.createElement("nav",{"aria-label":t},n.createElement("ul",{className:"PageTabs-module--list--xLqxG"},s))))))},t}(n.Component),b=g,f=a(7296),E=a(5387),k=a(3732),v=function(e){var t=e.date,a=new Date(t);return t?n.createElement(k.X2,{className:"last-modified-date-module--row--XJoYQ"},n.createElement(k.sg,null,n.createElement("div",{className:"last-modified-date-module--text--ogPQF"},"Page last updated: ",a.toLocaleDateString("en-GB",{day:"2-digit",year:"numeric",month:"long"})))):null},w=function(e){var t=e.pageContext,a=e.children,r=e.location,c=e.Title,m=t.frontmatter,h=void 0===m?{}:m,g=t.relativePagePath,k=t.titleType,w=h.tabs,N=h.title,x=h.theme,y=h.description,P=h.keywords,T=h.date,C=(0,E.Z)().interiorTheme,D=(0,o.useStaticQuery)("2456312558").site.pathPrefix,Z=D?r.pathname.replace(D,""):r.pathname,B=w?Z.split("/").filter(Boolean).slice(-1)[0]||l()(w[0],{lower:!0}):"",H=x||C;return n.createElement(s.Z,{tabs:w,homepage:!1,theme:H,pageTitle:N,pageDescription:y,pageKeywords:P,titleType:k},n.createElement(u,{title:c?n.createElement(c,null):N,label:"label",tabs:w,theme:H}),w&&n.createElement(b,{title:N,slug:Z,tabs:w,currentTab:B}),n.createElement(f.Z,{padded:!0},a,n.createElement(d,{relativePagePath:g}),n.createElement(v,{date:T})),n.createElement(p.Z,{pageContext:t,location:r,slug:Z,tabs:w,currentTab:B}),n.createElement(i.Z,null))}},8766:function(e,t,a){a.r(t),a.d(t,{_frontmatter:function(){return i},default:function(){return m}});var n=a(3366),r=(a(7294),a(4983)),l=a(3624),o=["components"],i={},s={_frontmatter:i},c=l.Z;function m(e){var t=e.components,a=(0,n.Z)(e,o);return(0,r.kt)(c,Object.assign({},s,a,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h2",null,"About this task"),(0,r.kt)("p",null,"A common scenario for customers is for the technician to take ownership of the WO in the details page. For this example to work, ensure the owner attribute is part of the woDetailResource and display this on the details page."),(0,r.kt)("h2",null,"Procedure"),(0,r.kt)("h3",null,"Step 1: In App.xml add a button to the “workOrderDetails” page."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-xml"},' <button icon="carbon:user--avatar" on-click="ownershipClick" label="Take Ownership" on-click-arg="{{\'item\':woDetailResource.item,\'datasource\':woDetailResource}}" hidden="{woDetailResource.item.owner==app.client.userInfo.personid}"/>\n')),(0,r.kt)("h3",null,"Step 2: Crete the method in AppCustomizations.js file."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-js"}," async ownershipClick(event){\n let item=event.item;\n let datasource=event.datasource;\n item.owner=this.app.client.userInfo.personid;\n await datasource.save();\n }\n")))}m.isMDXComponent=!0}}]);
//# sourceMappingURL=component---src-pages-complex-take-wo-ownership-mdx-0fd64b64398425ea3b9b.js.map