I have an error, when i save the formula, the validator won't let me save the changes. An error is written: "Formula value error: Parameter "NumberStyles" not found". I have added the necessary System.Globalization using for compilation.
How can I solve the validation problem without changing the business process code?
Hi! I'm using two namespaces System.Globalization and Terrasoft.Configuration.Disbursement, which has only three public classes and doesn't include name "NumberStyles".
"Other phone" and "Extension phone" are communication types only, not objects and their values are stored in the "ContactCommunication" table (actual number is stored in the "Number" column) with the correspondent "CommunicationTypeId" (Id correspondent values can be reviewed in the "CommunicationType" table). Also these communication types have no correspondent columns on the "Contact" enity side.
"Other phone" and "Extension phone" are communication types only, not objects and their values are stored in the "ContactCommunication" table (actual number is stored in the "Number" column) with the correspondent "CommunicationTypeId" (Id correspondent values can be reviewed in the "CommunicationType" table). Also these communication types have no correspondent columns on the "Contact" enity side.
Thank you for your answer! Do you know what I can do to create a validation for these two? I created 2 fields in the Contact object and now I want to somehow connect them to the ones from Comunications.
In this case you need to create a logic similar to the one that is triggered when new communication option is added to the ContactCommunication object (see the logic in the SynchronizeCommunicationWithEntity method from the CommunicationSynchronizer source code). Alternatively you can try creating a custom business process that will update a main contact record in case new value was added to contact communication option.
I achieved Asynchronous Validation when I have One. But How to implement asynchronous validation when I have multiple asynchronous validations to perform
I simplified the code from somewhere else and omitted an important part (the part that checks the previous validation functions result). I've updated the code in my original reply. Change yours like that and it should work.
Set up each validation as it's own function, something like this for each validation function:
validateThing1: function(callback, scope){
var result ={
success:true,
message:""};// do whatever async call to validate and then call below to return the result, // setting result.success = true if validation passed or result.success = false // if failed. If the validation failed, also set the message (will be displayed to user)
callback.call(scope ||this, result);}
Then, in the asyncValidate, you'll use Terrasoft.chain to chain all the validations together, something like this (in this example I have two validation functions "validateThing1" and "validateThing2":
I tried the same something like below but not able to achieve the target. Error Message is not coming and all records are saving which I ideally want to restrict from save as it is invalid,
I simplified the code from somewhere else and omitted an important part (the part that checks the previous validation functions result). I've updated the code in my original reply. Change yours like that and it should work.
Unfortunately, the described behavior cannot be improved with a help of basic system tools as of now, but we have already registered a query for our responsible R&D team to improve this functionality in the upcoming releases of the main application.
Thank you for helping us to make our application better!
Hello Arkadiusz Polus, in order to perform this kind of validation you need to write a little bit of code in the schema page. Perhaps this article of the academy will light things up for you.
I wanted to implement a funtionality where a validation should happen on click of Approve button. If the valiation fails the approval should not happen.
To achive the above task I tried with the following approaches, on the "UsrReturns" custom object.
Tried to implement "asyncValidate" on "UsrReturnsVisaPageV2", but it didn't work (Seems the approval is happening outside the context of this page). Also not sure what is the use of this page.
Tried to implement validation using Entity Events Layer on the object "UsrReturnsVisa". Although it didn't approve the request, but it didn't throw the exception as well with the following code,
if(true){thrownew Exception("Can not approve");}returntrue;
Tried to implement a custom approval logic using "ApprovalDashboardItemViewModel", but I can not create a replacing schema with this.
So need a way to implement such funtionality. Any suggestions will help.
this is a bad request response returned by the app and we need to see the actual response (from the "Response" tab of the request in the "Network" tab).
To add some logic upon approval you need to replace the "approve" method in the "VisaNotificationsSchema" module (for "reject" actions its "reject" method). You will be in the context of the approval record and you can use data from there to process further with the approval\rejection. So you need to override the logic of these two methods.
The above logic is working as expected when I am uploading files of small size (< 500 KB). But the issue happens when I try to upload larger files, the following popup appears instead of the custom exception.
Any suggestion how to resolve the issue for larger files?
The logic provided in the previous post doesn't depend on the file size (that is specified in the system setting with "MaxFileSize" code). Additionally it doesn't use file locator in it, it only uses values from the account object column and compare it to the current date and time. There should be another custom logic that generates this exception, something that is triggered when adding the file to the system and if the upload is restricted another logic stops its execution with this exception.
#region Methods: Publicpublicoverridevoid OnFileSaving(){
var ClaimId = Entity.GetTypedColumnValue<Guid>("ClaimsId");
var ResultESQ =new EntitySchemaQuery(UserConnection.EntitySchemaManager, "Claims");
ResultESQ.UseAdminRights=true;
ResultESQ.AddColumn("Id");
ResultESQ.AddColumn("ClaimStatus");
var Result = ResultESQ.GetEntity(UserConnection, ClaimId);
var DCMStatus = Result.GetTypedColumnValue<Guid>("ClaimStatusId").ToString();if(DCMStatus =="ff78a06e-9d37-474a-841c-32a8faaa7776"|| DCMStatus =="13c42d45-0fb9-4854-9a5d-5a5feb126db2"|| DCMStatus =="19226327-e2ff-420c-937e-c36949be4425"|| DCMStatus =="3adf1d1d-bc90-475b-b24b-ca837e9ca9fc"|| DCMStatus =="942af147-3fc9-4a80-89aa-76f0412e0ade"){
base.OnFileSaving();}else{thrownew Exception("Attachments can not be added as Claim is already Submitted.");}}#endregion
When the file size is small, the following popup is coming:
When the file size is large, the following popup comes up:
The above popup comes only when the above condition is met. We have not implemented any other logic for this object. Could you help us here with what might be the cause of the issue, when it is working fine with smaller files but not with larger files.
I have a requirement, when a user changes the DCM status manually validation should trigger. To achieve this I am using asynValidate function and the validation is working fine.
But the issue here is status is not restoring back automatically and also both Save and Cancel button is showing as a result when I am trying to create a record in the connected detail the validation is triggering again. I have to manually click on Cancel before I can do any changes in the details. Please refer the screenshot below.
Before validation:
After validation:
Is there anyway after validation it should reset back to Close like in the 1st image?
This element will generate the code itself and you don't need to change the Schema manually, which will be much complicated and could potentially affect the whole page.