How to generate unique ID field in module in sugarcrm - sugarcrm

Want to generate the unique ID field in the module which will automatically generate the unique IDs. Can anyone help help for this ?
Thanks

There is a function inside of SugarCRM called create_guid() which does this exact thing.

Related

Increment embedded entity property using function style value using Typeorm #createQueryBuilder

Here is my entity definition
What I want to achieve is increment
status.sentCount
on every api call made.
I have gone through documentation and tried to implement the solution for embedded entity
Although it work for direct field like "age" but doesn't seem to be working for simple-json object "status".
Thank you. Any help is appreciated.
You're dealing with jsonb type data, which you cannot update directly. You can use jsonb_set function provided by Postgres.
set(`jsonb_set(status, '{sentCount}', 'new_value')`)
I didn't try it but I hope it will work for you.
You can find more info here https://aaronbos.dev/posts/update-json-postgresql
Edited:
Use following query
UPDATE your_table SET status = jsonb_set(status, '{sentCount}', (COALESCE(status->>'sentCount','0')::int + 1)::text::jsonb) WHERE id = 1;

Add validation to duplicate value in suitecrm

I want to add a custom validation to first name and last name field to avoid duplicate values i tried following this example link
but its not working for me. Is there any experts who knows other ways to do this ?

magento 2 add product combine sku, name into url_key

Could I find the way to save url key by combine the sku attribute and name attribute on the time of add product. i don't want to write module or extension just need a clue how its happen on vendor/magento through code sample.
The product URL key is set in \Magento\CatalogUrlRewrite\Observer\ProductUrlKeyAutogeneratorObserver listening the catalog_product_save_before event.
The \Magento\CatalogUrlRewrite\Model\ProductUrlPathGenerator::getUrlKey method is used to generate the key.

Getting current item ID in SharePoint Infopath form

Can we get the current item ID value while submitting the data in InfoPath form.
I need to use this and concatenate the ID with other field value. Tired "Max(#ID) + 1" function but it wouldn't solve the problem.
I know it can be done using calculated column or workflow.
It needs to be done using InfoPath form ? Is it possible ?
You already figured it out yourself. Im assuming you are trying to use the ID in naming it.
Create a blank field.
Then add that field to your submission naming concat.
Create a receive data connection (assuming you havent) to that library.
On the Submit rule add the query action to that library and a set field action to set that new blank field with max(ID) + 1. Make sure Submit action is last.
That should do it unless Im missing something as I have used this many times!

drop down using liferay-ui:input-select tag

I want to customize the "meetups" portlet which is given by liferay.In that portlet now I have to do validation on fields(i.e mark few fields as mandatory) and create a field with drop down and that field has to be mapped to database.
can anyone please say how can i acheive this.
i have acheived the drop down functionality.Now i want to do client side validation using javascript.i am using document.getElementById('title) to retrieve the value.Sometimes it is working,sometimes it is not working.why is this happening