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!
*This post is locked for comments
Hi Mateusz,
If you still have problem with this. To create custom transformation create new record in Transformation Rule table with "Transformation Type" = Custom.
Then in new Codeunit you can create event subscriber function to table 1237 Transformation Rule with event type OnTrnasformation there you can change your date.
Hope this helps.
They're used in Data Exchange management from NAV.
Start checking these links:
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156