Hi Community,

 

Our customer has requested a bar code scanner inside Creatio, so they can scan products and check its information.

We have multiple ways of doing this:

 

  1. WebApp (Custom Component) that opens the smartphone camera;
  2. WebApp (Custom Component) that establishes a connection to a scanner device (for example a Zebra Scanner);
  3. Bar code scanner in the mobile app, which we will be able to configure as described here https://academy.creatio.com/docs/8.x/resources/release-notes/8-2-1-energy-release-notes#title-2782-13.

     

For our use case, we will be using the first option, since option three is not available at the moment.

 

After some digging, we discovered that there are multiple libraries that could help us implement this use case. However, we decided to post this question to know if someone has already implemented something similar, or at least tried to. So, we can share the know-how behind it.

 

Thank you.

Like 3

Like

2 comments

Have not tried, also looking forward to some knowhow. Not just to scan, but also to generate for event registrations for example. 

I have integrated a barcode scanner with Creatio. We've used a simple bluetooth barcode scanner connected to the device (in our case it was a tablet with full Creatio open in the browser). Most barcode scanners work just like a connected keyboard. When a barcode is scanned it sends the "text" value of the barcode to as input, just as if it were typed in. In my solution, we had a page that opened and we set focus to a text/input field on the page and dislayed some message about "waiting for barcode" for the user. Then, once scanned, the text value of the barcode scanned triggered a change event for the text/input field and we then did the action needed for the barcode (which in our case the barcode was a vehicle VIN, so we then used an API to get the vehicle details for the scanned VIN). All really simple to be honest. Using this approach, thinking of the barcode scanner as text entered by an input device, just like a keyboard, it all turned out to be really easy to work with.
Hope this helps.

Ryan.

Show all comments

Hi

I am trying to follow the example of building a custom components using remote module from this page: 

https://academy.creatio.com/docs/8.x/dev/development-on-creatio-platform/front-end-development/freedom-ui/remote-module/implement-a-remote-module/overview

But when I reach the part of building the project on VS code using "npm run build" I always get the following error:

 

