web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Custom Transformation Rules

(0) ShareShare
ReportReport
Posted on by 172

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

I have the same question (0)
  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at

    They're used in Data Exchange management from NAV.

    Start checking these links:

    msdn.microsoft.com/.../dn495312(v=nav.90).aspx

    msdn.microsoft.com/.../mt299581(v=nav.90).aspx

  • Suggested answer
    Community Member Profile Picture
    on at

    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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

#1
HoangNam Profile Picture

HoangNam 7

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans