Before Save Custom Script Repeated Every Time (After Save)
Collapse
X
-
I actually meant the conclusion
name=string\concatenate(name, ' ', “INC”);,
name=string\concatenate(name);
So that the formula knows in which field the string\concatenate is executed.
Or does this also work without “name=” ?
I haven't tried it yet, but I always build my formulas this way. -
Correct the string/contains should check the name instead. i have fixed the code above.
Thanks -
Hy rabii ,
in case I'm wrong, but isn't “name=” missing ?
->
if(entity\isAttributeChanged('lEGALFORM') && !string\contains(lEGALFORM, 'INC')){
name=string\concatenate(name, ' ', “INC”);,
name=string\concatenate(name);
} -
which version of espocrm you have ?
Just to confirm to avoid having the code executed repeatedly you can add some condition which triggers the code. in the code i have shared above, the result will be executed when condition is met. the legalform field changed and name doesn't contain INC.
It should work fine in custom formula script.Leave a comment:
-
-
Before Save Custom Script Repeated Every Time (After Save)
Hey,
I am creating a CODE for Before Save Custom Script, where COMPANY NAME LEGAL FROM IS EQUAL TO INC, than COMPANY NAME MUST BE ABC INC,
But when i am update any fields of that company every time it is ADDED INC at the end of the company like ABC INC INC INC
here is the code;
name = ifThenElse(
lEGALFORM == 'INC',
string\concatenate(name, ' ', "INC");,
string\concatenate(name);
);
how to stop the INC REPEATED AT Before Save Custom Script.
Thank in Advance
Tags: None

Leave a comment: