Hi Team, somebody knows how to get the UId for an schema on a Freedom Page? I was using Terrasoft.EntitySchemaDesignerUtilities.getEntitySchemaUIdByName(EntityName) on classic, but seams not be working.
Like
This will work, even from Freedom UI pages:
const entityName = "Account";
const entityUid = Terrasoft.configuration.ModuleStructure[entityName].entitySchemaUId;Ryan
Hello,
Can you please describe the approach that is not working a little bit more? Here is an example for the "Knowledge Base" section which is a Freedom UI section:
Also works properly for the custom section created in FreedomUI.
Oleg Drobina,
I'm trying to do it from a handler trigger from a button. For some reason is not getting there.
My version is 8.1.0.6672
Federico Buffa,
you can try another approach:
{
request: "usr.CustomButtonClicked",
handler: async (request, next) => {
const sysSchemaModel = await sdk.Model.create("SysSchema");
const filters = new sdk.FilterGroup();
await filters.addSchemaColumnFilterWithParameter(sdk.ComparisonType.Equal, "Name", "Account");
const result = await sysSchemaModel.load({
attributes: ["Id", "UId", "Name"],
parameters: [{
type: sdk.ModelParameterType.Filter,
value: filters
}]
});
console.log(result);
}
}Create an instance of the SysSchemaModel and load results based on the object name.
I couldn't locate the scenario for retrieving the UId of SysSchema directly, but you can try using this approach.
Or another option:
var currentSchemaUId = Terrasoft.configuration.ModuleStructure.Account.entitySchemaUId;
This will also return the UId of the SysSchema of the section entity (just replace Account with the needed object name).
Oleg Drobina,
Thank you Oleg. I think to do the query as well, but perhaps some class was available. I will try this approch.
This will work, even from Freedom UI pages:
const entityName = "Account";
const entityUid = Terrasoft.configuration.ModuleStructure[entityName].entitySchemaUId;Ryan