Hello. I would like to create new custom transformation rule. There is in system custom rule UNIXTIMESTAMP (CodeUnit 1225):
Documentation()
OnRun()
LOCAL [EventSubscriber] TransformUnixtimestampOnTransformation(TransformationCode : Code[20];InputText : Text;VAR OutputText : Text)
IF TransformationCode <> GetUnixTimestampCode THEN
EXIT;
IF NOT TryConvert2BigInteger(InputText,OutputText) THEN
OutputText := ''
LOCAL [EventSubscriber] InsertUnixtimestampOnCreateTransformationRules()
TransformationRule.InsertRec(
GetUnixTimestampCode,UNIXTimeStampDescTxt,TransformationRule."Transformation Type"::Custom,0,0,'','');
LOCAL [TryFunction] TryConvert2BigInteger(InputText : Text;VAR OutputText : Text)
EVALUATE(TempBinteger,InputText);
OutputText := FORMAT(TypeHelper.EvaluateUnixTimestamp(TempBinteger));
GetUnixTimestampCode() : Code[20]
EXIT(UNIXTimeStampTxt);
Now, implementing above code, I would like to write own code to create ADDONEDAY Transformation Rule, which would add one day to specified date. I am new with NAV and developing it so I would like to start with add a simple record with new TransformationRule. I wrote this code (CodeUnit 99901):
Documentation()
OnRun()
LOCAL InsertAddOneDayToDateTransformationRules()
TransformationRule.InsertRec('ADDONEDAY', 'Add one day', TransformationRule."Transformation Type"::Custom, 0, 0, '', '');
I don't know how or where system should call above function to insert my Transformation Rule to the table. Is there any other place, where should I register own Transformation Rule?
Thanks for all answers! Good day for you all!