Generating browser application bundles (phase: setup)...C:\Users\Lenovo\Downloads\example4\node_modules\webpack\lib\container\ModuleFederationPlugin.js:58
                       throw new TypeError(
                             ^
TypeError: The 'compilation' argument must be an instance of Compilation
   at ModuleFederationPlugin.getCompilationHooks (C:\Users\Lenovo\Downloads\example4\node_modules\webpack\lib\container\ModuleFederationPlugin.js:58:10)
   at C:\Users\Lenovo\Downloads\example4\node_modules\webpack\lib\container\HoistContainerReferencesPlugin.js:36:33
   at Hook.eval [as call] (eval at create (C:\Users\Lenovo\Downloads\example4\node_modules\tapable\lib\HookCodeFactory.js:19:10), <anonymous>:88:1)
   at Hook.CALL_DELEGATE [as _call] (C:\Users\Lenovo\Downloads\example4\node_modules\tapable\lib\Hook.js:14:14)
   at Compiler.newCompilation (C:\Users\Lenovo\Downloads\example4\node_modules\@angular-devkit\build-angular\node_modules\webpack\lib\Compiler.js:1121:30)
   at C:\Users\Lenovo\Downloads\example4\node_modules\@angular-devkit\build-angular\node_modules\webpack\lib\Compiler.js:1166:29
   at eval (eval at create (C:\Users\Lenovo\Downloads\example4\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:31:1)

   

Any help for this?

Like 0

Like

1 comments

Hello,
I do not believe this issue has something to do with the article you provided or the Creatio system. Try to look for this error in other sources for example here.

Show all comments

Hi, folks. By default, custom angular components have no setting UI panel, as on screen. I haven't found any info in docs, so maybe here somebody knows how to add user-friendly way to set up component?

Like 0

Like

2 comments

Hello,
​​​​​​​
Unfortunately, for now, the system does not support such no-code option. However, already informed our developers about this option, and they will work on this feature in future versions. 

Thank you for helping us improve the system!


Best regards,
Ivan

Ivan Savenko,

ok, thx. Maybe there is some way to detect when page opened in configuration mode?

Show all comments

Hi,

I'm developing my own custom Angular component for Creatio. I would like to use some of the standard components within it, such as a lookup field. How can I achieve this?

Is it possible to create a custom component that acts as a container for other elements, similar to crt.FlexContainer, which defines an items property for child components?

 

Like 1

Like

1 comments

Hello Eryk,

Unfortunately, it's impossible to reuse components in custom angular components for now, but Creatio plans to add such functionality in future releases.

Show all comments

Hi,



I have been working on adding new custom components using the new freedom UI following the below Creatio article.

https://academy.creatio.com/docs/developer/front_end_development_freedom_ui/remote_module/implement_a_remote_module/overview



After doing some additional research I was able to add some custom components successfully. But I'm kind of stuck on where I need to pass the data from Creatio's side to that specific angular component. Please refer to the below screenshots of my code snippets and if anyone has any idea on what I'm missing can you guide me or provide some resources to get more idea on this?

 

Below is the "card.component.html" file:

<mat-card class="card-class" *ngFor="let val of valuelist" >
    <mat-card-header></mat-card-header>
    <mat-card-content class="content-wrapper">
        <div fxFill fxLayout="row">
            <div fxFlex="30" fxLayout="space-around center">
                <div fxFlex fxLayoutAlign>
                    <img mat-card-sm-image src="https://material.angular.io/assets/img/examples/shiba2.jpg" alt="Free Image" class="responsive-image"  >
                </div>
                <div fxFlex fxLayoutAlign>
                    <img mat-card-sm-image src="https://material.angular.io/assets/img/examples/shiba2.jpg" alt="Free Image" class="responsive-image" >
                </div>
            </div>
            <div fxFlex="55" fxLayout="column" fxLayoutAlign="center start" class="contentN" >
                <mat-card-title>{{val}}</mat-card-title>
                <mat-card-subtitle>{{val}}</mat-card-subtitle>
            </div>
            <div fxFlex="15" fxLayout fxLayoutAlign="center center" class="contentP">
                <img mat-card-sm-image src="https://material.angular.io/assets/img/examples/shiba2.jpg" alt="Free Image" class="responsive-image" >
            </div>
        </div>
    </mat-card-content>
    <mat-card-footer></mat-card-footer>
</mat-card>

 As in the above, from using ngFor I'm adding cards based on the data which are coming from the "valuelist". Below is the example of the "card.component.ts" file:



 

import { Component, EventEmitter, Input, OnInit, Output, ViewEncapsulation } from '@angular/core';
import { CrtInput, CrtOutput,CrtInterfaceDesignerItem, CrtViewElement } from '@creatio-devkit/common';
 
 
@Component({
  selector: 'mlcgd-card',
  templateUrl: './card.component.html',
  styleUrls: ['./card.component.scss'],
  //encapsulation: ViewEncapsulation.ShadowDom
})
 
/* Add the CrtViewElement decorator to the Textpromt component. */
@CrtViewElement({
  selector: 'mlcgd-card',
  type: 'mlcgd.Card'
})
 
/* Add the CrtViewElement decorator to the InputComponent component. */
@CrtInterfaceDesignerItem({
  /* Manage the element layout in the library of the Freedom UI Designer. */
  toolbarConfig: {
    caption: 'Card View',
    name: 'CardView',
    /* The path to the component image. */
    icon: require('!!raw-loader?{esModule:false}!./icon.svg'),
    defaultPropertyValues: {
      label: 'Card View'
    }
  }
})
 
export class CardComponent {
 
  valuelist:string[] = [];
 
  constructor() {}
 
  @Input()
  @CrtInput()
  /* ...............The input value. */
  public value: string = 'Lakindu, Chinthana, Deshan';
 
  @Output()
  @CrtOutput()
  /* ................Track input value changes. */
  public valueChange = new EventEmitter<string>();
 
  ngOnInit(): void {
    this.valuelist = this.value.split(',')
  }
}

As you can see in the above code snippet I have a string called "value" and I have hardcoded 3 values for that. What I need to achieve is without hardcoding the data I need to get those data from the Creatio's end like from a field. So to do that I need to modify the code which is gonna add to the viewconfig array in the client schema. Please refer to the below Code snippet. And I need help with modifying it accordingly to pass the data from Creatio to the component.

 

{
				"operation": "insert",
				"name": "Card_hs3upn6",
				"values": {
					"type": "mlcgd.Card",
					"label": "Card View",
					"value": "$MLCGDName"
				},
				"parentName": "FlexContainer_08awxs2",
				"propertyName": "items",
				"index": 0
			}

Kind Regards,

Lakindu

Like 4

Like

5 comments

Hello,

You can find an example of working with the field value in these articles.

https://academy.creatio.com/docs/developer/front_end_development_freedo…

https://academy.creatio.com/docs/developer/front_end_development_freedo…

They described information on how to create a validator/converter for the value in a field.

Hello,



Thanks for sharing this but I'm afraid this might not be the one that I'm looking for. Anyways do you have anything related to dashboards? Like adding a new dashboard element using a remote module?



I was able to add some components there but for the moment I am kind of stuck at passing the data to the created component using the remote module.

Unfortunately, no, we don't have such examples.

To be honest, the remote module is quite a fresh feature, which means that currently, it doesn't have much logic. If possible, it would be better to use other methods to add your business logic.

Lakindu Yasomith,

Maybe this article can help you:

https://academy.creatio.com/docs/developer/front_end_development_freedo…

 

If not, please let us know. Maybe you can describe your case in more detail for support@creatio.com.

Lakindu Yasomith,

Hi,

 

I'm also working on a custom component and have the same issue.

Did you find a solution to this?

 

Br,

Robert

Show all comments